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.

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