]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - what to do lxc_macvlan.init, when upstream provided lxc-net.init? | |
3 | # - package apparmor stuff | |
4 | ||
5 | # Conditional build: | |
6 | %bcond_without seccomp # SecComp syscall filter | |
7 | %bcond_without apparmor # apparmor support | |
8 | %bcond_without lua # Lua binding | |
9 | %bcond_without python # Python binding | |
10 | %bcond_with selinux # SELinux support | |
11 | %bcond_with cgmanager # cgmanager support | |
12 | ||
13 | Summary: Linux Containers userspace tools | |
14 | Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC) | |
15 | Name: lxc | |
16 | Version: 1.1.2 | |
17 | Release: 0.1 | |
18 | License: LGPL v2.1+ | |
19 | Group: Applications/System | |
20 | Source0: https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz | |
21 | # Source0-md5: 3ebadacf5fe8bfe689fd7a09812b682c | |
22 | Source1: %{name}-pld.in.sh | |
23 | Source2: %{name}_macvlan.init | |
24 | Source3: %{name}_macvlan.sysconfig | |
25 | Patch0: %{name}-pld.patch | |
26 | Patch1: x32.patch | |
27 | URL: https://www.linuxcontainers.org/ | |
28 | BuildRequires: autoconf >= 2.50 | |
29 | BuildRequires: automake | |
30 | %{?with_cgmanager:BuildRequires: cgmanager-devel} | |
31 | %{?with_cgmanager:BuildRequires: dbus-devel >= 1.2.16} | |
32 | BuildRequires: docbook-dtd30-sgml | |
33 | BuildRequires: docbook-utils | |
34 | BuildRequires: docbook2X | |
35 | BuildRequires: gnutls-devel | |
36 | %{?with_apparmor:BuildRequires: libapparmor-devel} | |
37 | BuildRequires: libcap-devel | |
38 | %{?with_cgmanager:BuildRequires: libnih-devel >= 1.0.2} | |
39 | %{?with_seccomp:BuildRequires: libseccomp-devel} | |
40 | BuildRequires: libxslt-progs | |
41 | %{?with_lua:BuildRequires: lua51-devel >= 5.1} | |
42 | BuildRequires: pkgconfig | |
43 | %{?with_python:BuildRequires: python3-devel >= 1:3.2} | |
44 | BuildRequires: rpm-pythonprov | |
45 | BuildRequires: rpmbuild(macros) >= 1.671 | |
46 | BuildRequires: sed >= 4.0 | |
47 | Requires: rc-scripts >= 0.4.6 | |
48 | Requires: which | |
49 | Requires: iproute2 | |
50 | Requires: systemd-units >= 38 | |
51 | Requires(post,preun): /sbin/chkconfig | |
52 | Requires(post): /sbin/ldconfig | |
53 | Suggests: gnupg | |
54 | Suggests: gnupg-plugin-keys_curl | |
55 | Suggests: gnupg-plugin-keys_hkp | |
56 | Suggests: net-tools | |
57 | Suggests: python3-lxc | |
58 | Suggests: rsync | |
59 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
60 | ||
61 | %define configpath /var/lib/lxc | |
62 | ||
63 | %description | |
64 | Tools to create and manage containers. It contains a full featured | |
65 | container with the isolation / virtualization of the pids, the ipc, | |
66 | the utsname, the mount points, /proc, /sys, the network and it takes | |
67 | into account the control groups. It is very light, flexible, and | |
68 | provides a set of tools around the container like the monitoring with | |
69 | asynchronous events notification, or the freeze of the container. This | |
70 | package is useful to create Virtual Private Server, or to run isolated | |
71 | applications like bash or sshd. | |
72 | ||
73 | %description -l pl.UTF-8 | |
74 | Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje | |
75 | w pełni funkcjonalne kontenery z ilozacją/wirtualizacją pidów, ipc, | |
76 | utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające | |
77 | grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia | |
78 | do czynności związanych z kontenerami, takich jak monitorowanie z | |
79 | asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten | |
80 | pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych | |
81 | oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd. | |
82 | ||
83 | %package devel | |
84 | Summary: Header files for lxc library | |
85 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc | |
86 | Group: Development/Libraries | |
87 | Requires: %{name} = %{version}-%{release} | |
88 | ||
89 | %description devel | |
90 | Header files for lxc library. | |
91 | ||
92 | %description devel -l pl.UTF-8 | |
93 | Pliki nagłówkowe biblioteki lxc. | |
94 | ||
95 | %package -n lua-lxc | |
96 | Summary: Lua binding for LXC | |
97 | Summary(pl.UTF-8): Wiązanie Lua do LXC | |
98 | Group: Libraries | |
99 | Requires: %{name} = %{version}-%{release} | |
100 | Requires: lua51-libs >= 5.1 | |
101 | ||
102 | %description -n lua-lxc | |
103 | Lua binding for LXC. | |
104 | ||
105 | %description -n lua-lxc -l pl.UTF-8 | |
106 | Wiązanie Lua do LXC. | |
107 | ||
108 | %package -n python3-lxc | |
109 | Summary: Python (3.x) binding for LXC | |
110 | Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC | |
111 | Group: Libraries | |
112 | Requires: %{name} = %{version}-%{release} | |
113 | Requires: python3-libs >= 3.2 | |
114 | Requires: python3-modules | |
115 | ||
116 | %description -n python3-lxc | |
117 | Python (3.x) binding for LXC. | |
118 | ||
119 | %description -n python3-lxc -l pl.UTF-8 | |
120 | Wiązanie Pythona (3.x) do LXC. | |
121 | ||
122 | %package -n bash-completion-%{name} | |
123 | Summary: bash-completion for LXC | |
124 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC | |
125 | Group: Applications/Shells | |
126 | Requires: %{name} | |
127 | Requires: bash-completion | |
128 | ||
129 | %description -n bash-completion-%{name} | |
130 | bash-completion for LXC. | |
131 | ||
132 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
133 | bashowe uzupełnianie nazw dla LXC. | |
134 | ||
135 | %prep | |
136 | %setup -q | |
137 | %patch0 -p1 | |
138 | %patch1 -p1 | |
139 | ||
140 | cp -p %{SOURCE1} templates/lxc-pld.in | |
141 | ||
142 | %build | |
143 | %{__aclocal} -I config | |
144 | %{__autoconf} | |
145 | %{__autoheader} | |
146 | %{__automake} | |
147 | %configure \ | |
148 | db2xman=docbook2X2man \ | |
149 | --disable-rpath \ | |
150 | --enable-bash \ | |
151 | --enable-doc \ | |
152 | --enable-examples \ | |
153 | %{__enable_disable apparmor} \ | |
154 | %{__enable_disable cgmanager} \ | |
155 | %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \ | |
156 | %{__enable_disable python} \ | |
157 | %{__enable_disable seccomp} \ | |
158 | %{__enable_disable selinux} \ | |
159 | --with-config-path=%{configpath} \ | |
160 | --with-init-script=sysvinit,systemd \ | |
161 | --with-runtime-path=/var/run \ | |
162 | --with-distro=pld | |
163 | ||
164 | %{__make} | |
165 | %{__make} -C doc | |
166 | ||
167 | %install | |
168 | rm -rf $RPM_BUILD_ROOT | |
169 | install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \ | |
170 | -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} | |
171 | ||
172 | %{__make} install \ | |
173 | SYSTEMD_UNIT_DIR=%{systemdunitdir} \ | |
174 | pcdatadir=%{_pkgconfigdir} \ | |
175 | DESTDIR=$RPM_BUILD_ROOT | |
176 | ||
177 | %{__make} -C doc install \ | |
178 | DESTDIR=$RPM_BUILD_ROOT | |
179 | ||
180 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
181 | ||
182 | # apparmor profiles are not packaged, remove to avoid packagers confusion | |
183 | %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d | |
184 | ||
185 | # yum plugin, no idea where to package this | |
186 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py | |
187 | ||
188 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc_macvlan | |
189 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan | |
190 | ||
191 | %if %{with python} | |
192 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
193 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
194 | %endif | |
195 | %if %{with lua} | |
196 | %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top | |
197 | %endif | |
198 | ||
199 | %clean | |
200 | rm -rf $RPM_BUILD_ROOT | |
201 | ||
202 | %post | |
203 | /sbin/ldconfig | |
204 | /sbin/chkconfig --add lxc | |
205 | /sbin/chkconfig --add lxc-net | |
206 | /sbin/chkconfig --add lxc_macvlan | |
207 | %systemd_post lxc.service lxc-net.service | |
208 | ||
209 | %preun | |
210 | if [ "$1" = "0" ]; then | |
211 | %service lxc stop | |
212 | /sbin/chkconfig --del lxc | |
213 | %service lxc-net stop | |
214 | /sbin/chkconfig --del lxc-net | |
215 | %service lxc_macvlan stop | |
216 | /sbin/chkconfig --del lxc_macvlan | |
217 | fi | |
218 | %systemd_preun lxc.service lxc-net.service | |
219 | ||
220 | %postun | |
221 | /sbin/ldconfig | |
222 | %systemd_reload | |
223 | ||
224 | %files | |
225 | %defattr(644,root,root,755) | |
226 | %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf | |
227 | %attr(755,root,root) %{_bindir}/lxc-attach | |
228 | %attr(755,root,root) %{_bindir}/lxc-autostart | |
229 | %attr(755,root,root) %{_bindir}/lxc-cgroup | |
230 | %attr(755,root,root) %{_bindir}/lxc-checkconfig | |
231 | %attr(755,root,root) %{_bindir}/lxc-checkpoint | |
232 | %attr(755,root,root) %{_bindir}/lxc-clone | |
233 | %attr(755,root,root) %{_bindir}/lxc-config | |
234 | %attr(755,root,root) %{_bindir}/lxc-console | |
235 | %attr(755,root,root) %{_bindir}/lxc-create | |
236 | %attr(755,root,root) %{_bindir}/lxc-destroy | |
237 | %attr(755,root,root) %{_bindir}/lxc-execute | |
238 | %attr(755,root,root) %{_bindir}/lxc-freeze | |
239 | %attr(755,root,root) %{_bindir}/lxc-info | |
240 | %attr(755,root,root) %{_bindir}/lxc-monitor | |
241 | %attr(755,root,root) %{_bindir}/lxc-snapshot | |
242 | %attr(755,root,root) %{_bindir}/lxc-start | |
243 | %attr(755,root,root) %{_bindir}/lxc-stop | |
244 | %attr(755,root,root) %{_bindir}/lxc-unfreeze | |
245 | %attr(755,root,root) %{_bindir}/lxc-unshare | |
246 | %attr(755,root,root) %{_bindir}/lxc-usernsexec | |
247 | %attr(755,root,root) %{_bindir}/lxc-wait | |
248 | %attr(755,root,root) %{_sbindir}/init.lxc | |
249 | %attr(755,root,root) %{_libdir}/liblxc.so.*.*.* | |
250 | %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1 | |
251 | %attr(754,root,root) /etc/rc.d/init.d/lxc | |
252 | %attr(754,root,root) /etc/rc.d/init.d/lxc-net | |
253 | %attr(754,root,root) /etc/rc.d/init.d/lxc_macvlan | |
254 | ||
255 | %{systemdunitdir}/lxc.service | |
256 | %{systemdunitdir}/lxc-net.service | |
257 | %dir %{_libdir}/%{name} | |
258 | %dir %{_libdir}/%{name}/rootfs | |
259 | %{_libdir}/%{name}/rootfs/README | |
260 | %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load | |
261 | %attr(755,root,root) %{_libdir}/%{name}/lxc-containers | |
262 | %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup | |
263 | %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord | |
264 | %attr(755,root,root) %{_libdir}/%{name}/lxc-net | |
265 | %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic | |
266 | %dir %{_sysconfdir}/lxc | |
267 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan | |
268 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc | |
269 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf | |
270 | %dir %{_datadir}/%{name} | |
271 | %{_datadir}/%{name}/lxc.functions | |
272 | %attr(755,root,root) %{_datadir}/%{name}/lxc-restore-net | |
273 | %dir %{_datadir}/%{name}/config | |
274 | %{_datadir}/%{name}/config/archlinux.*.conf | |
275 | %{_datadir}/%{name}/config/centos.*.conf | |
276 | %{_datadir}/%{name}/config/common.conf | |
277 | %dir %{_datadir}/%{name}/config/common.conf.d | |
278 | %{_datadir}/%{name}/config/common.conf.d/README | |
279 | %{_datadir}/%{name}/config/common.seccomp | |
280 | %{_datadir}/%{name}/config/debian.*.conf | |
281 | %{_datadir}/%{name}/config/fedora.*.conf | |
282 | %{_datadir}/%{name}/config/gentoo.*.conf | |
283 | %{_datadir}/%{name}/config/opensuse.*.conf | |
284 | %{_datadir}/%{name}/config/openwrt.*.conf | |
285 | %{_datadir}/%{name}/config/oracle.*.conf | |
286 | %{_datadir}/%{name}/config/plamo.*.conf | |
287 | %{_datadir}/%{name}/config/ubuntu-cloud.*.conf | |
288 | %{_datadir}/%{name}/config/ubuntu.*.conf | |
289 | %{_datadir}/%{name}/config/userns.conf | |
290 | %dir %{_datadir}/%{name}/hooks | |
291 | %dir %{_datadir}/%{name}/selinux | |
292 | %{_datadir}/%{name}/selinux/* | |
293 | %dir %{_datadir}/%{name}/templates | |
294 | %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname | |
295 | %attr(755,root,root) %{_datadir}/%{name}/hooks/mount* | |
296 | %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client | |
297 | %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep | |
298 | %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-* | |
299 | %{_mandir}/man1/lxc-attach.1* | |
300 | %{_mandir}/man1/lxc-autostart.1* | |
301 | %{_mandir}/man1/lxc-cgroup.1* | |
302 | %{_mandir}/man1/lxc-checkconfig.1* | |
303 | %{_mandir}/man1/lxc-checkpoint.1* | |
304 | %{_mandir}/man1/lxc-clone.1* | |
305 | %{_mandir}/man1/lxc-config.1* | |
306 | %{_mandir}/man1/lxc-console.1* | |
307 | %{_mandir}/man1/lxc-create.1* | |
308 | %{_mandir}/man1/lxc-destroy.1* | |
309 | %{_mandir}/man1/lxc-execute.1* | |
310 | %{_mandir}/man1/lxc-freeze.1* | |
311 | %{_mandir}/man1/lxc-info.1* | |
312 | %{_mandir}/man1/lxc-monitor.1* | |
313 | %{_mandir}/man1/lxc-snapshot.1* | |
314 | %{_mandir}/man1/lxc-start.1* | |
315 | %{_mandir}/man1/lxc-stop.1* | |
316 | %{_mandir}/man1/lxc-unfreeze.1* | |
317 | %{_mandir}/man1/lxc-unshare.1* | |
318 | %{_mandir}/man1/lxc-user-nic.1* | |
319 | %{_mandir}/man1/lxc-usernsexec.1* | |
320 | %{_mandir}/man1/lxc-wait.1* | |
321 | %{_mandir}/man5/lxc-usernet.5* | |
322 | %{_mandir}/man5/lxc.conf.5* | |
323 | %{_mandir}/man5/lxc.container.conf.5* | |
324 | %{_mandir}/man5/lxc.system.conf.5* | |
325 | %{_mandir}/man7/lxc.7* | |
326 | %lang(ja) %{_mandir}/ja/man1/lxc*.1* | |
327 | %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5* | |
328 | %lang(ja) %{_mandir}/ja/man5/lxc.conf.5* | |
329 | %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5* | |
330 | %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5* | |
331 | %lang(ja) %{_mandir}/ja/man7/lxc.7* | |
332 | %exclude %{_mandir}/ja/man1/lxc-device.1* | |
333 | %exclude %{_mandir}/ja/man1/lxc-ls.1* | |
334 | %exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1* | |
335 | %exclude %{_mandir}/ja/man1/lxc-top.1* | |
336 | ||
337 | ||
338 | %if %{without python} | |
339 | # legacy version | |
340 | %attr(755,root,root) %{_bindir}/lxc-ls | |
341 | %{_mandir}/man1/lxc-ls.1* | |
342 | %endif | |
343 | ||
344 | %dir %{configpath} | |
345 | %dir %{configpath}snap | |
346 | %dir %attr(750,root,root) /var/log/lxc | |
347 | %dir %attr(750,root,root) /var/cache/lxc | |
348 | ||
349 | %files devel | |
350 | %defattr(644,root,root,755) | |
351 | %attr(755,root,root) %{_libdir}/liblxc.so | |
352 | %{_includedir}/lxc | |
353 | %{_pkgconfigdir}/lxc.pc | |
354 | ||
355 | %if %{with lua} | |
356 | %files -n lua-lxc | |
357 | %defattr(644,root,root,755) | |
358 | %attr(755,root,root) %{_bindir}/lxc-top | |
359 | %dir %{_libdir}/lua/lxc | |
360 | %attr(755,root,root) %{_libdir}/lua/lxc/core.so | |
361 | %{_datadir}/lua/lxc.lua | |
362 | %{_mandir}/man1/lxc-top.1* | |
363 | %lang(ja) %{_mandir}/ja/man1/lxc-top.1* | |
364 | %endif | |
365 | ||
366 | %if %{with python} | |
367 | %files -n python3-lxc | |
368 | %defattr(644,root,root,755) | |
369 | %attr(755,root,root) %{_bindir}/lxc-device | |
370 | %attr(755,root,root) %{_bindir}/lxc-ls | |
371 | %attr(755,root,root) %{_bindir}/lxc-start-ephemeral | |
372 | %{py3_sitedir}/lxc | |
373 | %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so | |
374 | %{py3_sitedir}/_lxc-0.1-py*.egg-info | |
375 | %{_mandir}/man1/lxc-device.1* | |
376 | %{_mandir}/man1/lxc-ls.1* | |
377 | %{_mandir}/man1/lxc-start-ephemeral.1* | |
378 | %lang(ja) %{_mandir}/ja/man1/lxc-device.1* | |
379 | %lang(ja) %{_mandir}/ja/man1/lxc-ls.1* | |
380 | %lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1* | |
381 | %endif | |
382 | ||
383 | %files -n bash-completion-%{name} | |
384 | %defattr(644,root,root,755) | |
385 | /etc/bash_completion.d/lxc |