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