2 # Copyright (C) 2013-2015 OpenWrt.org
3 # Copyright (C) 2020 Sartura
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=https
://linuxcontainers.org
/downloads
/lxc
/
17 PKG_HASH
:=d8195423bb1e206f8521d24b6cde4789f043960c7cf065990a9cf741dcfd4222
19 PKG_MAINTAINER
:=Marko Ratkaj
<markoratkaj@gmail.com
>
20 PKG_LICENSE
:=LGPL-2.1
-or-later BSD-2-Clause GPL-2.0
21 PKG_LICENSE_FILES
:=COPYING LICENSE.GPL2 LICENSE.LGPL2.1
24 include $(INCLUDE_DIR
)/package.mk
25 include $(INCLUDE_DIR
)/meson.mk
28 -Db_lto
=$(if
$(findstring mips
,$(CONFIG_ARCH
)),false
,true
) \
30 -Dinit-script
=sysvinit \
34 -Dseccomp
=$(if
$(CONFIG_LXC_SECCOMP
),true
,false
) \
39 attach autostart cgroup copy config console create destroy device \
40 execute freeze
info monitor snapshot start stop unfreeze unshare \
41 usernsexec wait top ls
49 DEPENDS_APPLETS
= +libpthread
+libcap
+liblxc
51 DEPENDS_create
= +lxc-configs
+lxc-hooks
+lxc-templates
+flock
+getopt
53 define Package
/lxc
/Default
56 TITLE
:=LXC userspace tools
57 URL
:=https
://linuxcontainers.org
/
62 $(call Package
/lxc
/Default
)
67 define Package
/lxc-auto
68 $(call Package
/lxc
/Default
)
70 DEPENDS
+=+lxc-start
+lxc-stop
73 define Package
/lxc-auto
/postinst
74 [ -n
"$${IPKG_INSTROOT}" ] ||
[ "$${PKG_UPGRADE}" = 1 ] ||
/etc
/init.d
/lxc-auto boot
77 define Package
/lxc-auto
/description
78 LXC is the userspace control package for Linux Containers
, a lightweight
79 virtual system mechanism sometimes described
as "chroot on steroids".
80 This package adds an initscript for starting and stopping the containers
84 define Package
/lxc-auto
/conffiles
88 define Package
/lxc-unprivileged
89 $(call Package
/lxc
/Default
)
90 TITLE
:=Helper script for unprivileged containers support
91 DEPENDS
+=+shadow-utils
+shadow-newuidmap
+shadow-newgidmap
94 define Package
/lxc-unprivileged
/description
95 Support for unprivileged containers requires newuidmap and newguidmap.
96 This package makes sure they are available
& have correct permissions.
99 define Package
/lxc-unprivileged
/install
100 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
101 $(INSTALL_DATA
) .
/files
/lxc-unprivileged.defaults
$(1)/etc
/uci-defaults
/lxc-unprivileged
104 define Package
/lxc
/config
105 source
"$(SOURCE)/Config.in"
108 define Package
/lxc
/description
109 LXC is the userspace control package for Linux Containers
, a lightweight
110 virtual system mechanism sometimes described
as "chroot on steroids".
113 define Package
/lxc-common
114 $(call Package
/lxc
/Default
)
115 TITLE
:=LXC common files
118 define Package
/lxc-hooks
119 $(call Package
/lxc
/Default
)
120 TITLE
:=LXC virtual machine hooks
123 define Package
/lxc-templates
124 $(call Package
/lxc
/Default
)
125 TITLE
:=LXC virtual machine templates
128 define Package
/lxc-configs
129 $(call Package
/lxc
/Default
)
130 TITLE
:=LXC virtual machine common config files
133 define Package
/liblxc
134 $(call Package
/lxc
/Default
)
137 TITLE
:=LXC userspace library
138 DEPENDS
+= +libcap
+libpthread
+LXC_SECCOMP
:libseccomp
+libopenssl
141 define Package
/lxc-init
142 $(call Package
/lxc
/Default
)
143 TITLE
:=LXC Lua bindings
147 ifdef CONFIG_USE_MIPS16
148 TARGET_CFLAGS
+= -minterlink-mips16
150 TARGET_LDFLAGS
+= -lgcc_eh
152 define Build
/InstallDev
153 $(INSTALL_DIR
) $(1)/usr
/include/lxc
/
155 $(PKG_INSTALL_DIR
)/usr
/include/lxc
/* \
156 $(1)/usr
/include/lxc
/
158 $(INSTALL_DIR
) $(1)/usr
/lib
160 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
163 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
165 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lxc.
pc \
166 $(1)/usr
/lib
/pkgconfig
/
167 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
168 $(SED
) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
172 define Package
/lxc
/install
176 define Package
/lxc-auto
/install
177 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/init.d
178 $(INSTALL_CONF
) .
/files
/lxc-auto.config
$(1)/etc
/config
/lxc-auto
179 $(INSTALL_BIN
) .
/files
/lxc-auto.init
$(1)/etc
/init.d
/lxc-auto
182 define Package
/lxc-common
/conffiles
183 /etc
/lxc
/default.conf
187 define Package
/lxc-common
/install
188 $(INSTALL_DIR
) $(1)/usr
/lib
/lxc
/rootfs
190 $(PKG_INSTALL_DIR
)/usr
/lib
/lxc
/rootfs
/README \
191 $(1)/usr
/lib
/lxc
/rootfs
/
193 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
195 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/lxc.functions \
198 $(INSTALL_DIR
) $(1)/etc
/lxc
/
200 $(PKG_INSTALL_DIR
)/etc
/lxc
/default.conf \
201 $(1)/etc
/lxc
/default.conf
203 $(INSTALL_DIR
) $(1)/etc
/lxc
/
206 $(1)/etc
/lxc
/lxc.conf
208 $(INSTALL_DIR
) $(1)/srv
/lxc
/
211 define Package
/lxc-hooks
/install
212 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/hooks
214 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/hooks
/* \
215 $(1)/usr
/share
/lxc
/hooks
/
218 define Package
/lxc-templates
/install
219 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/templates
/
221 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/templates
/lxc-
* \
222 $(1)/usr
/share
/lxc
/templates
/
225 define Package
/lxc-configs
/install
226 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/config
/
228 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/config
/* \
229 $(1)/usr
/share
/lxc
/config
/
232 define Package
/liblxc
/install
233 $(INSTALL_DIR
) $(1)/usr
/lib
/
235 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
239 define Package
/lxc-init
/install
240 $(INSTALL_DIR
) $(1)/sbin
242 $(PKG_INSTALL_DIR
)/usr
/sbin
/init.lxc \
247 define Package
/lxc-
$(1)
248 $(call Package
/lxc
/Default
)
249 TITLE
:=Utility lxc-
$(1) from the LXC userspace tools
250 DEPENDS
+= +lxc-common
$(2) $(DEPENDS_
$(1))
253 define Package
/lxc-
$(1)/install
254 $(INSTALL_DIR
) $$(1)$(3)
256 $(PKG_INSTALL_DIR
)$(3)/lxc-
$(1) \
260 $$(eval
$$(call BuildPackage
,lxc-
$(1)))
263 $(eval
$(call BuildPackage
,lxc
))
264 $(eval
$(call BuildPackage
,lxc-common
))
265 $(eval
$(call BuildPackage
,lxc-hooks
))
266 $(eval
$(call BuildPackage
,lxc-configs
))
267 $(eval
$(call BuildPackage
,lxc-templates
))
268 $(eval
$(call BuildPackage
,liblxc
))
269 $(eval
$(call BuildPackage
,lxc-init
))
270 $(eval
$(call BuildPackage
,lxc-auto
))
271 $(eval
$(call BuildPackage
,lxc-unprivileged
))
272 $(foreach u
,$(LXC_APPLETS_BIN
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/bin")))
273 $(foreach u
,$(LXC_APPLETS_LIB
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/libexec/lxc")))
274 $(foreach u
,$(LXC_SCRIPTS
),$(eval
$(call GenPlugin
,$(u
),,"/usr/bin")))