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