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