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.

231 lines
5.1 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 @BROKEN
  60. endef
  61. define Package/liblxc
  62. $(call Package/lxc/Default)
  63. SECTION:=libs
  64. CATEGORY:=Libraries
  65. TITLE:=LXC userspace library
  66. DEPENDS:= lxc +libcap +libpthread
  67. endef
  68. define Package/lxc-lua
  69. $(call Package/lxc/Default)
  70. TITLE:=LXC Lua bindings
  71. DEPENDS:= lxc +liblua +liblxc +luafilesystem
  72. endef
  73. define Package/lxc-init
  74. $(call Package/lxc/Default)
  75. TITLE:=LXC Lua bindings
  76. DEPENDS:= lxc +liblxc
  77. endef
  78. CONFIGURE_ARGS += \
  79. --disable-apparmor \
  80. --disable-doc \
  81. --disable-examples \
  82. --disable-seccomp
  83. --enable-lua=yes \
  84. --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc" \
  85. MAKE_FLAGS += \
  86. LUA_INSTALL_CMOD="/usr/lib/lua" \
  87. LUA_INSTALL_LMOD="/usr/lib/lua"
  88. define Build/Configure
  89. ( cd $(PKG_BUILD_DIR); ./autogen.sh );
  90. $(call Build/Configure/Default)
  91. endef
  92. define Build/InstallDev
  93. $(INSTALL_DIR) $(1)/usr/include/lxc/
  94. $(CP) \
  95. $(PKG_INSTALL_DIR)/usr/include/lxc/* \
  96. $(1)/usr/include/lxc/
  97. $(INSTALL_DIR) $(1)/usr/lib
  98. $(CP) \
  99. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  100. $(1)/usr/lib/
  101. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  102. $(CP) \
  103. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
  104. $(1)/usr/lib/pkgconfig/
  105. endef
  106. define Package/lxc/install
  107. true
  108. endef
  109. define Package/lxc-common/conffiles
  110. /etc/lxc/default.conf
  111. /etc/lxc/lxc.conf
  112. endef
  113. define Package/lxc-common/install
  114. $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
  115. $(CP) \
  116. $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
  117. $(1)/usr/lib/lxc/rootfs/
  118. $(INSTALL_DIR) $(1)/usr/share/lxc
  119. $(CP) \
  120. $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
  121. $(1)/usr/share/lxc/
  122. $(INSTALL_DIR) $(1)/etc/lxc/
  123. $(CP) \
  124. $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
  125. $(1)/etc/lxc/lxc.conf
  126. endef
  127. define Package/lxc-hooks/install
  128. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  129. $(CP) \
  130. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
  131. $(1)/usr/share/lxc/hooks/
  132. $(CP) \
  133. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
  134. $(1)/usr/share/lxc/hooks/
  135. endef
  136. define Package/lxc-templates/install
  137. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  138. $(CP) \
  139. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  140. $(1)/usr/share/lxc/templates/
  141. endef
  142. define Package/liblxc/install
  143. $(INSTALL_DIR) $(1)/usr/lib/
  144. $(CP) \
  145. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  146. $(1)/usr/lib/
  147. endef
  148. define Package/lxc-lua/install
  149. $(INSTALL_DIR) $(1)/usr/lib/lua
  150. $(CP) \
  151. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  152. $(1)/usr/lib/lua/
  153. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  154. $(CP) \
  155. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  156. $(1)/usr/lib/lua/lxc/
  157. endef
  158. define Package/lxc-init/install
  159. $(INSTALL_DIR) $(1)/sbin
  160. $(CP) \
  161. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  162. $(1)/sbin/
  163. endef
  164. define GenPlugin
  165. define Package/lxc-$(1)
  166. $(call Package/lxc/Default)
  167. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  168. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  169. endef
  170. define Package/lxc-$(1)/install
  171. $(INSTALL_DIR) $$(1)$(3)
  172. $(INSTALL_BIN) \
  173. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  174. $$(1)$(3)/
  175. endef
  176. $$(eval $$(call BuildPackage,lxc-$(1)))
  177. endef
  178. $(eval $(call BuildPackage,lxc))
  179. $(eval $(call BuildPackage,lxc-common))
  180. $(eval $(call BuildPackage,lxc-hooks))
  181. $(eval $(call BuildPackage,lxc-templates))
  182. $(eval $(call BuildPackage,liblxc))
  183. $(eval $(call BuildPackage,lxc-lua))
  184. $(eval $(call BuildPackage,lxc-init))
  185. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  186. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  187. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))