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