]> git.pld-linux.org Git - packages/lxc.git/blob - lxc.spec
- Release 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 # 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:        1.1.5
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:  dd9684dde0a58ed13f4f49c855b79a1a
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:         x32.patch
32 Patch2:         %{name}-net.patch
33 URL:            https://www.linuxcontainers.org/
34 BuildRequires:  autoconf >= 2.50
35 BuildRequires:  automake
36 %{?with_cgmanager:BuildRequires:        cgmanager-devel}
37 %{?with_cgmanager:BuildRequires:        dbus-devel >= 1.2.16}
38 BuildRequires:  docbook-dtd45-xml
39 BuildRequires:  docbook2X >= 0.8
40 BuildRequires:  gnutls-devel
41 %{?with_apparmor:BuildRequires: libapparmor-devel}
42 BuildRequires:  libcap-devel
43 %{?with_cgmanager:BuildRequires:        libnih-devel >= 1.0.2}
44 %{?with_seccomp:BuildRequires:  libseccomp-devel}
45 BuildRequires:  libxslt-progs
46 %{?with_lua:BuildRequires:      lua51-devel >= 5.1}
47 BuildRequires:  pkgconfig
48 %{?with_python:BuildRequires:   python3-devel >= 1:3.2}
49 %{?with_python:BuildRequires:   python3-modules}
50 BuildRequires:  rpm-pythonprov
51 BuildRequires:  rpmbuild(macros) >= 1.671
52 BuildRequires:  sed >= 4.0
53 Requires(post): /sbin/ldconfig
54 Requires(post,preun):   /sbin/chkconfig
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 devel
96 Summary:        Header files for lxc library
97 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki lxc
98 Group:          Development/Libraries
99 Requires:       %{name} = %{version}-%{release}
100
101 %description devel
102 Header files for lxc library.
103
104 %description devel -l pl.UTF-8
105 Pliki nagłówkowe biblioteki lxc.
106
107 %package -n lua-lxc
108 Summary:        Lua binding for LXC
109 Summary(pl.UTF-8):      Wiązanie Lua do LXC
110 Group:          Libraries
111 Requires:       %{name} = %{version}-%{release}
112 Requires:       lua51-libs >= 5.1
113
114 %description -n lua-lxc
115 Lua binding for LXC.
116
117 %description -n lua-lxc -l pl.UTF-8
118 Wiązanie Lua do LXC.
119
120 %package -n python3-lxc
121 Summary:        Python (3.x) binding for LXC
122 Summary(pl.UTF-8):      Wiązanie Pythona (3.x) do LXC
123 Group:          Libraries
124 Requires:       %{name} = %{version}-%{release}
125 Requires:       python3-libs >= 3.2
126 Requires:       python3-modules
127
128 %description -n python3-lxc
129 Python (3.x) binding for LXC.
130
131 %description -n python3-lxc -l pl.UTF-8
132 Wiązanie Pythona (3.x) do LXC.
133
134 %package -n bash-completion-%{name}
135 Summary:        bash-completion for LXC
136 Summary(pl.UTF-8):      bashowe uzupełnianie nazw dla LXC
137 Group:          Applications/Shells
138 Requires:       %{name}
139 Requires:       bash-completion
140
141 %description -n bash-completion-%{name}
142 bash-completion for LXC.
143
144 %description -n bash-completion-%{name} -l pl.UTF-8
145 bashowe uzupełnianie nazw dla LXC.
146
147 %prep
148 %setup -q
149 %patch0 -p1
150 %patch1 -p1
151 %patch2 -p1
152
153 cp -p %{SOURCE1} templates/lxc-pld.in
154
155 %build
156 %{__aclocal} -I config
157 %{__autoconf}
158 %{__autoheader}
159 %{__automake}
160 %configure \
161         db2xman=docbook2X2man \
162         --disable-rpath \
163         --enable-bash \
164         --enable-doc \
165         --enable-examples \
166         %{__enable_disable apparmor} \
167         %{__enable_disable cgmanager} \
168         %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \
169         %{__enable_disable python} \
170         %{__enable_disable seccomp} \
171         %{__enable_disable selinux} \
172         --with-config-path=%{configpath} \
173         --with-init-script=sysvinit,systemd \
174         --with-runtime-path=/var/run \
175         --with-distro=pld
176
177 %{__make}
178 %{__make} -C doc
179
180 %install
181 rm -rf $RPM_BUILD_ROOT
182 install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc}  \
183         -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
184
185 %{__make} install \
186         SYSTEMD_UNIT_DIR=%{systemdunitdir} \
187         pcdatadir=%{_pkgconfigdir} \
188         DESTDIR=$RPM_BUILD_ROOT
189
190 %{__make} -C doc install \
191         DESTDIR=$RPM_BUILD_ROOT
192
193 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
194
195 # apparmor profiles are not packaged, remove to avoid packagers confusion
196 %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d
197
198 # yum plugin, no idea where to package this
199 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py
200
201 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan
202 install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libdir}/%{name}/lxc_macvlan
203
204
205 %if %{with python}
206 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
207 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc
208 %endif
209 %if %{with lua}
210 %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top
211 %endif
212
213 %clean
214 rm -rf $RPM_BUILD_ROOT
215
216 %post
217 /sbin/ldconfig
218 /sbin/chkconfig --add lxc
219 /sbin/chkconfig --add lxc-net
220 %systemd_post lxc.service lxc-net.service
221
222 %preun
223 if [ "$1" = "0" ]; then
224         %service lxc stop
225         /sbin/chkconfig --del lxc
226         %service lxc-net stop
227         /sbin/chkconfig --del lxc-net
228 fi
229 %systemd_preun lxc.service lxc-net.service
230
231 %postun
232 /sbin/ldconfig
233 %systemd_reload
234
235 %files
236 %defattr(644,root,root,755)
237 %doc AUTHORS CONTRIBUTING MAINTAINERS README  doc/FAQ.txt doc/examples/*.conf
238 %attr(755,root,root) %{_bindir}/lxc-attach
239 %attr(755,root,root) %{_bindir}/lxc-autostart
240 %attr(755,root,root) %{_bindir}/lxc-cgroup
241 %attr(755,root,root) %{_bindir}/lxc-checkconfig
242 %attr(755,root,root) %{_bindir}/lxc-checkpoint
243 %attr(755,root,root) %{_bindir}/lxc-clone
244 %attr(755,root,root) %{_bindir}/lxc-config
245 %attr(755,root,root) %{_bindir}/lxc-console
246 %attr(755,root,root) %{_bindir}/lxc-create
247 %attr(755,root,root) %{_bindir}/lxc-destroy
248 %attr(755,root,root) %{_bindir}/lxc-execute
249 %attr(755,root,root) %{_bindir}/lxc-freeze
250 %attr(755,root,root) %{_bindir}/lxc-info
251 %attr(755,root,root) %{_bindir}/lxc-monitor
252 %attr(755,root,root) %{_bindir}/lxc-snapshot
253 %attr(755,root,root) %{_bindir}/lxc-start
254 %attr(755,root,root) %{_bindir}/lxc-stop
255 %attr(755,root,root) %{_bindir}/lxc-unfreeze
256 %attr(755,root,root) %{_bindir}/lxc-unshare
257 %attr(755,root,root) %{_bindir}/lxc-usernsexec
258 %attr(755,root,root) %{_bindir}/lxc-wait
259 %attr(755,root,root) %{_sbindir}/init.lxc
260 %attr(755,root,root) %{_libdir}/liblxc.so.*.*.*
261 %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1
262 %attr(754,root,root) /etc/rc.d/init.d/lxc
263 %attr(754,root,root) /etc/rc.d/init.d/lxc-net
264
265 %{systemdunitdir}/lxc.service
266 %{systemdunitdir}/lxc-net.service
267 %dir %{_libdir}/%{name}
268 %dir %{_libdir}/%{name}/rootfs
269 %{_libdir}/%{name}/rootfs/README
270 %attr(755,root,root) %{_libdir}/%{name}/lxc-apparmor-load
271 %attr(755,root,root) %{_libdir}/%{name}/lxc-containers
272 %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup
273 %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord
274 %attr(755,root,root) %{_libdir}/%{name}/lxc-net
275 %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic
276 %attr(755,root,root) %{_libdir}/%{name}/lxc_macvlan
277 %dir %{_sysconfdir}/lxc
278 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan
279 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc
280 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf
281 %dir %{_datadir}/%{name}
282 %{_datadir}/%{name}/lxc.functions
283 # below has been removed in lxc-1.1.3
284 #%attr(755,root,root) %{_datadir}/%{name}/lxc-restore-net
285 %dir %{_datadir}/%{name}/config
286 %{_datadir}/%{name}/config/archlinux.*.conf
287 %{_datadir}/%{name}/config/centos.*.conf
288 %{_datadir}/%{name}/config/common.conf
289 %dir %{_datadir}/%{name}/config/common.conf.d
290 %{_datadir}/%{name}/config/common.conf.d/README
291 %{_datadir}/%{name}/config/common.seccomp
292 %{_datadir}/%{name}/config/debian.*.conf
293 %{_datadir}/%{name}/config/fedora.*.conf
294 %{_datadir}/%{name}/config/gentoo.*.conf
295 %{_datadir}/%{name}/config/nesting.conf
296 %{_datadir}/%{name}/config/opensuse.*.conf
297 %{_datadir}/%{name}/config/openwrt.*.conf
298 %{_datadir}/%{name}/config/oracle.*.conf
299 %{_datadir}/%{name}/config/plamo.*.conf
300 %{_datadir}/%{name}/config/ubuntu-cloud.*.conf
301 %{_datadir}/%{name}/config/ubuntu.*.conf
302 %{_datadir}/%{name}/config/userns.conf
303 %dir %{_datadir}/%{name}/hooks
304 %dir %{_datadir}/%{name}/selinux
305 %{_datadir}/%{name}/selinux/*
306 %dir %{_datadir}/%{name}/templates
307 %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
308 %attr(755,root,root) %{_datadir}/%{name}/hooks/mount*
309 %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client
310 %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep
311 %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-*
312 %{_mandir}/man1/lxc-attach.1*
313 %{_mandir}/man1/lxc-autostart.1*
314 %{_mandir}/man1/lxc-cgroup.1*
315 %{_mandir}/man1/lxc-checkconfig.1*
316 %{_mandir}/man1/lxc-checkpoint.1*
317 %{_mandir}/man1/lxc-clone.1*
318 %{_mandir}/man1/lxc-config.1*
319 %{_mandir}/man1/lxc-console.1*
320 %{_mandir}/man1/lxc-create.1*
321 %{_mandir}/man1/lxc-destroy.1*
322 %{_mandir}/man1/lxc-execute.1*
323 %{_mandir}/man1/lxc-freeze.1*
324 %{_mandir}/man1/lxc-info.1*
325 %{_mandir}/man1/lxc-monitor.1*
326 %{_mandir}/man1/lxc-snapshot.1*
327 %{_mandir}/man1/lxc-start.1*
328 %{_mandir}/man1/lxc-stop.1*
329 %{_mandir}/man1/lxc-unfreeze.1*
330 %{_mandir}/man1/lxc-unshare.1*
331 %{_mandir}/man1/lxc-user-nic.1*
332 %{_mandir}/man1/lxc-usernsexec.1*
333 %{_mandir}/man1/lxc-wait.1*
334 %{_mandir}/man5/lxc-usernet.5*
335 %{_mandir}/man5/lxc.conf.5*
336 %{_mandir}/man5/lxc.container.conf.5*
337 %{_mandir}/man5/lxc.system.conf.5*
338 %{_mandir}/man7/lxc.7*
339 %lang(ja) %{_mandir}/ja/man1/lxc*.1*
340 %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5*
341 %lang(ja) %{_mandir}/ja/man5/lxc.conf.5*
342 %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5*
343 %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5*
344 %lang(ja) %{_mandir}/ja/man7/lxc.7*
345 %exclude %{_mandir}/ja/man1/lxc-device.1*
346 %exclude %{_mandir}/ja/man1/lxc-ls.1*
347 %exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1*
348 %exclude %{_mandir}/ja/man1/lxc-top.1*
349
350
351 %if %{without python}
352 # legacy version
353 %attr(755,root,root) %{_bindir}/lxc-ls
354 %{_mandir}/man1/lxc-ls.1*
355 %endif
356
357 %dir %{configpath}
358 %dir %{configpath}snap
359 %dir %attr(750,root,root) /var/log/lxc
360 %dir %attr(750,root,root) /var/cache/lxc
361
362 %files devel
363 %defattr(644,root,root,755)
364 %attr(755,root,root) %{_libdir}/liblxc.so
365 %{_includedir}/lxc
366 %{_pkgconfigdir}/lxc.pc
367
368 %if %{with lua}
369 %files -n lua-lxc
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_bindir}/lxc-top
372 %dir %{_libdir}/lua/lxc
373 %attr(755,root,root) %{_libdir}/lua/lxc/core.so
374 %{_datadir}/lua/lxc.lua
375 %{_mandir}/man1/lxc-top.1*
376 %lang(ja) %{_mandir}/ja/man1/lxc-top.1*
377 %endif
378
379 %if %{with python}
380 %files -n python3-lxc
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_bindir}/lxc-device
383 %attr(755,root,root) %{_bindir}/lxc-ls
384 %attr(755,root,root) %{_bindir}/lxc-start-ephemeral
385 %{py3_sitedir}/lxc
386 %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so
387 %{py3_sitedir}/_lxc-0.1-py*.egg-info
388 %{_mandir}/man1/lxc-device.1*
389 %{_mandir}/man1/lxc-ls.1*
390 %{_mandir}/man1/lxc-start-ephemeral.1*
391 %lang(ja) %{_mandir}/ja/man1/lxc-device.1*
392 %lang(ja) %{_mandir}/ja/man1/lxc-ls.1*
393 %lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1*
394 %endif
395
396 %files -n bash-completion-%{name}
397 %defattr(644,root,root,755)
398 /etc/bash_completion.d/lxc
This page took 0.064787 seconds and 4 git commands to generate.