You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
5.0 KiB

  1. #
  2. # Copyright (C) 2013-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lxc
  9. PKG_VERSION:=1.0.5
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/
  13. PKG_MD5SUM:=9d9af9e9e69a831cd50b58d91c786013
  14. PKG_BUILD_DEPENDS:=lua
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_INSTALL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. LXC_APPLETS_BIN += \
  19. attach autostart cgroup clone config console create destroy execute \
  20. freeze info monitor snapshot start stop unfreeze unshare usernsexec wait
  21. LXC_APPLETS_LIB += \
  22. monitord user-nic
  23. LXC_SCRIPTS += \
  24. checkconfig ls top
  25. DEPENDS_APPLETS = +libpthread +libcap +liblxc
  26. DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
  27. define Package/lxc/Default
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. TITLE:=LXC userspace tools
  31. URL:=http://lxc.sourceforge.net/
  32. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  33. endef
  34. define Package/lxc
  35. $(call Package/lxc/Default)
  36. MENU:=1
  37. endef
  38. define Package/lxc/description
  39. LXC is the userspace control package for Linux Containers, a lightweight
  40. virtual system mechanism sometimes described as "chroot on steroids".
  41. endef
  42. define Package/lxc-common
  43. $(call Package/lxc/Default)
  44. TITLE:=LXC common files
  45. DEPENDS:= lxc
  46. endef
  47. define Package/lxc-hooks
  48. $(call Package/lxc/Default)
  49. TITLE:=LXC virtual machine hooks
  50. DEPENDS:= lxc
  51. endef
  52. define Package/lxc-templates
  53. $(call Package/lxc/Default)
  54. TITLE:=LXC virtual machine templates
  55. DEPENDS:= lxc @BROKEN
  56. endef
  57. define Package/liblxc
  58. $(call Package/lxc/Default)
  59. SECTION:=libs
  60. CATEGORY:=Libraries
  61. TITLE:=LXC userspace library
  62. DEPENDS:= lxc +libcap +libpthread
  63. endef
  64. define Package/lxc-lua
  65. $(call Package/lxc/Default)
  66. TITLE:=LXC Lua bindings
  67. DEPENDS:= lxc +liblua +liblxc +luafilesystem
  68. endef
  69. define Package/lxc-init
  70. $(call Package/lxc/Default)
  71. TITLE:=LXC Lua bindings
  72. DEPENDS:= lxc +liblxc
  73. endef
  74. CONFIGURE_ARGS += \
  75. --disable-apparmor \
  76. --disable-doc \
  77. --disable-examples \
  78. --disable-seccomp
  79. --enable-lua=yes \
  80. --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc" \
  81. MAKE_FLAGS += \
  82. LUA_INSTALL_CMOD="/usr/lib/lua" \
  83. LUA_INSTALL_LMOD="/usr/lib/lua"
  84. define Build/Configure
  85. ( cd $(PKG_BUILD_DIR); ./autogen.sh );
  86. $(call Build/Configure/Default)
  87. endef
  88. define Build/InstallDev
  89. $(INSTALL_DIR) $(1)/usr/include/lxc/
  90. $(CP) \
  91. $(PKG_INSTALL_DIR)/usr/include/lxc/* \
  92. $(1)/usr/include/lxc/
  93. $(INSTALL_DIR) $(1)/usr/lib
  94. $(CP) \
  95. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  96. $(1)/usr/lib/
  97. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  98. $(CP) \
  99. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
  100. $(1)/usr/lib/pkgconfig/
  101. endef
  102. define Package/lxc/install
  103. true
  104. endef
  105. define Package/lxc-common/conffiles
  106. /etc/lxc/default.conf
  107. /etc/lxc/lxc.conf
  108. endef
  109. define Package/lxc-common/install
  110. $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
  111. $(CP) \
  112. $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
  113. $(1)/usr/lib/lxc/rootfs/
  114. $(INSTALL_DIR) $(1)/usr/share/lxc
  115. $(CP) \
  116. $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
  117. $(1)/usr/share/lxc/
  118. $(INSTALL_DIR) $(1)/etc/lxc/
  119. $(CP) \
  120. $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
  121. $(1)/etc/lxc/
  122. endef
  123. define Package/lxc-hooks/install
  124. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  125. $(CP) \
  126. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
  127. $(1)/usr/share/lxc/hooks/
  128. $(CP) \
  129. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
  130. $(1)/usr/share/lxc/hooks/
  131. endef
  132. define Package/lxc-templates/install
  133. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  134. $(CP) \
  135. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  136. $(1)/usr/share/lxc/templates/
  137. endef
  138. define Package/liblxc/install
  139. $(INSTALL_DIR) $(1)/usr/lib/
  140. $(CP) \
  141. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  142. $(1)/usr/lib/
  143. endef
  144. define Package/lxc-lua/install
  145. $(INSTALL_DIR) $(1)/usr/lib/lua
  146. $(CP) \
  147. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  148. $(1)/usr/lib/lua/
  149. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  150. $(CP) \
  151. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  152. $(1)/usr/lib/lua/lxc/
  153. endef
  154. define Package/lxc-init/install
  155. $(INSTALL_DIR) $(1)/sbin
  156. $(CP) \
  157. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  158. $(1)/sbin/
  159. endef
  160. define GenPlugin
  161. define Package/lxc-$(1)
  162. $(call Package/lxc/Default)
  163. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  164. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  165. endef
  166. define Package/lxc-$(1)/install
  167. $(INSTALL_DIR) $$(1)$(3)
  168. $(INSTALL_BIN) \
  169. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  170. $$(1)$(3)/
  171. endef
  172. $$(eval $$(call BuildPackage,lxc-$(1)))
  173. endef
  174. $(eval $(call BuildPackage,lxc))
  175. $(eval $(call BuildPackage,lxc-common))
  176. $(eval $(call BuildPackage,lxc-hooks))
  177. $(eval $(call BuildPackage,lxc-templates))
  178. $(eval $(call BuildPackage,liblxc))
  179. $(eval $(call BuildPackage,lxc-lua))
  180. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  181. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  182. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))