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.

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