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.

244 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. $(INSTALL_DIR) $(1)/lxc/
  132. endef
  133. define Package/lxc-hooks/install
  134. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  135. $(CP) \
  136. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
  137. $(1)/usr/share/lxc/hooks/
  138. endef
  139. define Package/lxc-templates/install
  140. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  141. $(CP) \
  142. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  143. $(1)/usr/share/lxc/templates/
  144. endef
  145. define Package/lxc-configs/install
  146. $(INSTALL_DIR) $(1)/usr/share/lxc/config/
  147. $(CP) \
  148. $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
  149. $(1)/usr/share/lxc/config/
  150. endef
  151. define Package/liblxc/install
  152. $(INSTALL_DIR) $(1)/usr/lib/
  153. $(CP) \
  154. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  155. $(1)/usr/lib/
  156. endef
  157. define Package/lxc-lua/install
  158. $(INSTALL_DIR) $(1)/usr/lib/lua
  159. $(CP) \
  160. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  161. $(1)/usr/lib/lua/
  162. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  163. $(CP) \
  164. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  165. $(1)/usr/lib/lua/lxc/
  166. endef
  167. define Package/lxc-init/install
  168. $(INSTALL_DIR) $(1)/sbin
  169. $(CP) \
  170. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  171. $(1)/sbin/
  172. endef
  173. define GenPlugin
  174. define Package/lxc-$(1)
  175. $(call Package/lxc/Default)
  176. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  177. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  178. endef
  179. define Package/lxc-$(1)/install
  180. $(INSTALL_DIR) $$(1)$(3)
  181. $(INSTALL_BIN) \
  182. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  183. $$(1)$(3)/
  184. endef
  185. $$(eval $$(call BuildPackage,lxc-$(1)))
  186. endef
  187. $(eval $(call BuildPackage,lxc))
  188. $(eval $(call BuildPackage,lxc-common))
  189. $(eval $(call BuildPackage,lxc-hooks))
  190. $(eval $(call BuildPackage,lxc-configs))
  191. $(eval $(call BuildPackage,lxc-templates))
  192. $(eval $(call BuildPackage,liblxc))
  193. $(eval $(call BuildPackage,lxc-lua))
  194. $(eval $(call BuildPackage,lxc-init))
  195. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  196. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  197. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))