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.

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