Merge pull request #2039 from jefferyto/python-pyasn1-modules
[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:=1.1.5
12 PKG_RELEASE:=1
13
14 PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
15 PKG_MAINTAINER:=Luka Perkov <luka@openwrt.org>
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/lxc/
19 PKG_MD5SUM:=dd9684dde0a58ed13f4f49c855b79a1a
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 clone config console create destroy device \
31 execute freeze info monitor snapshot start stop unfreeze unshare \
32 usernsexec wait
33
34 LXC_APPLETS_LIB += \
35 monitord user-nic
36
37 LXC_SCRIPTS += \
38 checkconfig ls top
39
40 DEPENDS_APPLETS = +libpthread +libcap +liblxc
41
42 DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates
43 DEPENDS_ls = +lxc-config
44 DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
45
46
47 define Package/lxc/Default
48 SECTION:=utils
49 CATEGORY:=Utilities
50 TITLE:=LXC userspace tools
51 URL:=http://lxc.sourceforge.net/
52 endef
53
54 define Package/lxc
55 $(call Package/lxc/Default)
56 MENU:=1
57 endef
58
59 define Package/lxc/config
60 source "$(SOURCE)/Config.in"
61 endef
62
63 define Package/lxc/description
64 LXC is the userspace control package for Linux Containers, a lightweight
65 virtual system mechanism sometimes described as "chroot on steroids".
66 endef
67
68 define Package/lxc-common
69 $(call Package/lxc/Default)
70 TITLE:=LXC common files
71 DEPENDS:= lxc
72 endef
73
74 define Package/lxc-hooks
75 $(call Package/lxc/Default)
76 TITLE:=LXC virtual machine hooks
77 DEPENDS:= lxc
78 endef
79
80 define Package/lxc-templates
81 $(call Package/lxc/Default)
82 TITLE:=LXC virtual machine templates
83 DEPENDS:= lxc
84 endef
85
86 define Package/lxc-configs
87 $(call Package/lxc/Default)
88 TITLE:=LXC virtual machine common config files
89 DEPENDS:= lxc
90 endef
91
92 define Package/liblxc
93 $(call Package/lxc/Default)
94 SECTION:=libs
95 CATEGORY:=Libraries
96 TITLE:=LXC userspace library
97 DEPENDS:= lxc +libcap +libpthread +LXC_SECCOMP:libseccomp
98 endef
99
100 define Package/lxc-lua
101 $(call Package/lxc/Default)
102 TITLE:=LXC Lua bindings
103 DEPENDS:= lxc +liblua +liblxc +luafilesystem
104 endef
105
106 define Package/lxc-init
107 $(call Package/lxc/Default)
108 TITLE:=LXC Lua bindings
109 DEPENDS:= lxc +liblxc
110 endef
111
112 CONFIGURE_ARGS += \
113 --disable-apparmor \
114 --disable-doc \
115 --disable-examples \
116 --enable-lua=yes \
117 --with-lua-pc="$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc"
118
119 ifeq ($(CONFIG_LXC_SECCOMP),y)
120 CONFIGURE_ARGS += --enable-seccomp
121 else
122 CONFIGURE_ARGS += --disable-seccomp
123 endif
124
125 MAKE_FLAGS += \
126 LUA_INSTALL_CMOD="/usr/lib/lua" \
127 LUA_INSTALL_LMOD="/usr/lib/lua"
128
129
130 define Build/InstallDev
131 $(INSTALL_DIR) $(1)/usr/include/lxc/
132 $(CP) \
133 $(PKG_INSTALL_DIR)/usr/include/lxc/* \
134 $(1)/usr/include/lxc/
135
136 $(INSTALL_DIR) $(1)/usr/lib
137 $(CP) \
138 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
139 $(1)/usr/lib/
140
141 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
142 $(CP) \
143 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lxc.pc \
144 $(1)/usr/lib/pkgconfig/
145 endef
146
147
148 define Package/lxc/install
149 true
150 endef
151
152 define Package/lxc-common/conffiles
153 /etc/lxc/default.conf
154 /etc/lxc/lxc.conf
155 endef
156
157 define Package/lxc-common/install
158 $(INSTALL_DIR) $(1)/usr/lib/lxc/rootfs
159 $(CP) \
160 $(PKG_INSTALL_DIR)/usr/lib/lxc/rootfs/README \
161 $(1)/usr/lib/lxc/rootfs/
162
163 $(INSTALL_DIR) $(1)/usr/share/lxc
164 $(CP) \
165 $(PKG_INSTALL_DIR)/usr/share/lxc/lxc.functions \
166 $(1)/usr/share/lxc/
167
168 $(INSTALL_DIR) $(1)/etc/lxc/
169 $(CP) \
170 $(PKG_INSTALL_DIR)/etc/lxc/default.conf \
171 $(1)/etc/lxc/default.conf
172
173 $(INSTALL_DIR) $(1)/etc/lxc/
174 $(CP) \
175 ./files/lxc.conf \
176 $(1)/etc/lxc/lxc.conf
177
178 $(INSTALL_DIR) $(1)/lxc/
179 endef
180
181 define Package/lxc-hooks/install
182 $(INSTALL_DIR) $(1)/usr/share/lxc/hooks
183 $(CP) \
184 $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \
185 $(1)/usr/share/lxc/hooks/
186 endef
187
188 define Package/lxc-templates/install
189 $(INSTALL_DIR) $(1)/usr/share/lxc/templates/
190 $(CP) \
191 $(PKG_INSTALL_DIR)/usr/share/lxc/templates/lxc-* \
192 $(1)/usr/share/lxc/templates/
193 endef
194
195 define Package/lxc-configs/install
196 $(INSTALL_DIR) $(1)/usr/share/lxc/config/
197 $(CP) \
198 $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \
199 $(1)/usr/share/lxc/config/
200 endef
201
202 define Package/liblxc/install
203 $(INSTALL_DIR) $(1)/usr/lib/
204 $(CP) \
205 $(PKG_INSTALL_DIR)/usr/lib/liblxc.so* \
206 $(1)/usr/lib/
207 endef
208
209 define Package/lxc-lua/install
210 $(INSTALL_DIR) $(1)/usr/lib/lua
211 $(CP) \
212 $(PKG_INSTALL_DIR)/usr/share/lua/5.1/lxc.lua \
213 $(1)/usr/lib/lua/
214 $(INSTALL_DIR) $(1)/usr/lib/lua/lxc
215 $(CP) \
216 $(PKG_INSTALL_DIR)/usr/lib/lua/5.1/lxc/core.so \
217 $(1)/usr/lib/lua/lxc/
218 endef
219
220 define Package/lxc-init/install
221 $(INSTALL_DIR) $(1)/sbin
222 $(CP) \
223 $(PKG_INSTALL_DIR)/usr/sbin/init.lxc \
224 $(1)/sbin/
225 endef
226
227 define GenPlugin
228 define Package/lxc-$(1)
229 $(call Package/lxc/Default)
230 TITLE:=Utility lxc-$(1) from the LXC userspace tools
231 DEPENDS:= lxc +lxc-common $(2) $(DEPENDS_$(1))
232 endef
233
234 define Package/lxc-$(1)/install
235 $(INSTALL_DIR) $$(1)$(3)
236 $(INSTALL_BIN) \
237 $(PKG_INSTALL_DIR)$(3)/lxc-$(1) \
238 $$(1)$(3)/
239 endef
240
241 $$(eval $$(call BuildPackage,lxc-$(1)))
242 endef
243
244
245 $(eval $(call BuildPackage,lxc))
246 $(eval $(call BuildPackage,lxc-common))
247 $(eval $(call BuildPackage,lxc-hooks))
248 $(eval $(call BuildPackage,lxc-configs))
249 $(eval $(call BuildPackage,lxc-templates))
250 $(eval $(call BuildPackage,liblxc))
251 $(eval $(call BuildPackage,lxc-lua))
252 $(eval $(call BuildPackage,lxc-init))
253 $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin")))
254 $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc")))
255 $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin")))