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.

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