lxc: bump to 2.1.0
[feed/packages.git] / utils / lxc / Makefile
1 #
2 # Copyright (C) 2013-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lxc
11 PKG_VERSION:=2.1.0
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
15 PKG_MAINTAINER:=Marko Ratkaj <marko.ratkaj@sartura.hr>
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=https://linuxcontainers.org/downloads/lxc/
19 PKG_HASH:=394407305a409eb1f95fe06e7718acfe89b1d5df267b0c6aafb1d714e2038de2
20
21 PKG_BUILD_DEPENDS:=lua
22 PKG_BUILD_PARALLEL:=1
23
24 PKG_INSTALL:=1
25 PKG_FIXUP:=autoreconf
26
27 include $(INCLUDE_DIR)/package.mk
28
29 LXC_APPLETS_BIN += \
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
33
34 LXC_APPLETS_LIB += \
35 monitord user-nic
36
37 LXC_SCRIPTS += \
38 checkconfig
39
40 DEPENDS_APPLETS = +libpthread +libcap +liblxc
41
42 DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates +flock
43
44 define Package/lxc/Default
45 SECTION:=utils
46 CATEGORY:=Utilities
47 TITLE:=LXC userspace tools
48 URL:=http://lxc.sourceforge.net/
49 endef
50
51 define Package/lxc
52 $(call Package/lxc/Default)
53 MENU:=1
54 endef
55
56 define Package/lxc-auto
57 $(call Package/lxc/Default)
58 TITLE:= (initscript)
59 DEPENDS:=+lxc-start +lxc-stop
60 endef
61
62 define Package/lxc-auto/description
63 LXC is the userspace control package for Linux Containers, a lightweight
64 virtual system mechanism sometimes described as "chroot on steroids".
65 This package adds and initscript for starting and stopping the containers
66 on boot and shutdown.
67 endef
68
69 define Package/lxc-auto/conffiles
70 /etc/config/lxc-auto
71 endef
72
73 define Package/lxc/config
74 source "$(SOURCE)/Config.in"
75 endef
76
77 define Package/lxc/description
78 LXC is the userspace control package for Linux Containers, a lightweight
79 virtual system mechanism sometimes described as "chroot on steroids".
80 endef
81
82 define Package/lxc-common
83 $(call Package/lxc/Default)
84 TITLE:=LXC common files
85 DEPENDS:= lxc
86 endef
87
88 define Package/lxc-hooks
89 $(call Package/lxc/Default)
90 TITLE:=LXC virtual machine hooks
91 DEPENDS:= lxc
92 endef
93
94 define Package/lxc-templates
95 $(call Package/lxc/Default)
96 TITLE:=LXC virtual machine templates
97 DEPENDS:= lxc
98 endef
99
100 define Package/lxc-configs
101 $(call Package/lxc/Default)
102 TITLE:=LXC virtual machine common config files
103 DEPENDS:= lxc
104 endef
105
106 define Package/liblxc
107 $(call Package/lxc/Default)
108 SECTION:=libs
109 CATEGORY:=Libraries
110 TITLE:=LXC userspace library
111 DEPENDS:= lxc +libcap +libpthread +LXC_SECCOMP:libseccomp
112 endef
113
114 define Package/lxc-lua
115 $(call Package/lxc/Default)
116 TITLE:=LXC Lua bindings
117 DEPENDS:= lxc +liblua +liblxc
118 endef
119
120 define Package/lxc-init
121 $(call Package/lxc/Default)
122 TITLE:=LXC Lua bindings
123 DEPENDS:= lxc +liblxc
124 endef
125
126 CONFIGURE_ARGS += \
127 --disable-apparmor \
128 --disable-doc \
129 --disable-examples \
130 --enable-lua=yes \
131 --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
132
133 ifeq ($(CONFIG_LXC_SECCOMP),y)
134 CONFIGURE_ARGS += --enable-seccomp
135 else
136 CONFIGURE_ARGS += --disable-seccomp
137 endif
138
139 MAKE_FLAGS += \
140 LUA_INSTALL_CMOD="/usr/lib/lua" \
141 LUA_INSTALL_LMOD="/usr/lib/lua"
142
143
144 define Build/InstallDev
145 $(INSTALL_DIR) $(1)/usr/include/lxc/
146 $(CP) \
147 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
148 $(1)/usr/include/lxc/
149
150 $(INSTALL_DIR) $(1)/usr/lib
151 $(CP) \
152 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
153 $(1)/usr/lib/
154
155 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
156 $(CP) \
157 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
158 $(1)/usr/lib/pkgconfig/
159 endef
160
161
162 define Package/lxc/install
163 true
164 endef
165
166 define Package/lxc-auto/install
167 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
168 $(INSTALL_CONF) ./files/lxc-auto.config $(1)/etc/config/lxc-auto
169 $(INSTALL_BIN) ./files/lxc-auto.init $(1)/etc/init.d/lxc-auto
170 endef
171
172 define Package/lxc-common/conffiles
173 /etc/lxc/default.conf
174 /etc/lxc/lxc.conf
175 endef
176
177 define Package/lxc-common/install
178 $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
179 $(CP) \
180 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
181 $(1)/usr/lib/lxc/rootfs/
182
183 $(INSTALL_DIR) $(1)/usr/share/lxc
184 $(CP) \
185 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
186 $(1)/usr/share/lxc/
187
188 $(INSTALL_DIR) $(1)/etc/lxc/
189 $(CP) \
190 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
191 $(1)/etc/lxc/default.conf
192
193 $(INSTALL_DIR) $(1)/etc/lxc/
194 $(CP) \
195 ./files/lxc.conf \
196 $(1)/etc/lxc/lxc.conf
197
198 $(INSTALL_DIR) $(1)/srv/lxc/
199 endef
200
201 define Package/lxc-hooks/install
202 $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
203 $(CP) \
204 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
205 $(1)/usr/share/lxc/hooks/
206 endef
207
208 define Package/lxc-templates/install
209 $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
210 $(CP) \
211 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
212 $(1)/usr/share/lxc/templates/
213 endef
214
215 define Package/lxc-configs/install
216 $(INSTALL_DIR) $(1)/usr/share/lxc/config/
217 $(CP) \
218 $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
219 $(1)/usr/share/lxc/config/
220 endef
221
222 define Package/liblxc/install
223 $(INSTALL_DIR) $(1)/usr/lib/
224 $(CP) \
225 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
226 $(1)/usr/lib/
227 endef
228
229 define Package/lxc-lua/install
230 $(INSTALL_DIR) $(1)/usr/lib/lua
231 $(CP) \
232 $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
233 $(1)/usr/lib/lua/
234 $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
235 $(CP) \
236 $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
237 $(1)/usr/lib/lua/lxc/
238 endef
239
240 define Package/lxc-init/install
241 $(INSTALL_DIR) $(1)/sbin
242 $(CP) \
243 $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
244 $(1)/sbin/
245 endef
246
247 define GenPlugin
248 define Package/lxc-$(1)
249 $(call Package/lxc/Default)
250 TITLE:=Utility lxc-$(1) from the LXC userspace tools
251 DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
252 endef
253
254 define Package/lxc-$(1)/install
255 $(INSTALL_DIR) $$(1)$(3)
256 $(INSTALL_BIN) \
257 $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
258 $$(1)$(3)/
259 endef
260
261 $$(eval $$(call BuildPackage,lxc-$(1)))
262 endef
263
264
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-lua))
272 $(eval $(call BuildPackage,lxc-init))
273 $(eval $(call BuildPackage,lxc-auto))
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/lib/lxc")))
276 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))