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
:=2693a4c654dcfdafb3aa95c262051d8122afa1b6f5cef1920221ebbdee934d07
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
22 PKG_BUILD_FLAGS
:=no-mips16
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
) \
37 -Druntime-path
=/var
/run
40 attach autostart cgroup copy config console create destroy device \
41 execute freeze
info monitor snapshot start stop unfreeze unshare \
42 usernsexec wait top ls
50 DEPENDS_APPLETS
= +libpthread
+libcap
+liblxc
52 DEPENDS_create
= +lxc-configs
+lxc-hooks
+lxc-templates
+flock
+getopt
54 define Package
/lxc
/Default
57 TITLE
:=LXC userspace tools
58 URL
:=https
://linuxcontainers.org
/
63 $(call Package
/lxc
/Default
)
68 define Package
/lxc-auto
69 $(call Package
/lxc
/Default
)
71 DEPENDS
+=+lxc-start
+lxc-stop
74 define Package
/lxc-auto
/postinst
75 [ -n
"$${IPKG_INSTROOT}" ] ||
[ "$${PKG_UPGRADE}" = 1 ] ||
/etc
/init.d
/lxc-auto boot
78 define Package
/lxc-auto
/description
79 LXC is the userspace control package for Linux Containers
, a lightweight
80 virtual system mechanism sometimes described
as "chroot on steroids".
81 This package adds an initscript for starting and stopping the containers
85 define Package
/lxc-auto
/conffiles
89 define Package
/lxc-unprivileged
90 $(call Package
/lxc
/Default
)
91 TITLE
:=Helper script for unprivileged containers support
92 DEPENDS
+=+shadow-utils
+shadow-newuidmap
+shadow-newgidmap
95 define Package
/lxc-unprivileged
/description
96 Support for unprivileged containers requires newuidmap and newguidmap.
97 This package makes sure they are available
& have correct permissions.
100 define Package
/lxc-unprivileged
/install
101 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
102 $(INSTALL_DATA
) .
/files
/lxc-unprivileged.defaults
$(1)/etc
/uci-defaults
/lxc-unprivileged
105 define Package
/lxc
/config
106 source
"$(SOURCE)/Config.in"
109 define Package
/lxc
/description
110 LXC is the userspace control package for Linux Containers
, a lightweight
111 virtual system mechanism sometimes described
as "chroot on steroids".
114 define Package
/lxc-common
115 $(call Package
/lxc
/Default
)
116 TITLE
:=LXC common files
119 define Package
/lxc-hooks
120 $(call Package
/lxc
/Default
)
121 TITLE
:=LXC virtual machine hooks
124 define Package
/lxc-templates
125 $(call Package
/lxc
/Default
)
126 TITLE
:=LXC virtual machine templates
129 define Package
/lxc-configs
130 $(call Package
/lxc
/Default
)
131 TITLE
:=LXC virtual machine common config files
134 define Package
/liblxc
135 $(call Package
/lxc
/Default
)
138 TITLE
:=LXC userspace library
139 DEPENDS
+= +libcap
+libpthread
+LXC_SECCOMP
:libseccomp
+libopenssl
142 define Package
/lxc-init
143 $(call Package
/lxc
/Default
)
144 TITLE
:=LXC Lua bindings
148 ifdef CONFIG_USE_MIPS16
149 TARGET_CFLAGS
+= -minterlink-mips16
151 TARGET_LDFLAGS
+= -lgcc_eh
153 define Build
/InstallDev
154 $(INSTALL_DIR
) $(1)/usr
/include/lxc
/
156 $(PKG_INSTALL_DIR
)/usr
/include/lxc
/* \
157 $(1)/usr
/include/lxc
/
159 $(INSTALL_DIR
) $(1)/usr
/lib
161 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
164 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
166 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lxc.
pc \
167 $(1)/usr
/lib
/pkgconfig
/
168 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
169 $(SED
) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
173 define Package
/lxc
/install
177 define Package
/lxc-auto
/install
178 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/init.d
179 $(INSTALL_CONF
) .
/files
/lxc-auto.config
$(1)/etc
/config
/lxc-auto
180 $(INSTALL_BIN
) .
/files
/lxc-auto.init
$(1)/etc
/init.d
/lxc-auto
183 define Package
/lxc-common
/conffiles
184 /etc
/lxc
/default.conf
188 define Package
/lxc-common
/install
189 $(INSTALL_DIR
) $(1)/usr
/lib
/lxc
/rootfs
191 $(PKG_INSTALL_DIR
)/usr
/lib
/lxc
/rootfs
/README \
192 $(1)/usr
/lib
/lxc
/rootfs
/
194 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
196 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/lxc.functions \
199 $(INSTALL_DIR
) $(1)/etc
/lxc
/
201 $(PKG_INSTALL_DIR
)/etc
/lxc
/default.conf \
202 $(1)/etc
/lxc
/default.conf
204 $(INSTALL_DIR
) $(1)/etc
/lxc
/
207 $(1)/etc
/lxc
/lxc.conf
209 $(INSTALL_DIR
) $(1)/srv
/lxc
/
212 define Package
/lxc-hooks
/install
213 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/hooks
215 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/hooks
/* \
216 $(1)/usr
/share
/lxc
/hooks
/
219 define Package
/lxc-templates
/install
220 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/templates
/
222 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/templates
/lxc-
* \
223 $(1)/usr
/share
/lxc
/templates
/
226 define Package
/lxc-configs
/install
227 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/config
/
229 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/config
/* \
230 $(1)/usr
/share
/lxc
/config
/
233 define Package
/liblxc
/install
234 $(INSTALL_DIR
) $(1)/usr
/lib
/
236 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
240 define Package
/lxc-init
/install
241 $(INSTALL_DIR
) $(1)/sbin
243 $(PKG_INSTALL_DIR
)/usr
/sbin
/init.lxc \
248 define Package
/lxc-
$(1)
249 $(call Package
/lxc
/Default
)
250 TITLE
:=Utility lxc-
$(1) from the LXC userspace tools
251 DEPENDS
+= +lxc-common
$(2) $(DEPENDS_
$(1))
254 define Package
/lxc-
$(1)/install
255 $(INSTALL_DIR
) $$(1)$(3)
257 $(PKG_INSTALL_DIR
)$(3)/lxc-
$(1) \
261 $$(eval
$$(call BuildPackage
,lxc-
$(1)))
264 $(eval
$(call BuildPackage
,lxc
))
265 $(eval
$(call BuildPackage
,lxc-common
))
266 $(eval
$(call BuildPackage
,lxc-hooks
))
267 $(eval
$(call BuildPackage
,lxc-configs
))
268 $(eval
$(call BuildPackage
,lxc-templates
))
269 $(eval
$(call BuildPackage
,liblxc
))
270 $(eval
$(call BuildPackage
,lxc-init
))
271 $(eval
$(call BuildPackage
,lxc-auto
))
272 $(eval
$(call BuildPackage
,lxc-unprivileged
))
273 $(foreach u
,$(LXC_APPLETS_BIN
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/bin")))
274 $(foreach u
,$(LXC_APPLETS_LIB
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/libexec/lxc")))
275 $(foreach u
,$(LXC_SCRIPTS
),$(eval
$(call GenPlugin
,$(u
),,"/usr/bin")))