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
:=1930aa10d892db8531d1353d15f7ebf5913e74a19e134423e4d074c07f2d6e8b
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_CPE_ID
:=cpe
:/a
:linuxcontainers
:lxc
23 PKG_BUILD_FLAGS
:=no-mips16
25 include $(INCLUDE_DIR
)/package.mk
26 include $(INCLUDE_DIR
)/meson.mk
29 -Db_lto
=$(if
$(findstring mips
,$(CONFIG_ARCH
)),false
,true
) \
31 -Dinit-script
=sysvinit \
35 -Dseccomp
=$(if
$(CONFIG_LXC_SECCOMP
),true
,false
) \
38 -Druntime-path
=/var
/run
41 attach autostart cgroup copy config console create destroy device \
42 execute freeze
info monitor snapshot start stop unfreeze unshare \
43 usernsexec wait top ls
51 DEPENDS_APPLETS
= +libpthread
+libcap
+liblxc
53 DEPENDS_create
= +lxc-configs
+lxc-hooks
+lxc-templates
+flock
+getopt
55 define Package
/lxc
/Default
58 TITLE
:=LXC userspace tools
59 URL
:=https
://linuxcontainers.org
/
64 $(call Package
/lxc
/Default
)
69 define Package
/lxc-auto
70 $(call Package
/lxc
/Default
)
72 DEPENDS
+=+lxc-start
+lxc-stop
75 define Package
/lxc-auto
/postinst
76 [ -n
"$${IPKG_INSTROOT}" ] ||
[ "$${PKG_UPGRADE}" = 1 ] ||
/etc
/init.d
/lxc-auto boot
79 define Package
/lxc-auto
/description
80 LXC is the userspace control package for Linux Containers
, a lightweight
81 virtual system mechanism sometimes described
as "chroot on steroids".
82 This package adds an initscript for starting and stopping the containers
86 define Package
/lxc-auto
/conffiles
90 define Package
/lxc-unprivileged
91 $(call Package
/lxc
/Default
)
92 TITLE
:=Helper script for unprivileged containers support
93 DEPENDS
+=+shadow-utils
+shadow-newuidmap
+shadow-newgidmap
96 define Package
/lxc-unprivileged
/description
97 Support for unprivileged containers requires newuidmap and newguidmap.
98 This package makes sure they are available
& have correct permissions.
101 define Package
/lxc-unprivileged
/install
102 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
103 $(INSTALL_DATA
) .
/files
/lxc-unprivileged.defaults
$(1)/etc
/uci-defaults
/lxc-unprivileged
106 define Package
/lxc
/config
107 source
"$(SOURCE)/Config.in"
110 define Package
/lxc
/description
111 LXC is the userspace control package for Linux Containers
, a lightweight
112 virtual system mechanism sometimes described
as "chroot on steroids".
115 define Package
/lxc-common
116 $(call Package
/lxc
/Default
)
117 TITLE
:=LXC common files
120 define Package
/lxc-hooks
121 $(call Package
/lxc
/Default
)
122 TITLE
:=LXC virtual machine hooks
125 define Package
/lxc-templates
126 $(call Package
/lxc
/Default
)
127 TITLE
:=LXC virtual machine templates
130 define Package
/lxc-configs
131 $(call Package
/lxc
/Default
)
132 TITLE
:=LXC virtual machine common config files
135 define Package
/liblxc
136 $(call Package
/lxc
/Default
)
139 TITLE
:=LXC userspace library
140 DEPENDS
+= +libcap
+libpthread
+LXC_SECCOMP
:libseccomp
+libopenssl
+libdbus
143 define Package
/lxc-init
144 $(call Package
/lxc
/Default
)
145 TITLE
:=LXC Lua bindings
149 ifdef CONFIG_USE_MIPS16
150 TARGET_CFLAGS
+= -minterlink-mips16
152 TARGET_LDFLAGS
+= -lgcc_eh
154 define Build
/InstallDev
155 $(INSTALL_DIR
) $(1)/usr
/include/lxc
/
157 $(PKG_INSTALL_DIR
)/usr
/include/lxc
/* \
158 $(1)/usr
/include/lxc
/
160 $(INSTALL_DIR
) $(1)/usr
/lib
162 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
165 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
167 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lxc.
pc \
168 $(1)/usr
/lib
/pkgconfig
/
169 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
170 $(SED
) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
174 define Package
/lxc
/install
178 define Package
/lxc-auto
/install
179 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/init.d
180 $(INSTALL_CONF
) .
/files
/lxc-auto.config
$(1)/etc
/config
/lxc-auto
181 $(INSTALL_BIN
) .
/files
/lxc-auto.init
$(1)/etc
/init.d
/lxc-auto
184 define Package
/lxc-common
/conffiles
185 /etc
/lxc
/default.conf
189 define Package
/lxc-common
/install
190 $(INSTALL_DIR
) $(1)/usr
/lib
/lxc
/rootfs
192 $(PKG_INSTALL_DIR
)/usr
/lib
/lxc
/rootfs
/README \
193 $(1)/usr
/lib
/lxc
/rootfs
/
195 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
197 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/lxc.functions \
200 $(INSTALL_DIR
) $(1)/etc
/lxc
/
202 $(PKG_INSTALL_DIR
)/etc
/lxc
/default.conf \
203 $(1)/etc
/lxc
/default.conf
205 $(INSTALL_DIR
) $(1)/etc
/lxc
/
208 $(1)/etc
/lxc
/lxc.conf
210 $(INSTALL_DIR
) $(1)/srv
/lxc
/
213 define Package
/lxc-hooks
/install
214 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/hooks
216 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/hooks
/* \
217 $(1)/usr
/share
/lxc
/hooks
/
220 define Package
/lxc-templates
/install
221 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/templates
/
223 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/templates
/lxc-
* \
224 $(1)/usr
/share
/lxc
/templates
/
227 define Package
/lxc-configs
/install
228 $(INSTALL_DIR
) $(1)/usr
/share
/lxc
/config
/
230 $(PKG_INSTALL_DIR
)/usr
/share
/lxc
/config
/* \
231 $(1)/usr
/share
/lxc
/config
/
234 define Package
/liblxc
/install
235 $(INSTALL_DIR
) $(1)/usr
/lib
/
237 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
241 define Package
/lxc-init
/install
242 $(INSTALL_DIR
) $(1)/sbin
244 $(PKG_INSTALL_DIR
)/usr
/sbin
/init.lxc \
249 define Package
/lxc-
$(1)
250 $(call Package
/lxc
/Default
)
251 TITLE
:=Utility lxc-
$(1) from the LXC userspace tools
252 DEPENDS
+= +lxc-common
$(2) $(DEPENDS_
$(1))
255 define Package
/lxc-
$(1)/install
256 $(INSTALL_DIR
) $$(1)$(3)
258 $(PKG_INSTALL_DIR
)$(3)/lxc-
$(1) \
262 $$(eval
$$(call BuildPackage
,lxc-
$(1)))
265 $(eval
$(call BuildPackage
,lxc
))
266 $(eval
$(call BuildPackage
,lxc-common
))
267 $(eval
$(call BuildPackage
,lxc-hooks
))
268 $(eval
$(call BuildPackage
,lxc-configs
))
269 $(eval
$(call BuildPackage
,lxc-templates
))
270 $(eval
$(call BuildPackage
,liblxc
))
271 $(eval
$(call BuildPackage
,lxc-init
))
272 $(eval
$(call BuildPackage
,lxc-auto
))
273 $(eval
$(call BuildPackage
,lxc-unprivileged
))
274 $(foreach u
,$(LXC_APPLETS_BIN
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/bin")))
275 $(foreach u
,$(LXC_APPLETS_LIB
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/libexec/lxc")))
276 $(foreach u
,$(LXC_SCRIPTS
),$(eval
$(call GenPlugin
,$(u
),,"/usr/bin")))