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