]> git.pld-linux.org Git - packages/lxc.git/blame - lxc.spec
- updated to 5.0.2, now uses meson
[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
8ba1db82 4
67c70229 5# Conditional build:
5dbfe331 6%bcond_without apparmor # apparmor support
94b9a175
JB
7%bcond_without seccomp # SecComp syscall filter
8%bcond_without static # static init.lxc variant
5dbfe331 9%bcond_with selinux # SELinux support
039619ae 10%bcond_with uring # io-uring based event loop
94b9a175 11%bcond_without pam # cgfs PAM module
21c5c666 12
247c2ba9 13Summary: Linux Containers userspace tools
67c70229 14Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC)
0886a606 15Name: lxc
039619ae 16Version: 5.0.2
a82ba04e 17Release: 1
c34ce688 18License: LGPL v2.1+
67c70229 19Group: Applications/System
5dbfe331 20Source0: https://linuxcontainers.org/downloads/lxc/%{name}-%{version}.tar.gz
039619ae 21# Source0-md5: e4e4aada334fb282f9af9b3bd2aa3ad7
adc39309 22Source1: %{name}-pld.in.sh
1dd4bfdd
LG
23# lxc-net based on bridge, macvlan is an alternative/supported lxc network
24Source2: %{name}_macvlan.sysconfig
25Source3: %{name}_macvlan
039619ae 26Patch0: %{name}-pld.patch
a71266b2 27Patch1: %{name}-net.patch
216742cb 28Patch2: x32.patch
6a2933ce 29URL: https://www.linuxcontainers.org/
990c3135 30BuildRequires: docbook-dtd45-xml
e1610aa3 31BuildRequires: docbook2X >= 0.8
56ecc5fa 32BuildRequires: doxygen
94b9a175
JB
33BuildRequires: gcc >= 6:4.7
34%{?with_static:BuildRequires: glibc-static}
7e4c14a6 35BuildRequires: gnutls-devel
ccd4948a 36%{?with_apparmor:BuildRequires: libapparmor-devel}
4e32c712 37BuildRequires: libcap-devel
94b9a175 38%{?with_static:BuildRequires: libcap-static}
039619ae
JB
39%{?with_seccomp:BuildRequires: libseccomp-devel >= 2.5.0}
40%{?with_uring:BuildRequires: liburing-devel}
82a3991b 41BuildRequires: libxslt-progs
039619ae
JB
42BuildRequires: meson >= 0.61
43BuildRequires: ninja >= 1.5
94b9a175 44%{?with_pam:BuildRequires: pam-devel}
67c70229 45BuildRequires: pkgconfig
039619ae 46BuildRequires: rpmbuild(macros) >= 1.736
c34ce688 47BuildRequires: sed >= 4.0
557d1e73
ER
48Requires(post): /sbin/ldconfig
49Requires(post,preun): /sbin/chkconfig
19fd2939 50Requires: %{name}-libs = %{version}-%{release}
75133c9e
ER
51# lxc_macvlan script
52Requires: gawk
53# used in lxc-net script to set bridge nat
72d9317d 54Requires: iproute2
75133c9e 55Requires: iptables
557d1e73 56Requires: rc-scripts >= 0.4.6
5e7929a2 57Requires: systemd-units >= 38
75133c9e 58Requires: which
19fd2939 59# used in lxc-net script, but not all cases, may break working setups
e1610aa3 60Suggests: dnsmasq
7f0b7e89 61Suggests: gnupg
16cf226e
ER
62Suggests: gnupg-plugin-keys_curl
63Suggests: gnupg-plugin-keys_hkp
21c5c666 64Suggests: net-tools
b335abc0 65Suggests: rsync
0886a606
AM
66BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
e5afa52e 68%define configpath /var/lib/lxc
69
0886a606
AM
70%description
71Tools to create and manage containers. It contains a full featured
72container with the isolation / virtualization of the pids, the ipc,
73the utsname, the mount points, /proc, /sys, the network and it takes
74into account the control groups. It is very light, flexible, and
75provides a set of tools around the container like the monitoring with
76asynchronous events notification, or the freeze of the container. This
77package is useful to create Virtual Private Server, or to run isolated
78applications like bash or sshd.
79
67c70229
JB
80%description -l pl.UTF-8
81Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje
1dd4bfdd 82w pełni funkcjonalne kontenery z izolacją/wirtualizacją pidów, ipc,
67c70229
JB
83utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające
84grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia
85do czynności związanych z kontenerami, takich jak monitorowanie z
86asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten
87pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych
88oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd.
89
94b9a175
JB
90%package -n pam-pam_cgfs
91Summary: PAM module to create user cgroups
92Summary(pl.UTF-8): Moduł PAM do tworzenia cgroup użytkownika
93Group: Libraries
94Requires: pam
95
96%description -n pam-pam_cgfs
97PAM module that when a user logs in, will create cgroups which the
98user may administer.
99
100%description -n pam-pam_cgfs -l pl.UTF-8
101Moduł PAM, który przy logowaniu użytkownika tworzy cgroupy, którymi
102użytkownik może administrować.
103
19fd2939
ER
104%package libs
105Summary: liblxc library
56ecc5fa 106Summary(pl.UTF-8): Biblioteka liblxc
19fd2939 107Group: Libraries
039619ae 108%{?with_seccomp:Requires: libseccomp >= 2.5.0}
56ecc5fa 109Conflicts: lxc < 2.0.4-2
19fd2939
ER
110
111%description libs
112liblxc library.
113
56ecc5fa
JB
114%description libs -l pl.UTF-8
115Biblioteka liblxc.
116
0886a606 117%package devel
67c70229
JB
118Summary: Header files for lxc library
119Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc
0886a606 120Group: Development/Libraries
19fd2939 121Requires: %{name}-libs = %{version}-%{release}
0886a606
AM
122
123%description devel
67c70229
JB
124Header files for lxc library.
125
126%description devel -l pl.UTF-8
127Pliki nagłówkowe biblioteki lxc.
128
94b9a175
JB
129%package static
130Summary: Static lxc library
131Summary(pl.UTF-8): Statyczna biblioteka lxc
132Group: Development/Libraries
133Requires: %{name}-devel = %{version}-%{release}
134
135%description static
136Static lxc library.
137
138%description static -l pl.UTF-8
139Statyczna biblioteka lxc.
140
4e82464d
ER
141%package -n bash-completion-%{name}
142Summary: bash-completion for LXC
143Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC
144Group: Applications/Shells
56ecc5fa 145Requires: %{name} = %{version}-%{release}
4e82464d 146Requires: bash-completion
5fb2cd31 147BuildArch: noarch
4e82464d
ER
148
149%description -n bash-completion-%{name}
150bash-completion for LXC.
151
152%description -n bash-completion-%{name} -l pl.UTF-8
153bashowe uzupełnianie nazw dla LXC.
154
0886a606 155%prep
9db966c1 156%setup -q
039619ae 157%patch0 -p1
67c70229 158%patch1 -p1
216742cb 159%patch2 -p1
0886a606 160
8a96554a
ER
161cp -p %{SOURCE1} templates/lxc-pld.in
162
039619ae
JB
163%{__sed} -i -e "/^pam_security =/ s!libdir,!'/', '%{_lib}',!" meson.build
164
0886a606 165%build
039619ae
JB
166%meson build \
167 %{!?with_apparmor:-Dapparmor=false} \
168 -Ddata-path=%{configpath} \
169 -Ddistrosysconfdir=/etc/sysconfig \
170 -Dinit-script=sysvinit,systemd \
171 %{?with_uring:-Dio-uring-event-loop} \
172 %{?with_pam:-Dpam-cgroup=true} \
173 -Druntime-path=/var/run \
174 %{!?with_seccomp:-Dseccomp=false} \
175 %{!?with_selinux:-Dselinux=false} \
176 -Dsystemd-unitdir=%{systemdunitdir}
177
178%ninja_build -C build
0886a606
AM
179
180%install
181rm -rf $RPM_BUILD_ROOT
039619ae 182install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/log/lxc}
33aee790 183
039619ae 184%ninja_install -C build
33aee790 185
039619ae
JB
186# keep compatible name
187%{__mv} $RPM_BUILD_ROOT/etc/rc.d/init.d/{lxc-containers,lxc}
8caba3bf 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 197install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan
d87fbc13 198install -p %{SOURCE3} $RPM_BUILD_ROOT%{_libexecdir}/%{name}/lxc_macvlan
1dd4bfdd 199
0886a606
AM
200%clean
201rm -rf $RPM_BUILD_ROOT
202
75133c9e 203%post
46f2854c 204/sbin/chkconfig --add lxc
5e7929a2 205/sbin/chkconfig --add lxc-net
5e7929a2 206%systemd_post lxc.service lxc-net.service
46f2854c 207
46f2854c
MK
208%preun
209if [ "$1" = "0" ]; then
210 %service lxc stop
211 /sbin/chkconfig --del lxc
5e7929a2
JK
212 %service lxc-net stop
213 /sbin/chkconfig --del lxc-net
46f2854c 214fi
5e7929a2 215%systemd_preun lxc.service lxc-net.service
46f2854c 216
5e7929a2 217%postun
5e7929a2 218%systemd_reload
46f2854c 219
19fd2939
ER
220%post libs -p /sbin/ldconfig
221%postun libs -p /sbin/ldconfig
222
0886a606
AM
223%files
224%defattr(644,root,root,755)
039619ae 225%doc AUTHORS COPYING MAINTAINERS README.md doc/FAQ.txt build/doc/examples/*.conf
c34ce688 226%attr(755,root,root) %{_bindir}/lxc-attach
7e4c14a6 227%attr(755,root,root) %{_bindir}/lxc-autostart
c34ce688
JB
228%attr(755,root,root) %{_bindir}/lxc-cgroup
229%attr(755,root,root) %{_bindir}/lxc-checkconfig
72fb3a26 230%attr(755,root,root) %{_bindir}/lxc-checkpoint
a71266b2 231%attr(755,root,root) %{_bindir}/lxc-copy
247c2ba9 232%attr(755,root,root) %{_bindir}/lxc-config
c34ce688
JB
233%attr(755,root,root) %{_bindir}/lxc-console
234%attr(755,root,root) %{_bindir}/lxc-create
235%attr(755,root,root) %{_bindir}/lxc-destroy
a3d3eb65 236%attr(755,root,root) %{_bindir}/lxc-device
c34ce688
JB
237%attr(755,root,root) %{_bindir}/lxc-execute
238%attr(755,root,root) %{_bindir}/lxc-freeze
239%attr(755,root,root) %{_bindir}/lxc-info
a3d3eb65 240%attr(755,root,root) %{_bindir}/lxc-ls
c34ce688 241%attr(755,root,root) %{_bindir}/lxc-monitor
247c2ba9 242%attr(755,root,root) %{_bindir}/lxc-snapshot
c34ce688
JB
243%attr(755,root,root) %{_bindir}/lxc-start
244%attr(755,root,root) %{_bindir}/lxc-stop
a3d3eb65 245%attr(755,root,root) %{_bindir}/lxc-top
c34ce688
JB
246%attr(755,root,root) %{_bindir}/lxc-unfreeze
247%attr(755,root,root) %{_bindir}/lxc-unshare
d87fbc13 248%attr(755,root,root) %{_bindir}/lxc-update-config
120ac263 249%attr(755,root,root) %{_bindir}/lxc-usernsexec
c34ce688 250%attr(755,root,root) %{_bindir}/lxc-wait
ce58f702 251%attr(755,root,root) %{_sbindir}/init.lxc
94b9a175 252%if %{with static}
a3d3eb65 253%attr(755,root,root) %{_sbindir}/init.lxc.static
94b9a175 254%endif
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
56ecc5fa 259%{systemdunitdir}/lxc@.service
039619ae 260%{systemdunitdir}/lxc-monitord.service
72fb3a26 261%{systemdunitdir}/lxc-net.service
8ba1db82
ER
262%dir %{_libdir}/%{name}
263%dir %{_libdir}/%{name}/rootfs
264%{_libdir}/%{name}/rootfs/README
94b9a175 265%if "%{_libexecdir}" != "%{_libdir}"
4259c400 266%dir %{_libexecdir}/%{name}
94b9a175 267%endif
d87fbc13
GP
268%attr(755,root,root) %{_libexecdir}/%{name}/lxc-apparmor-load
269%attr(755,root,root) %{_libexecdir}/%{name}/lxc-containers
270%attr(755,root,root) %{_libexecdir}/%{name}/lxc-monitord
271%attr(755,root,root) %{_libexecdir}/%{name}/lxc-net
272%attr(755,root,root) %{_libexecdir}/%{name}/lxc-user-nic
273%attr(755,root,root) %{_libexecdir}/%{name}/lxc_macvlan
4259c400
JR
274%dir %{_libexecdir}/%{name}/hooks
275%attr(755,root,root) %{_libexecdir}/%{name}/hooks/unmount-namespace
dc9a5b3b 276%dir %{_sysconfdir}/lxc
46f2854c 277%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan
72fb3a26 278%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc
67c70229 279%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf
120ac263 280%dir %{_datadir}/%{name}
f5933d47 281%{_datadir}/%{name}/lxc.functions
120ac263 282%dir %{_datadir}/%{name}/config
72fb3a26
JK
283%{_datadir}/%{name}/config/common.conf
284%dir %{_datadir}/%{name}/config/common.conf.d
285%{_datadir}/%{name}/config/common.conf.d/README
b93f2cb9 286%{_datadir}/%{name}/config/common.seccomp
e1610aa3 287%{_datadir}/%{name}/config/nesting.conf
a3d3eb65 288%{_datadir}/%{name}/config/oci.common.conf
72fb3a26 289%{_datadir}/%{name}/config/userns.conf
f5933d47 290%dir %{_datadir}/%{name}/hooks
039619ae 291%if %{with selinux}
72fb3a26 292%dir %{_datadir}/%{name}/selinux
039619ae
JB
293%{_datadir}/%{name}/selinux/lxc.if
294%{_datadir}/%{name}/selinux/lxc.te
295%endif
f5933d47 296%dir %{_datadir}/%{name}/templates
247c2ba9 297%attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname
a3d3eb65
AM
298%attr(755,root,root) %{_datadir}/%{name}/hooks/dhclient
299%attr(755,root,root) %{_datadir}/%{name}/hooks/dhclient-script
7e4c14a6 300%attr(755,root,root) %{_datadir}/%{name}/hooks/mount*
a3d3eb65 301%attr(755,root,root) %{_datadir}/%{name}/hooks/nvidia
7e4c14a6 302%attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client
247c2ba9 303%attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep
f5933d47 304%attr(755,root,root) %{_datadir}/%{name}/templates/lxc-*
c34ce688 305%{_mandir}/man1/lxc-attach.1*
7e4c14a6 306%{_mandir}/man1/lxc-autostart.1*
c34ce688
JB
307%{_mandir}/man1/lxc-cgroup.1*
308%{_mandir}/man1/lxc-checkconfig.1*
72fb3a26 309%{_mandir}/man1/lxc-checkpoint.1*
a71266b2 310%{_mandir}/man1/lxc-copy.1*
8ba1db82 311%{_mandir}/man1/lxc-config.1*
c34ce688
JB
312%{_mandir}/man1/lxc-console.1*
313%{_mandir}/man1/lxc-create.1*
314%{_mandir}/man1/lxc-destroy.1*
a3d3eb65 315%{_mandir}/man1/lxc-device.1*
c34ce688
JB
316%{_mandir}/man1/lxc-execute.1*
317%{_mandir}/man1/lxc-freeze.1*
318%{_mandir}/man1/lxc-info.1*
a3d3eb65 319%{_mandir}/man1/lxc-ls.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*
a3d3eb65 324%{_mandir}/man1/lxc-top.1*
c34ce688
JB
325%{_mandir}/man1/lxc-unfreeze.1*
326%{_mandir}/man1/lxc-unshare.1*
d87fbc13 327%{_mandir}/man1/lxc-update-config.1*
120ac263 328%{_mandir}/man1/lxc-user-nic.1*
8ba1db82 329%{_mandir}/man1/lxc-usernsexec.1*
c34ce688 330%{_mandir}/man1/lxc-wait.1*
120ac263 331%{_mandir}/man5/lxc-usernet.5*
67c70229 332%{_mandir}/man5/lxc.conf.5*
8ba1db82
ER
333%{_mandir}/man5/lxc.container.conf.5*
334%{_mandir}/man5/lxc.system.conf.5*
67c70229 335%{_mandir}/man7/lxc.7*
247c2ba9 336%lang(ja) %{_mandir}/ja/man1/lxc*.1*
7e4c14a6 337%lang(ja) %{_mandir}/ja/man5/lxc-usernet.5*
247c2ba9 338%lang(ja) %{_mandir}/ja/man5/lxc.conf.5*
8ba1db82
ER
339%lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5*
340%lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5*
247c2ba9 341%lang(ja) %{_mandir}/ja/man7/lxc.7*
56ecc5fa
JB
342%lang(ko) %{_mandir}/ko/man1/lxc*.1*
343%lang(ko) %{_mandir}/ko/man5/lxc-usernet.5*
344%lang(ko) %{_mandir}/ko/man5/lxc.conf.5*
345%lang(ko) %{_mandir}/ko/man5/lxc.container.conf.5*
346%lang(ko) %{_mandir}/ko/man5/lxc.system.conf.5*
347%lang(ko) %{_mandir}/ko/man7/lxc.7*
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
94b9a175
JB
354%if %{with pam}
355%files -n pam-pam_cgfs
356%defattr(644,root,root,755)
357%attr(755,root,root) /%{_lib}/security/pam_cgfs.so
7af31a12
JR
358%{_mandir}/ja/man8/pam_cgfs.8*
359%{_mandir}/man8/pam_cgfs.8*
94b9a175
JB
360%endif
361
19fd2939
ER
362%files libs
363%defattr(644,root,root,755)
364%attr(755,root,root) %{_libdir}/liblxc.so.*.*.*
365%attr(755,root,root) %ghost %{_libdir}/liblxc.so.1
366
0886a606
AM
367%files devel
368%defattr(644,root,root,755)
0886a606 369%attr(755,root,root) %{_libdir}/liblxc.so
67c70229 370%{_includedir}/lxc
e5afa52e 371%{_pkgconfigdir}/lxc.pc
67c70229 372
94b9a175
JB
373%files static
374%defattr(644,root,root,755)
375%{_libdir}/liblxc.a
376
4e82464d
ER
377%files -n bash-completion-%{name}
378%defattr(644,root,root,755)
039619ae 379%{bash_compdir}/_lxc
a82ba04e 380%{bash_compdir}/lxc-*
This page took 0.176384 seconds and 5 git commands to generate.