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