perl: remove build timestamp
[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.1
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:=68663a67450a8d6734e137eac54cc7077209fb15c456eec401a2c26e6386eff6
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-gnutls \
128 --disable-apparmor \
129 --disable-doc \
130 --disable-examples \
131 --enable-lua=yes \
132 --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
133
134 ifeq ($(CONFIG_LXC_SECCOMP),y)
135 CONFIGURE_ARGS += --enable-seccomp
136 else
137 CONFIGURE_ARGS += --disable-seccomp
138 endif
139
140 MAKE_FLAGS += \
141 LUA_INSTALL_CMOD="/usr/lib/lua" \
142 LUA_INSTALL_LMOD="/usr/lib/lua"
143
144
145 define Build/InstallDev
146 $(INSTALL_DIR) $(1)/usr/include/lxc/
147 $(CP) \
148 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
149 $(1)/usr/include/lxc/
150
151 $(INSTALL_DIR) $(1)/usr/lib
152 $(CP) \
153 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
154 $(1)/usr/lib/
155
156 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
157 $(CP) \
158 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
159 $(1)/usr/lib/pkgconfig/
160 endef
161
162
163 define Package/lxc/install
164 true
165 endef
166
167 define Package/lxc-auto/install
168 $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
169 $(INSTALL_CONF) ./files/lxc-auto.config $(1)/etc/config/lxc-auto
170 $(INSTALL_BIN) ./files/lxc-auto.init $(1)/etc/init.d/lxc-auto
171 endef
172
173 define Package/lxc-common/conffiles
174 /etc/lxc/default.conf
175 /etc/lxc/lxc.conf
176 endef
177
178 define Package/lxc-common/install
179 $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
180 $(CP) \
181 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
182 $(1)/usr/lib/lxc/rootfs/
183
184 $(INSTALL_DIR) $(1)/usr/share/lxc
185 $(CP) \
186 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
187 $(1)/usr/share/lxc/
188
189 $(INSTALL_DIR) $(1)/etc/lxc/
190 $(CP) \
191 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
192 $(1)/etc/lxc/default.conf
193
194 $(INSTALL_DIR) $(1)/etc/lxc/
195 $(CP) \
196 ./files/lxc.conf \
197 $(1)/etc/lxc/lxc.conf
198
199 $(INSTALL_DIR) $(1)/srv/lxc/
200 endef
201
202 define Package/lxc-hooks/install
203 $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
204 $(CP) \
205 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
206 $(1)/usr/share/lxc/hooks/
207 endef
208
209 define Package/lxc-templates/install
210 $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
211 $(CP) \
212 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
213 $(1)/usr/share/lxc/templates/
214 endef
215
216 define Package/lxc-configs/install
217 $(INSTALL_DIR) $(1)/usr/share/lxc/config/
218 $(CP) \
219 $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
220 $(1)/usr/share/lxc/config/
221 endef
222
223 define Package/liblxc/install
224 $(INSTALL_DIR) $(1)/usr/lib/
225 $(CP) \
226 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
227 $(1)/usr/lib/
228 endef
229
230 define Package/lxc-lua/install
231 $(INSTALL_DIR) $(1)/usr/lib/lua
232 $(CP) \
233 $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
234 $(1)/usr/lib/lua/
235 $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
236 $(CP) \
237 $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
238 $(1)/usr/lib/lua/lxc/
239 endef
240
241 define Package/lxc-init/install
242 $(INSTALL_DIR) $(1)/sbin
243 $(CP) \
244 $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
245 $(1)/sbin/
246 endef
247
248 define GenPlugin
249 define Package/lxc-$(1)
250 $(call Package/lxc/Default)
251 TITLE:=Utility lxc-$(1) from the LXC userspace tools
252 DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
253 endef
254
255 define Package/lxc-$(1)/install
256 $(INSTALL_DIR) $$(1)$(3)
257 $(INSTALL_BIN) \
258 $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
259 $$(1)$(3)/
260 endef
261
262 $$(eval $$(call BuildPackage,lxc-$(1)))
263 endef
264
265
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-lua))
273 $(eval $(call BuildPackage,lxc-init))
274 $(eval $(call BuildPackage,lxc-auto))
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")))