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