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