2 # Copyright (C) 2013 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:=2013-09-24
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:=9d0cda4f22f76d693e2ceef0f77f2ba24227433c
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
23 include $(INCLUDE_DIR)/package.mk
26 attach cgroup checkpoint console execute freeze info kill monitor \
27 restart start stop unfreeze unshare wait
30 checkconfig clone create destroy ls netstat ps shutdown version
32 DEPENDS_APPLETS = +libpthread +libcap +liblxc
34 DEPENDS_checkpoint = @BROKEN
35 DEPENDS_clone = @BROKEN
36 DEPENDS_create = @BROKEN
37 DEPENDS_destroy = @BROKEN
38 DEPENDS_restart = @BROKEN
39 DEPENDS_shutdown = +lxc-info +lxc-wait @BROKEN
42 define Package/lxc/Default
45 TITLE:=LXC userspace tools
46 URL:=http://lxc.sourceforge.net/
47 MAINTAINER:=Luka Perkov <luka@openwrt.org>
51 $(call Package/lxc/Default)
53 +lxc-common +lxc-hooks +lxc-init +lxc-templates +liblxc \
54 $(foreach u,$(LXC_APPLETS),+lxc-$(u)) $(foreach u,$(LXC_SCRIPTS),+lxc-$(u))
57 define Package/lxc/description
58 LXC is the userspace control package for Linux Containers, a lightweight
59 virtual system mechanism sometimes described as "chroot on steroids".
62 define Package/lxc-common
63 $(call Package/lxc/Default)
64 TITLE:=LXC common files
67 define Package/lxc-hooks
68 $(call Package/lxc/Default)
69 TITLE:=LXC virtual machine hooks
72 define Package/lxc-init
73 $(call Package/lxc/Default)
74 TITLE:=Utility lxc-init from the LXC userspace tools
75 DEPENDS:= $(DEPENDS_APPLETS)
78 define Package/lxc-templates
79 $(call Package/lxc/Default)
80 TITLE:=LXC virtual machine templates
85 $(call Package/lxc/Default)
88 TITLE:=LXC userspace library
89 DEPENDS:= +libpthread +libcap
99 define Build/Configure
100 ( cd $(PKG_BUILD_DIR); ./autogen.sh );
101 $(call Build/Configure/Default)
105 define Build/InstallDev
106 $(INSTALL_DIR) $(1)/usr/include/lxc/
108 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
109 $(1)/usr/include/lxc/
111 $(INSTALL_DIR) $(1)/usr/lib
113 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
116 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
118 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
119 $(1)/usr/lib/pkgconfig/
123 define Package/lxc/install
127 define Package/lxc-common/conffiles
128 /etc/lxc/default.conf
132 define Package/lxc-common/install
133 $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
135 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
136 $(1)/usr/lib/lxc/rootfs/
138 $(INSTALL_DIR) $(1)/usr/share/lxc
140 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
143 $(INSTALL_DIR) $(1)/etc/lxc/
145 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
149 define Package/lxc-init/install
150 $(INSTALL_DIR) $(1)/usr/lib/lxc
152 $(PKG_INSTALL_DIR)/usr/lib/lxc/lxc-init \
156 define Package/lxc-hooks/install
157 $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
159 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \
160 $(1)/usr/share/lxc/hooks/
162 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \
163 $(1)/usr/share/lxc/hooks/
166 define Package/lxc-templates/install
167 $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
169 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
170 $(1)/usr/share/lxc/templates/
173 define Package/liblxc/install
174 $(INSTALL_DIR) $(1)/usr/lib/
176 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
182 define Package/lxc-$(1)
183 $(call Package/lxc/Default)
184 TITLE:=Utility lxc-$(1) from the LXC userspace tools
185 DEPENDS:= +lxc-common $(2) $(DEPENDS_$(1))
188 define Package/lxc-$(1)/install
189 $(INSTALL_DIR) $$(1)/usr/bin
191 $(PKG_INSTALL_DIR)/usr/bin/lxc-$(1) \
195 $$(eval $$(call BuildPackage,lxc-$(1)))
199 $(eval $(call BuildPackage,lxc))
200 $(eval $(call BuildPackage,lxc-common))
201 $(eval $(call BuildPackage,lxc-hooks))
202 $(eval $(call BuildPackage,lxc-init))
203 $(eval $(call BuildPackage,lxc-templates))
204 $(eval $(call BuildPackage,liblxc))
205 $(foreach u,$(LXC_APPLETS),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS))))
206 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u))))