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.

245 lines
5.4 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.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/
  13. PKG_MD5SUM:=4aad3aee84b42faa194e44091d723a3b
  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_ls = +lxc-config
  27. DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
  28. define Package/lxc/Default
  29. SECTION:=utils
  30. CATEGORY:=Utilities
  31. TITLE:=LXC userspace tools
  32. URL:=http://lxc.sourceforge.net/
  33. MAINTAINER:=Luka Perkov <luka@openwrt.org>
  34. endef
  35. define Package/lxc
  36. $(call Package/lxc/Default)
  37. MENU:=1
  38. endef
  39. define Package/lxc/config
  40. source "$(SOURCE)/Config.in"
  41. endef
  42. define Package/lxc/description
  43. LXC is the userspace control package for Linux Containers, a lightweight
  44. virtual system mechanism sometimes described as "chroot on steroids".
  45. endef
  46. define Package/lxc-common
  47. $(call Package/lxc/Default)
  48. TITLE:=LXC common files
  49. DEPENDS:= lxc
  50. endef
  51. define Package/lxc-hooks
  52. $(call Package/lxc/Default)
  53. TITLE:=LXC virtual machine hooks
  54. DEPENDS:= lxc
  55. endef
  56. define Package/lxc-templates
  57. $(call Package/lxc/Default)
  58. TITLE:=LXC virtual machine templates
  59. DEPENDS:= lxc
  60. endef
  61. define Package/lxc-configs
  62. $(call Package/lxc/Default)
  63. TITLE:=LXC virtual machine common config files
  64. DEPENDS:= lxc
  65. endef
  66. define Package/liblxc
  67. $(call Package/lxc/Default)
  68. SECTION:=libs
  69. CATEGORY:=Libraries
  70. TITLE:=LXC userspace library
  71. DEPENDS:= lxc +libcap +libpthread
  72. endef
  73. define Package/lxc-lua
  74. $(call Package/lxc/Default)
  75. TITLE:=LXC Lua bindings
  76. DEPENDS:= lxc +liblua +liblxc +luafilesystem
  77. endef
  78. define Package/lxc-init
  79. $(call Package/lxc/Default)
  80. TITLE:=LXC Lua bindings
  81. DEPENDS:= lxc +liblxc
  82. endef
  83. CONFIGURE_ARGS += \
  84. --disable-apparmor \
  85. --disable-doc \
  86. --disable-examples \
  87. --disable-seccomp
  88. --enable-lua=yes \
  89. --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc" \
  90. MAKE_FLAGS += \
  91. LUA_INSTALL_CMOD="/usr/lib/lua" \
  92. LUA_INSTALL_LMOD="/usr/lib/lua"
  93. define Build/Configure
  94. ( cd $(PKG_BUILD_DIR); ./autogen.sh );
  95. $(call Build/Configure/Default)
  96. endef
  97. define Build/InstallDev
  98. $(INSTALL_DIR) $(1)/usr/include/lxc/
  99. $(CP) \
  100. $(PKG_INSTALL_DIR)/usr/include/lxc/* \
  101. $(1)/usr/include/lxc/
  102. $(INSTALL_DIR) $(1)/usr/lib
  103. $(CP) \
  104. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  105. $(1)/usr/lib/
  106. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  107. $(CP) \
  108. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
  109. $(1)/usr/lib/pkgconfig/
  110. endef
  111. define Package/lxc/install
  112. true
  113. endef
  114. define Package/lxc-common/conffiles
  115. /etc/lxc/default.conf
  116. /etc/lxc/lxc.conf
  117. endef
  118. define Package/lxc-common/install
  119. $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
  120. $(CP) \
  121. $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
  122. $(1)/usr/lib/lxc/rootfs/
  123. $(INSTALL_DIR) $(1)/usr/share/lxc
  124. $(CP) \
  125. $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
  126. $(1)/usr/share/lxc/
  127. $(INSTALL_DIR) $(1)/etc/lxc/
  128. $(CP) \
  129. $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
  130. $(1)/etc/lxc/lxc.conf
  131. endef
  132. define Package/lxc-hooks/install
  133. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  134. $(CP) \
  135. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
  136. $(1)/usr/share/lxc/hooks/
  137. $(CP) \
  138. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
  139. $(1)/usr/share/lxc/hooks/
  140. endef
  141. define Package/lxc-templates/install
  142. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  143. $(CP) \
  144. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  145. $(1)/usr/share/lxc/templates/
  146. endef
  147. define Package/lxc-configs/install
  148. $(INSTALL_DIR) $(1)/usr/share/lxc/config/
  149. $(CP) \
  150. $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
  151. $(1)/usr/share/lxc/config/
  152. endef
  153. define Package/liblxc/install
  154. $(INSTALL_DIR) $(1)/usr/lib/
  155. $(CP) \
  156. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  157. $(1)/usr/lib/
  158. endef
  159. define Package/lxc-lua/install
  160. $(INSTALL_DIR) $(1)/usr/lib/lua
  161. $(CP) \
  162. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  163. $(1)/usr/lib/lua/
  164. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  165. $(CP) \
  166. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  167. $(1)/usr/lib/lua/lxc/
  168. endef
  169. define Package/lxc-init/install
  170. $(INSTALL_DIR) $(1)/sbin
  171. $(CP) \
  172. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  173. $(1)/sbin/
  174. endef
  175. define GenPlugin
  176. define Package/lxc-$(1)
  177. $(call Package/lxc/Default)
  178. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  179. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  180. endef
  181. define Package/lxc-$(1)/install
  182. $(INSTALL_DIR) $$(1)$(3)
  183. $(INSTALL_BIN) \
  184. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  185. $$(1)$(3)/
  186. endef
  187. $$(eval $$(call BuildPackage,lxc-$(1)))
  188. endef
  189. $(eval $(call BuildPackage,lxc))
  190. $(eval $(call BuildPackage,lxc-common))
  191. $(eval $(call BuildPackage,lxc-hooks))
  192. $(eval $(call BuildPackage,lxc-configs))
  193. $(eval $(call BuildPackage,lxc-templates))
  194. $(eval $(call BuildPackage,liblxc))
  195. $(eval $(call BuildPackage,lxc-lua))
  196. $(eval $(call BuildPackage,lxc-init))
  197. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  198. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  199. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))