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.

280 lines
6.3 KiB

  1. #
  2. # Copyright (C) 2013-2015 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.1.5
  10. PKG_RELEASE:=2
  11. PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
  12. PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
  15. PKG_MD5SUM:=dd9684dde0a58ed13f4f49c855b79a1a
  16. PKG_BUILD_DEPENDS:=lua
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. PKG_FIXUP:=autoreconf
  20. include $(INCLUDE_DIR)/package.mk
  21. LXC_APPLETS_BIN += \
  22. attach autostart cgroup clone config console create destroy device \
  23. execute freeze info monitor snapshot start stop unfreeze unshare \
  24. usernsexec wait
  25. LXC_APPLETS_LIB += \
  26. monitord user-nic
  27. LXC_SCRIPTS += \
  28. checkconfig ls top
  29. DEPENDS_APPLETS = +libpthread +libcap +liblxc
  30. DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
  31. DEPENDS_ls = +lxc-config
  32. DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
  33. define Package/lxc/Default
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. TITLE:=LXC userspace tools
  37. URL:=http://lxc.sourceforge.net/
  38. endef
  39. define Package/lxc
  40. $(call Package/lxc/Default)
  41. MENU:=1
  42. endef
  43. define Package/lxc-auto
  44. $(call Package/lxc/Default)
  45. TITLE:= (initscript)
  46. DEPENDS:=+lxc-start +lxc-stop
  47. endef
  48. define Package/lxc-auto/description
  49. LXC is the userspace control package for Linux Containers, a lightweight
  50. virtual system mechanism sometimes described as "chroot on steroids".
  51. This package adds and initscript for starting and stopping the containers
  52. on boot and shutdown.
  53. endef
  54. define Package/lxc-auto/conffiles
  55. /etc/config/lxc-auto
  56. endef
  57. define Package/lxc/config
  58. source "$(SOURCE)/Config.in"
  59. endef
  60. define Package/lxc/description
  61. LXC is the userspace control package for Linux Containers, a lightweight
  62. virtual system mechanism sometimes described as "chroot on steroids".
  63. endef
  64. define Package/lxc-common
  65. $(call Package/lxc/Default)
  66. TITLE:=LXC common files
  67. DEPENDS:= lxc
  68. endef
  69. define Package/lxc-hooks
  70. $(call Package/lxc/Default)
  71. TITLE:=LXC virtual machine hooks
  72. DEPENDS:= lxc
  73. endef
  74. define Package/lxc-templates
  75. $(call Package/lxc/Default)
  76. TITLE:=LXC virtual machine templates
  77. DEPENDS:= lxc
  78. endef
  79. define Package/lxc-configs
  80. $(call Package/lxc/Default)
  81. TITLE:=LXC virtual machine common config files
  82. DEPENDS:= lxc
  83. endef
  84. define Package/liblxc
  85. $(call Package/lxc/Default)
  86. SECTION:=libs
  87. CATEGORY:=Libraries
  88. TITLE:=LXC userspace library
  89. DEPENDS:= lxc +libcap +libpthread +LXC_SECCOMP:libseccomp
  90. endef
  91. define Package/lxc-lua
  92. $(call Package/lxc/Default)
  93. TITLE:=LXC Lua bindings
  94. DEPENDS:= lxc +liblua +liblxc +luafilesystem
  95. endef
  96. define Package/lxc-init
  97. $(call Package/lxc/Default)
  98. TITLE:=LXC Lua bindings
  99. DEPENDS:= lxc +liblxc
  100. endef
  101. CONFIGURE_ARGS += \
  102. --disable-apparmor \
  103. --disable-doc \
  104. --disable-examples \
  105. --enable-lua=yes \
  106. --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
  107. ifeq ($(CONFIG_LXC_SECCOMP),y)
  108. CONFIGURE_ARGS += --enable-seccomp
  109. else
  110. CONFIGURE_ARGS += --disable-seccomp
  111. endif
  112. MAKE_FLAGS += \
  113. LUA_INSTALL_CMOD="/usr/lib/lua" \
  114. LUA_INSTALL_LMOD="/usr/lib/lua"
  115. define Build/InstallDev
  116. $(INSTALL_DIR) $(1)/usr/include/lxc/
  117. $(CP) \
  118. $(PKG_INSTALL_DIR)/usr/include/lxc/* \
  119. $(1)/usr/include/lxc/
  120. $(INSTALL_DIR) $(1)/usr/lib
  121. $(CP) \
  122. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  123. $(1)/usr/lib/
  124. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  125. $(CP) \
  126. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
  127. $(1)/usr/lib/pkgconfig/
  128. endef
  129. define Package/lxc/install
  130. true
  131. endef
  132. define Package/lxc-auto/install
  133. $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
  134. $(INSTALL_CONF) ./files/lxc-auto.config $(1)/etc/config/lxc-auto
  135. $(INSTALL_BIN) ./files/lxc-auto.init $(1)/etc/init.d/lxc-auto
  136. endef
  137. define Package/lxc-common/conffiles
  138. /etc/lxc/default.conf
  139. /etc/lxc/lxc.conf
  140. endef
  141. define Package/lxc-common/install
  142. $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
  143. $(CP) \
  144. $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
  145. $(1)/usr/lib/lxc/rootfs/
  146. $(INSTALL_DIR) $(1)/usr/share/lxc
  147. $(CP) \
  148. $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
  149. $(1)/usr/share/lxc/
  150. $(INSTALL_DIR) $(1)/etc/lxc/
  151. $(CP) \
  152. $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
  153. $(1)/etc/lxc/default.conf
  154. $(INSTALL_DIR) $(1)/etc/lxc/
  155. $(CP) \
  156. ./files/lxc.conf \
  157. $(1)/etc/lxc/lxc.conf
  158. $(INSTALL_DIR) $(1)/lxc/
  159. endef
  160. define Package/lxc-hooks/install
  161. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  162. $(CP) \
  163. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
  164. $(1)/usr/share/lxc/hooks/
  165. endef
  166. define Package/lxc-templates/install
  167. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  168. $(CP) \
  169. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  170. $(1)/usr/share/lxc/templates/
  171. endef
  172. define Package/lxc-configs/install
  173. $(INSTALL_DIR) $(1)/usr/share/lxc/config/
  174. $(CP) \
  175. $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
  176. $(1)/usr/share/lxc/config/
  177. endef
  178. define Package/liblxc/install
  179. $(INSTALL_DIR) $(1)/usr/lib/
  180. $(CP) \
  181. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  182. $(1)/usr/lib/
  183. endef
  184. define Package/lxc-lua/install
  185. $(INSTALL_DIR) $(1)/usr/lib/lua
  186. $(CP) \
  187. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  188. $(1)/usr/lib/lua/
  189. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  190. $(CP) \
  191. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  192. $(1)/usr/lib/lua/lxc/
  193. endef
  194. define Package/lxc-init/install
  195. $(INSTALL_DIR) $(1)/sbin
  196. $(CP) \
  197. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  198. $(1)/sbin/
  199. endef
  200. define GenPlugin
  201. define Package/lxc-$(1)
  202. $(call Package/lxc/Default)
  203. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  204. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  205. endef
  206. define Package/lxc-$(1)/install
  207. $(INSTALL_DIR) $$(1)$(3)
  208. $(INSTALL_BIN) \
  209. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  210. $$(1)$(3)/
  211. endef
  212. $$(eval $$(call BuildPackage,lxc-$(1)))
  213. endef
  214. $(eval $(call BuildPackage,lxc))
  215. $(eval $(call BuildPackage,lxc-common))
  216. $(eval $(call BuildPackage,lxc-hooks))
  217. $(eval $(call BuildPackage,lxc-configs))
  218. $(eval $(call BuildPackage,lxc-templates))
  219. $(eval $(call BuildPackage,liblxc))
  220. $(eval $(call BuildPackage,lxc-lua))
  221. $(eval $(call BuildPackage,lxc-init))
  222. $(eval $(call BuildPackage,lxc-auto))
  223. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  224. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  225. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))