2 # Copyright (C) 2013-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=2014-01-23
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
15 PKG_SOURCE_URL:=git://github.com/lxc/lxc.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=0b3a6504e51795e738de8e017c22d209a93bc169
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20 PKG_BUILD_DEPENDS:=lua
24 include $(INCLUDE_DIR)/package.mk
27 attach autostart cgroup clone config console create destroy execute \
28 freeze info monitor snapshot start stop unfreeze unshare usernsexec wait
31 init monitord user-nic
36 DEPENDS_APPLETS = +libpthread +libcap +liblxc
38 DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
41 define Package/lxc/Default
44 TITLE:=LXC userspace tools
45 URL:=http://lxc.sourceforge.net/
46 MAINTAINER:=Luka Perkov <luka@openwrt.org>
50 $(call Package/lxc/Default)
54 define Package/lxc/description
55 LXC is the userspace control package for Linux Containers, a lightweight
56 virtual system mechanism sometimes described as "chroot on steroids".
59 define Package/lxc-common
60 $(call Package/lxc/Default)
61 TITLE:=LXC common files
65 define Package/lxc-hooks
66 $(call Package/lxc/Default)
67 TITLE:=LXC virtual machine hooks
71 define Package/lxc-templates
72 $(call Package/lxc/Default)
73 TITLE:=LXC virtual machine templates
78 $(call Package/lxc/Default)
81 TITLE:=LXC userspace library
82 DEPENDS:= lxc +libcap +libpthread
85 define Package/lxc-lua
86 $(call Package/lxc/Default)
87 TITLE:=LXC Lua bindings
88 DEPENDS:= lxc +liblua +liblxc
97 --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc" \
100 LUA_INSTALL_CMOD="/usr/lib/lua" \
101 LUA_INSTALL_LMOD="/usr/lib/lua"
103 define Build/Configure
104 ( cd $(PKG_BUILD_DIR); ./autogen.sh );
105 $(call Build/Configure/Default)
109 define Build/InstallDev
110 $(INSTALL_DIR) $(1)/usr/include/lxc/
112 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
113 $(1)/usr/include/lxc/
115 $(INSTALL_DIR) $(1)/usr/lib
117 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
120 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
122 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
123 $(1)/usr/lib/pkgconfig/
127 define Package/lxc/install
131 define Package/lxc-common/conffiles
132 /etc/lxc/default.conf
136 define Package/lxc-common/install
137 $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
139 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
140 $(1)/usr/lib/lxc/rootfs/
142 $(INSTALL_DIR) $(1)/usr/share/lxc
144 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
147 $(INSTALL_DIR) $(1)/etc/lxc/
149 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
153 define Package/lxc-hooks/install
154 $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
156 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
157 $(1)/usr/share/lxc/hooks/
159 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
160 $(1)/usr/share/lxc/hooks/
163 define Package/lxc-templates/install
164 $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
166 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
167 $(1)/usr/share/lxc/templates/
170 define Package/liblxc/install
171 $(INSTALL_DIR) $(1)/usr/lib/
173 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
177 define Package/lxc-lua/install
178 $(INSTALL_DIR) $(1)/usr/lib/lua
180 $(PKG_INSTALL_DIR)/usr/lib/lua/lxc.lua \
182 $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
184 $(PKG_INSTALL_DIR)/usr/lib/lua/lxc/core.so \
185 $(1)/usr/lib/lua/lxc/
189 define Package/lxc-$(1)
190 $(call Package/lxc/Default)
191 TITLE:=Utility lxc-$(1) from the LXC userspace tools
192 DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
195 define Package/lxc-$(1)/install
196 $(INSTALL_DIR) $$(1)$(3)
198 $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
202 $$(eval $$(call BuildPackage,lxc-$(1)))
206 $(eval $(call BuildPackage,lxc))
207 $(eval $(call BuildPackage,lxc-common))
208 $(eval $(call BuildPackage,lxc-hooks))
209 $(eval $(call BuildPackage,lxc-templates))
210 $(eval $(call BuildPackage,liblxc))
211 $(eval $(call BuildPackage,lxc-lua))
212 $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
213 $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
214 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))