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
13 PKG_RELEASE
:=$(AUTORELEASE
)
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=https
://linuxcontainers.org
/downloads
/lxc
/
17 PKG_HASH
:=db242f8366fc63e8c7588bb2017b354173cf3c4b20abc18780debdc48b14d3ef
19 PKG_MAINTAINER
:=Marko Ratkaj
<markoratkaj@gmail.com
>
20 PKG_LICENSE
:=LGPL-2.1
-or-later BSD-2-Clause GPL-2.0
27 include $(INCLUDE_DIR
)/package.mk
30 attach autostart cgroup copy config console create destroy device \
31 execute freeze
info monitor snapshot start stop unfreeze unshare \
32 usernsexec wait top ls
40 DEPENDS_APPLETS
= +libpthread
+libcap
+liblxc
42 DEPENDS_create
= +lxc-configs
+lxc-hooks
+lxc-templates
+flock
+getopt
44 define Package
/lxc
/Default
47 TITLE
:=LXC userspace tools
48 URL
:=https
://linuxcontainers.org
/
53 $(call Package
/lxc
/Default
)
58 define Package
/lxc-auto
59 $(call Package
/lxc
/Default
)
61 DEPENDS
+=+lxc-start
+lxc-stop
64 define Package
/lxc-auto
/description
65 LXC is the userspace control package for Linux Containers
, a lightweight
66 virtual system mechanism sometimes described
as "chroot on steroids".
67 This package adds an initscript for starting and stopping the containers
71 define Package
/lxc-auto
/conffiles
75 define Package
/lxc-unprivileged
76 $(call Package
/lxc
/Default
)
77 TITLE
:=Helper script for unprivileged containers support
78 DEPENDS
+=+shadow-utils
+shadow-newuidmap
+shadow-newgidmap
81 define Package
/lxc-unprivileged
/description
82 Support for unprivileged containers requires newuidmap and newguidmap.
83 This package makes sure they are available
& have correct permissions.
86 define Package
/lxc-unprivileged
/install
87 $(INSTALL_DIR
) $(1)/etc
/uci-defaults
88 $(INSTALL_DATA
) .
/files
/lxc-unprivileged.defaults
$(1)/etc
/uci-defaults
/lxc-unprivileged
91 define Package
/lxc
/config
92 source
"$(SOURCE)/Config.in"
95 define Package
/lxc
/description
96 LXC is the userspace control package for Linux Containers
, a lightweight
97 virtual system mechanism sometimes described
as "chroot on steroids".
100 define Package
/lxc-common
101 $(call Package
/lxc
/Default
)
102 TITLE
:=LXC common files
105 define Package
/lxc-hooks
106 $(call Package
/lxc
/Default
)
107 TITLE
:=LXC virtual machine hooks
110 define Package
/lxc-templates
111 $(call Package
/lxc
/Default
)
112 TITLE
:=LXC virtual machine templates
115 define Package
/lxc-configs
116 $(call Package
/lxc
/Default
)
117 TITLE
:=LXC virtual machine common config files
120 define Package
/liblxc
121 $(call Package
/lxc
/Default
)
124 TITLE
:=LXC userspace library
125 DEPENDS
+= +libcap
+libpthread
+LXC_SECCOMP
:libseccomp
+libopenssl
128 define Package
/lxc-init
129 $(call Package
/lxc
/Default
)
130 TITLE
:=LXC Lua bindings
141 --$(if
$(CONFIG_LXC_SECCOMP
),en
,dis
)able-seccomp \
142 --enable-capabilities \
145 ifdef CONFIG_USE_MIPS16
146 TARGET_CFLAGS
+= -minterlink-mips16
148 TARGET_LDFLAGS
+= -lgcc_eh
150 define Build
/InstallDev
151 $(INSTALL_DIR
) $(1)/usr
/include/lxc
/
153 $(PKG_INSTALL_DIR
)/usr
/include/lxc
/* \
154 $(1)/usr
/include/lxc
/
156 $(INSTALL_DIR
) $(1)/usr
/lib
158 $(PKG_INSTALL_DIR
)/usr
/lib
/liblxc.so
* \
161 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
163 $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/lxc.
pc \
164 $(1)/usr
/lib
/pkgconfig
/
165 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
166 $(SED
) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/lxc.
pc
170 define Package
/lxc
/install
174 define Package
/lxc-auto
/install
175 $(INSTALL_DIR
) $(1)/etc
/config
$(1)/etc
/init.d
176 $(INSTALL_CONF
) .
/files
/lxc-auto.config
$(1)/etc
/config
/lxc-auto
177 $(INSTALL_BIN
) .
/files
/lxc-auto.init
$(1)/etc
/init.d
/lxc-auto
180 define Package
/lxc-auto
/postinst
181 [ "$${PKG_UPGRADE}" = "0" ] && /etc
/init.d
/lxc-auto boot
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)))
266 $(eval
$(call BuildPackage
,lxc
))
267 $(eval
$(call BuildPackage
,lxc-common
))
268 $(eval
$(call BuildPackage
,lxc-hooks
))
269 $(eval
$(call BuildPackage
,lxc-configs
))
270 $(eval
$(call BuildPackage
,lxc-templates
))
271 $(eval
$(call BuildPackage
,liblxc
))
272 $(eval
$(call BuildPackage
,lxc-init
))
273 $(eval
$(call BuildPackage
,lxc-auto
))
274 $(eval
$(call BuildPackage
,lxc-unprivileged
))
275 $(foreach u
,$(LXC_APPLETS_BIN
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/bin")))
276 $(foreach u
,$(LXC_APPLETS_LIB
),$(eval
$(call GenPlugin
,$(u
),$(DEPENDS_APPLETS
),"/usr/lib/lxc")))
277 $(foreach u
,$(LXC_SCRIPTS
),$(eval
$(call GenPlugin
,$(u
),,"/usr/bin")))