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