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.

276 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-apparmor \
  101. --disable-doc \
  102. --disable-examples \
  103. --enable-lua=yes \
  104. --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
  105. ifeq ($(CONFIG_LXC_SECCOMP),y)
  106. CONFIGURE_ARGS += --enable-seccomp
  107. else
  108. CONFIGURE_ARGS += --disable-seccomp
  109. endif
  110. MAKE_FLAGS += \
  111. LUA_INSTALL_CMOD="/usr/lib/lua" \
  112. LUA_INSTALL_LMOD="/usr/lib/lua"
  113. define Build/InstallDev
  114. $(INSTALL_DIR) $(1)/usr/include/lxc/
  115. $(CP) \
  116. $(PKG_INSTALL_DIR)/usr/include/lxc/* \
  117. $(1)/usr/include/lxc/
  118. $(INSTALL_DIR) $(1)/usr/lib
  119. $(CP) \
  120. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  121. $(1)/usr/lib/
  122. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  123. $(CP) \
  124. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
  125. $(1)/usr/lib/pkgconfig/
  126. endef
  127. define Package/lxc/install
  128. true
  129. endef
  130. define Package/lxc-auto/install
  131. $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
  132. $(INSTALL_CONF) ./files/lxc-auto.config $(1)/etc/config/lxc-auto
  133. $(INSTALL_BIN) ./files/lxc-auto.init $(1)/etc/init.d/lxc-auto
  134. endef
  135. define Package/lxc-common/conffiles
  136. /etc/lxc/default.conf
  137. /etc/lxc/lxc.conf
  138. endef
  139. define Package/lxc-common/install
  140. $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
  141. $(CP) \
  142. $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
  143. $(1)/usr/lib/lxc/rootfs/
  144. $(INSTALL_DIR) $(1)/usr/share/lxc
  145. $(CP) \
  146. $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
  147. $(1)/usr/share/lxc/
  148. $(INSTALL_DIR) $(1)/etc/lxc/
  149. $(CP) \
  150. $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
  151. $(1)/etc/lxc/default.conf
  152. $(INSTALL_DIR) $(1)/etc/lxc/
  153. $(CP) \
  154. ./files/lxc.conf \
  155. $(1)/etc/lxc/lxc.conf
  156. $(INSTALL_DIR) $(1)/srv/lxc/
  157. endef
  158. define Package/lxc-hooks/install
  159. $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
  160. $(CP) \
  161. $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
  162. $(1)/usr/share/lxc/hooks/
  163. endef
  164. define Package/lxc-templates/install
  165. $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
  166. $(CP) \
  167. $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
  168. $(1)/usr/share/lxc/templates/
  169. endef
  170. define Package/lxc-configs/install
  171. $(INSTALL_DIR) $(1)/usr/share/lxc/config/
  172. $(CP) \
  173. $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
  174. $(1)/usr/share/lxc/config/
  175. endef
  176. define Package/liblxc/install
  177. $(INSTALL_DIR) $(1)/usr/lib/
  178. $(CP) \
  179. $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
  180. $(1)/usr/lib/
  181. endef
  182. define Package/lxc-lua/install
  183. $(INSTALL_DIR) $(1)/usr/lib/lua
  184. $(CP) \
  185. $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
  186. $(1)/usr/lib/lua/
  187. $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
  188. $(CP) \
  189. $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
  190. $(1)/usr/lib/lua/lxc/
  191. endef
  192. define Package/lxc-init/install
  193. $(INSTALL_DIR) $(1)/sbin
  194. $(CP) \
  195. $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
  196. $(1)/sbin/
  197. endef
  198. define GenPlugin
  199. define Package/lxc-$(1)
  200. $(call Package/lxc/Default)
  201. TITLE:=Utility lxc-$(1) from the LXC userspace tools
  202. DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
  203. endef
  204. define Package/lxc-$(1)/install
  205. $(INSTALL_DIR) $$(1)$(3)
  206. $(INSTALL_BIN) \
  207. $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
  208. $$(1)$(3)/
  209. endef
  210. $$(eval $$(call BuildPackage,lxc-$(1)))
  211. endef
  212. $(eval $(call BuildPackage,lxc))
  213. $(eval $(call BuildPackage,lxc-common))
  214. $(eval $(call BuildPackage,lxc-hooks))
  215. $(eval $(call BuildPackage,lxc-configs))
  216. $(eval $(call BuildPackage,lxc-templates))
  217. $(eval $(call BuildPackage,liblxc))
  218. $(eval $(call BuildPackage,lxc-lua))
  219. $(eval $(call BuildPackage,lxc-init))
  220. $(eval $(call BuildPackage,lxc-auto))
  221. $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
  222. $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
  223. $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))