2 # Copyright (C) 2013-2015 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
14 PKG_LICENSE
:=LGPL-2.1
+ BSD-2-Clause GPL-2.0
15 PKG_MAINTAINER
:=Luka Perkov
<luka@openwrt.org
>
17 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
18 PKG_SOURCE_URL
:=http
://linuxcontainers.org
/downloads
/lxc
/
19 PKG_MD5SUM
:=dd9684dde0a58ed13f4f49c855b79a1a
21 PKG_BUILD_DEPENDS
:=lua
27 include $(INCLUDE_DIR
)/package.mk
30 attach autostart cgroup clone config console create destroy device \
31 execute freeze
info monitor snapshot start stop unfreeze unshare \
40 DEPENDS_APPLETS
= +libpthread
+libcap
+liblxc
42 DEPENDS_create
= +lxc-configs
+lxc-hooks
+lxc-templates
+flock
44 DEPENDS_ls
= +lxc-config
45 DEPENDS_top
= +lxc-lua
+luafilesystem @BROKEN
48 define Package
/lxc
/Default
51 TITLE
:=LXC userspace tools
52 URL
:=http
://lxc.sourceforge.net
/
56 $(call Package
/lxc
/Default
)
60 define Package
/lxc-auto
61 $(call Package
/lxc
/Default
)
63 DEPENDS
:=+lxc-start
+lxc-stop
66 define Package
/lxc-auto
/description
67 LXC is the userspace control package for Linux Containers
, a lightweight
68 virtual system mechanism sometimes described
as "chroot on steroids".
69 This package adds and initscript for starting and stopping the containers
73 define Package
/lxc-auto
/conffiles
77 define Package
/lxc
/config
78 source
"$(SOURCE)/Config.in"
81 define Package
/lxc
/description
82 LXC is the userspace control package for Linux Containers
, a lightweight
83 virtual system mechanism sometimes described
as "chroot on steroids".
86 define Package
/lxc-common
87 $(call Package
/lxc
/Default
)
88 TITLE
:=LXC common files
92 define Package
/lxc-hooks
93 $(call Package
/lxc
/Default
)
94 TITLE
:=LXC virtual machine hooks
98 define Package
/lxc-templates
99 $(call Package
/lxc
/Default
)
100 TITLE
:=LXC virtual machine templates
104 define Package
/lxc-configs
105 $(call Package
/lxc
/Default
)
106 TITLE
:=LXC virtual machine common config files
110 define Package
/liblxc
111 $(call Package
/lxc
/Default
)
114 TITLE
:=LXC userspace library
115 DEPENDS
:= lxc
+libcap
+libpthread
+LXC_SECCOMP
:libseccomp
118 define Package
/lxc-lua
119 $(call Package
/lxc
/Default
)
120 TITLE
:=LXC Lua bindings
121 DEPENDS
:= lxc
+liblua
+liblxc
+luafilesystem
124 define Package
/lxc-init
125 $(call Package
/lxc
/Default
)
126 TITLE
:=LXC Lua bindings
127 DEPENDS
:= lxc
+liblxc
135 --with-lua-pc
="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
137 ifeq ($(CONFIG_LXC_SECCOMP
),y
)
138 CONFIGURE_ARGS
+= --enable-seccomp
140 CONFIGURE_ARGS
+= --disable-seccomp
144 LUA_INSTALL_CMOD
="/usr/lib/lua" \
145 LUA_INSTALL_LMOD
="/usr/lib/lua"
148 define Build
/InstallDev
149 $(INSTALL_DIR
) $(1)/usr
/include/lxc
/
151 $(PKG_INSTALL_DIR
)/usr
/include/lxc
/* \
152 $(1)/usr
/include/lxc
/
154 $(INSTALL_DIR
) $(1)/usr
/lib
156 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
159 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
161 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lxc.
pc \
162 $(1)/usr
/lib
/pkgconfig
/
166 define Package
/lxc
/install
170 define Package
/lxc-auto
/install
171 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/init.d
172 $(INSTALL_CONF
) .
/files
/lxc-auto.config
$(1)/etc
/config
/lxc-auto
173 $(INSTALL_BIN
) .
/files
/lxc-auto.init
$(1)/etc
/init.d
/lxc-auto
176 define Package
/lxc-common
/conffiles
177 /etc
/lxc
/default.conf
181 define Package
/lxc-common
/install
182 $(INSTALL_DIR
) $(1)/usr
/lib
/lxc
/rootfs
184 $(PKG_INSTALL_DIR
)/usr
/lib
/lxc
/rootfs
/README \
185 $(1)/usr
/lib
/lxc
/rootfs
/
187 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
189 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/lxc.functions \
192 $(INSTALL_DIR
) $(1)/etc
/lxc
/
194 $(PKG_INSTALL_DIR
)/etc
/lxc
/default.conf \
195 $(1)/etc
/lxc
/default.conf
197 $(INSTALL_DIR
) $(1)/etc
/lxc
/
200 $(1)/etc
/lxc
/lxc.conf
202 $(INSTALL_DIR
) $(1)/srv
/lxc
/
205 define Package
/lxc-hooks
/install
206 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/hooks
208 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/hooks
/* \
209 $(1)/usr
/share
/lxc
/hooks
/
212 define Package
/lxc-templates
/install
213 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/templates
/
215 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/templates
/lxc-
* \
216 $(1)/usr
/share
/lxc
/templates
/
219 define Package
/lxc-configs
/install
220 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/config
/
222 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/config
/* \
223 $(1)/usr
/share
/lxc
/config
/
226 define Package
/liblxc
/install
227 $(INSTALL_DIR
) $(1)/usr
/lib
/
229 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
233 define Package
/lxc-lua
/install
234 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
236 $(PKG_INSTALL_DIR
)/usr
/share
/lua
/5.1/lxc.lua \
238 $(INSTALL_DIR
) $(1)/usr
/lib
/lua
/lxc
240 $(PKG_INSTALL_DIR
)/usr
/lib
/lua
/5.1/lxc
/core.so \
241 $(1)/usr
/lib
/lua
/lxc
/
244 define Package
/lxc-init
/install
245 $(INSTALL_DIR
) $(1)/sbin
247 $(PKG_INSTALL_DIR
)/usr
/sbin
/init.lxc \
252 define Package
/lxc-
$(1)
253 $(call Package
/lxc
/Default
)
254 TITLE
:=Utility lxc-
$(1) from the LXC userspace tools
255 DEPENDS
:= lxc
+lxc-common
$(2) $(DEPENDS_
$(1))
258 define Package
/lxc-
$(1)/install
259 $(INSTALL_DIR
) $$(1)$(3)
261 $(PKG_INSTALL_DIR
)$(3)/lxc-
$(1) \
265 $$(eval
$$(call BuildPackage
,lxc-
$(1)))
269 $(eval
$(call BuildPackage
,lxc
))
270 $(eval
$(call BuildPackage
,lxc-common
))
271 $(eval
$(call BuildPackage
,lxc-hooks
))
272 $(eval
$(call BuildPackage
,lxc-configs
))
273 $(eval
$(call BuildPackage
,lxc-templates
))
274 $(eval
$(call BuildPackage
,liblxc
))
275 $(eval
$(call BuildPackage
,lxc-lua
))
276 $(eval
$(call BuildPackage
,lxc-init
))
277 $(eval
$(call BuildPackage
,lxc-auto
))
278 $(foreach u
,$(LXC_APPLETS_BIN
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/bin")))
279 $(foreach u
,$(LXC_APPLETS_LIB
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/lib/lxc")))
280 $(foreach u
,$(LXC_SCRIPTS
),$(eval
$(call GenPlugin
,$(u
),,"/usr/bin")))