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.

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