]>
Commit | Line | Data |
---|---|---|
1 | # TODO | |
2 | # - package apparmor stuff | |
3 | ||
4 | # Conditional build: | |
5 | %bcond_without seccomp # SecComp syscall filter | |
6 | %bcond_without apparmor # apparmor | |
7 | %bcond_without lua # Lua binding | |
8 | %bcond_without python # Python binding | |
9 | %bcond_with selinux # SELinux | |
10 | %bcond_with cgmanager # Enable cgmanager (BR: libcgmanager, libnih >= 1.0.2, libnih-dbus >= 1.0.0, dbus-1 >= 1.2.16) | |
11 | ||
12 | Summary: Linux Containers userspace tools | |
13 | Summary(pl.UTF-8): Narzędzia do kontenerów linuksowych (LXC) | |
14 | Name: lxc | |
15 | Version: 1.0.7 | |
16 | Release: 3 | |
17 | License: LGPL v2.1+ | |
18 | Group: Applications/System | |
19 | Source0: https://www.linuxcontainers.org/downloads/%{name}-%{version}.tar.gz | |
20 | # Source0-md5: b48f468a9bef0e4e140dd723f0a65ad0 | |
21 | Source1: %{name}-pld.in.sh | |
22 | Source2: %{name}.init | |
23 | Source3: %{name}_macvlan.init | |
24 | Source4: %{name}_macvlan.sysconfig | |
25 | Patch1: %{name}-pld.patch | |
26 | URL: https://www.linuxcontainers.org/ | |
27 | BuildRequires: autoconf >= 2.50 | |
28 | BuildRequires: automake | |
29 | BuildRequires: docbook-dtd30-sgml | |
30 | BuildRequires: docbook-utils | |
31 | BuildRequires: docbook2X | |
32 | BuildRequires: gnutls-devel | |
33 | %{?with_apparmor:BuildRequires: libapparmor-devel} | |
34 | BuildRequires: libcap-devel | |
35 | %{?with_seccomp:BuildRequires: libseccomp-devel} | |
36 | BuildRequires: libxslt-progs | |
37 | %{?with_lua:BuildRequires: lua51-devel >= 5.1} | |
38 | BuildRequires: pkgconfig | |
39 | %{?with_python:BuildRequires: python3-devel >= 3.2} | |
40 | BuildRequires: rpm-pythonprov | |
41 | BuildRequires: rpmbuild(macros) >= 1.612 | |
42 | BuildRequires: sed >= 4.0 | |
43 | Requires: rc-scripts >= 0.4.6 | |
44 | Requires: which | |
45 | Requires: iproute2 | |
46 | Requires(post,preun): /sbin/chkconfig | |
47 | Requires(post): /sbin/ldconfig | |
48 | Suggests: gnupg | |
49 | Suggests: gnupg-plugin-keys_curl | |
50 | Suggests: gnupg-plugin-keys_hkp | |
51 | Suggests: net-tools | |
52 | Suggests: python3-lxc | |
53 | Suggests: rsync | |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
55 | ||
56 | %define configpath /var/lib/lxc | |
57 | ||
58 | %description | |
59 | Tools to create and manage containers. It contains a full featured | |
60 | container with the isolation / virtualization of the pids, the ipc, | |
61 | the utsname, the mount points, /proc, /sys, the network and it takes | |
62 | into account the control groups. It is very light, flexible, and | |
63 | provides a set of tools around the container like the monitoring with | |
64 | asynchronous events notification, or the freeze of the container. This | |
65 | package is useful to create Virtual Private Server, or to run isolated | |
66 | applications like bash or sshd. | |
67 | ||
68 | %description -l pl.UTF-8 | |
69 | Narzędzia do tworzenia i zarządzania kontenerami. System ten obejmuje | |
70 | w pełni funkcjonalne kontenery z ilozacją/wirtualizacją pidów, ipc, | |
71 | utsname, punktów montowania, /proc, /sys, sieci oraz uwzględniające | |
72 | grupy kontrolne. Jest bardzo lekki, elastyczny i udostępnia narzędzia | |
73 | do czynności związanych z kontenerami, takich jak monitorowanie z | |
74 | asynchronicznym powiadamianiem o zdarzeniach czy zamrażanie. Ten | |
75 | pakiet jest przydatny do tworzenia wirtualnych serwerów prywatnych | |
76 | oraz uruchamiania izolowanych aplikacji, takich jak bash czy sshd. | |
77 | ||
78 | %package devel | |
79 | Summary: Header files for lxc library | |
80 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki lxc | |
81 | Group: Development/Libraries | |
82 | Requires: %{name} = %{version}-%{release} | |
83 | ||
84 | %description devel | |
85 | Header files for lxc library. | |
86 | ||
87 | %description devel -l pl.UTF-8 | |
88 | Pliki nagłówkowe biblioteki lxc. | |
89 | ||
90 | %package -n lua-lxc | |
91 | Summary: Lua binding for LXC | |
92 | Summary(pl.UTF-8): Wiązanie Lua do LXC | |
93 | Group: Libraries | |
94 | Requires: %{name} = %{version}-%{release} | |
95 | Requires: lua51-libs >= 5.1 | |
96 | ||
97 | %description -n lua-lxc | |
98 | Lua binding for LXC. | |
99 | ||
100 | %description -n lua-lxc -l pl.UTF-8 | |
101 | Wiązanie Lua do LXC. | |
102 | ||
103 | %package -n python3-lxc | |
104 | Summary: Python (3.x) binding for LXC | |
105 | Summary(pl.UTF-8): Wiązanie Pythona (3.x) do LXC | |
106 | Group: Libraries | |
107 | Requires: %{name} = %{version}-%{release} | |
108 | Requires: python3-libs >= 3.2 | |
109 | Requires: python3-modules | |
110 | ||
111 | %description -n python3-lxc | |
112 | Python (3.x) binding for LXC. | |
113 | ||
114 | %description -n python3-lxc -l pl.UTF-8 | |
115 | Wiązanie Pythona (3.x) do LXC. | |
116 | ||
117 | %package -n bash-completion-%{name} | |
118 | Summary: bash-completion for LXC | |
119 | Summary(pl.UTF-8): bashowe uzupełnianie nazw dla LXC | |
120 | Group: Applications/Shells | |
121 | Requires: %{name} | |
122 | Requires: bash-completion | |
123 | ||
124 | %description -n bash-completion-%{name} | |
125 | bash-completion for LXC. | |
126 | ||
127 | %description -n bash-completion-%{name} -l pl.UTF-8 | |
128 | bashowe uzupełnianie nazw dla LXC. | |
129 | ||
130 | %prep | |
131 | %setup -q | |
132 | %patch1 -p1 | |
133 | ||
134 | cp -p %{SOURCE1} templates/lxc-pld.in | |
135 | ||
136 | %build | |
137 | %{__aclocal} -I config | |
138 | %{__autoconf} | |
139 | %{__autoheader} | |
140 | %{__automake} | |
141 | %configure \ | |
142 | db2xman=docbook2X2man \ | |
143 | --disable-rpath \ | |
144 | --enable-bash \ | |
145 | --enable-doc \ | |
146 | --enable-examples \ | |
147 | %{__enable_disable apparmor} \ | |
148 | %{__enable_disable lua} %{?with_lua:--with-lua-pc=lua51} \ | |
149 | %{__enable_disable python} \ | |
150 | %{__enable_disable seccomp} \ | |
151 | %{__enable_disable selinux} \ | |
152 | --with-config-path=%{configpath} \ | |
153 | --with-init-script=sysvinit,systemd \ | |
154 | --with-runtime-path=/var/run \ | |
155 | --with-distro=pld | |
156 | ||
157 | %{__make} | |
158 | %{__make} -C doc | |
159 | ||
160 | %install | |
161 | rm -rf $RPM_BUILD_ROOT | |
162 | install -d $RPM_BUILD_ROOT{%{configpath},%{configpath}snap,/var/{cache,log}/lxc} \ | |
163 | -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} | |
164 | ||
165 | %{__make} install \ | |
166 | SYSTEMD_UNIT_DIR=%{systemdunitdir} \ | |
167 | pcdatadir=%{_pkgconfigdir} \ | |
168 | DESTDIR=$RPM_BUILD_ROOT | |
169 | ||
170 | %{__make} -C doc install \ | |
171 | DESTDIR=$RPM_BUILD_ROOT | |
172 | ||
173 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir} | |
174 | ||
175 | # apparmor profiles are not packaged, remove to avoid packagers confusion | |
176 | %{__rm} -r $RPM_BUILD_ROOT/etc/apparmor.d | |
177 | ||
178 | # yum plugin, no idea where to package this | |
179 | %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/lxc-patch.py | |
180 | ||
181 | install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc | |
182 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/lxc_macvlan | |
183 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/lxc_macvlan | |
184 | ||
185 | %if %{with python} | |
186 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
187 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}/lxc | |
188 | %endif | |
189 | %if %{with lua} | |
190 | %{__sed} -i -e '1s,#!/usr/bin/env lua,#!/usr/bin/lua5.1,' $RPM_BUILD_ROOT%{_bindir}/lxc-top | |
191 | %endif | |
192 | ||
193 | %clean | |
194 | rm -rf $RPM_BUILD_ROOT | |
195 | ||
196 | %post | |
197 | /sbin/ldconfig | |
198 | /sbin/chkconfig --add lxc | |
199 | /sbin/chkconfig --add lxc_macvlan | |
200 | ||
201 | %preun | |
202 | if [ "$1" = "0" ]; then | |
203 | %service lxc stop | |
204 | /sbin/chkconfig --del lxc | |
205 | %service lxc_macvlan stop | |
206 | /sbin/chkconfig --del lxc_macvlan | |
207 | fi | |
208 | ||
209 | %postun -p /sbin/ldconfig | |
210 | ||
211 | ||
212 | %files | |
213 | %defattr(644,root,root,755) | |
214 | %doc AUTHORS CONTRIBUTING MAINTAINERS README doc/FAQ.txt doc/examples/*.conf | |
215 | %attr(755,root,root) %{_bindir}/lxc-attach | |
216 | %attr(755,root,root) %{_bindir}/lxc-autostart | |
217 | %attr(755,root,root) %{_bindir}/lxc-cgroup | |
218 | %attr(755,root,root) %{_bindir}/lxc-checkconfig | |
219 | %attr(755,root,root) %{_bindir}/lxc-clone | |
220 | %attr(755,root,root) %{_bindir}/lxc-config | |
221 | %attr(755,root,root) %{_bindir}/lxc-console | |
222 | %attr(755,root,root) %{_bindir}/lxc-create | |
223 | %attr(755,root,root) %{_bindir}/lxc-destroy | |
224 | %attr(755,root,root) %{_bindir}/lxc-execute | |
225 | %attr(755,root,root) %{_bindir}/lxc-freeze | |
226 | %attr(755,root,root) %{_bindir}/lxc-info | |
227 | %attr(755,root,root) %{_bindir}/lxc-monitor | |
228 | %attr(755,root,root) %{_bindir}/lxc-snapshot | |
229 | %attr(755,root,root) %{_bindir}/lxc-start | |
230 | %attr(755,root,root) %{_bindir}/lxc-stop | |
231 | %attr(755,root,root) %{_bindir}/lxc-unfreeze | |
232 | %attr(755,root,root) %{_bindir}/lxc-unshare | |
233 | %attr(755,root,root) %{_bindir}/lxc-usernsexec | |
234 | %attr(755,root,root) %{_bindir}/lxc-wait | |
235 | %attr(755,root,root) %{_sbindir}/init.lxc | |
236 | %attr(755,root,root) %{_libdir}/liblxc.so.*.*.* | |
237 | %attr(755,root,root) %ghost %{_libdir}/liblxc.so.1 | |
238 | %attr(754,root,root) /etc/rc.d/init.d/lxc | |
239 | %attr(754,root,root) /etc/rc.d/init.d/lxc_macvlan | |
240 | ||
241 | %{systemdunitdir}/lxc.service | |
242 | %dir %{_libdir}/%{name} | |
243 | %dir %{_libdir}/%{name}/rootfs | |
244 | %{_libdir}/%{name}/rootfs/README | |
245 | %attr(755,root,root) %{_libdir}/%{name}/lxc-devsetup | |
246 | %attr(755,root,root) %{_libdir}/%{name}/lxc-monitord | |
247 | %attr(755,root,root) %{_libdir}/%{name}/lxc-user-nic | |
248 | %attr(755,root,root) %{_libdir}/%{name}/lxc-autostart-helper | |
249 | %dir %{_sysconfdir}/lxc | |
250 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/lxc_macvlan | |
251 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lxc/default.conf | |
252 | %dir %{_datadir}/%{name} | |
253 | %{_datadir}/%{name}/lxc.functions | |
254 | %dir %{_datadir}/%{name}/config | |
255 | %{_datadir}/%{name}/config/centos.*.conf | |
256 | %{_datadir}/%{name}/config/common.seccomp | |
257 | %{_datadir}/%{name}/config/debian.*.conf | |
258 | %{_datadir}/%{name}/config/fedora.*.conf | |
259 | %{_datadir}/%{name}/config/gentoo.*.conf | |
260 | %{_datadir}/%{name}/config/oracle.*.conf | |
261 | %{_datadir}/%{name}/config/plamo.*.conf | |
262 | %{_datadir}/%{name}/config/ubuntu-cloud.*.conf | |
263 | %{_datadir}/%{name}/config/ubuntu.*.conf | |
264 | %dir %{_datadir}/%{name}/hooks | |
265 | %dir %{_datadir}/%{name}/templates | |
266 | %attr(755,root,root) %{_datadir}/%{name}/hooks/clonehostname | |
267 | %attr(755,root,root) %{_datadir}/%{name}/hooks/mount* | |
268 | %attr(755,root,root) %{_datadir}/%{name}/hooks/squid-deb-proxy-client | |
269 | %attr(755,root,root) %{_datadir}/%{name}/hooks/ubuntu-cloud-prep | |
270 | %attr(755,root,root) %{_datadir}/%{name}/templates/lxc-* | |
271 | %{_mandir}/man1/lxc-attach.1* | |
272 | %{_mandir}/man1/lxc-autostart.1* | |
273 | %{_mandir}/man1/lxc-cgroup.1* | |
274 | %{_mandir}/man1/lxc-checkconfig.1* | |
275 | %{_mandir}/man1/lxc-clone.1* | |
276 | %{_mandir}/man1/lxc-config.1* | |
277 | %{_mandir}/man1/lxc-console.1* | |
278 | %{_mandir}/man1/lxc-create.1* | |
279 | %{_mandir}/man1/lxc-destroy.1* | |
280 | %{_mandir}/man1/lxc-execute.1* | |
281 | %{_mandir}/man1/lxc-freeze.1* | |
282 | %{_mandir}/man1/lxc-info.1* | |
283 | %{_mandir}/man1/lxc-monitor.1* | |
284 | %{_mandir}/man1/lxc-snapshot.1* | |
285 | %{_mandir}/man1/lxc-start.1* | |
286 | %{_mandir}/man1/lxc-stop.1* | |
287 | %{_mandir}/man1/lxc-unfreeze.1* | |
288 | %{_mandir}/man1/lxc-unshare.1* | |
289 | %{_mandir}/man1/lxc-user-nic.1* | |
290 | %{_mandir}/man1/lxc-usernsexec.1* | |
291 | %{_mandir}/man1/lxc-wait.1* | |
292 | %{_mandir}/man5/lxc-usernet.5* | |
293 | %{_mandir}/man5/lxc.conf.5* | |
294 | %{_mandir}/man5/lxc.container.conf.5* | |
295 | %{_mandir}/man5/lxc.system.conf.5* | |
296 | %{_mandir}/man7/lxc.7* | |
297 | %lang(ja) %{_mandir}/ja/man1/lxc*.1* | |
298 | %lang(ja) %{_mandir}/ja/man5/lxc-usernet.5* | |
299 | %lang(ja) %{_mandir}/ja/man5/lxc.conf.5* | |
300 | %lang(ja) %{_mandir}/ja/man5/lxc.container.conf.5* | |
301 | %lang(ja) %{_mandir}/ja/man5/lxc.system.conf.5* | |
302 | %lang(ja) %{_mandir}/ja/man7/lxc.7* | |
303 | %exclude %{_mandir}/ja/man1/lxc-device.1* | |
304 | %exclude %{_mandir}/ja/man1/lxc-ls.1* | |
305 | %exclude %{_mandir}/ja/man1/lxc-start-ephemeral.1* | |
306 | %exclude %{_mandir}/ja/man1/lxc-top.1* | |
307 | ||
308 | ||
309 | %if %{without python} | |
310 | # legacy version | |
311 | %attr(755,root,root) %{_bindir}/lxc-ls | |
312 | %{_mandir}/man1/lxc-ls.1* | |
313 | %endif | |
314 | ||
315 | %dir %{configpath} | |
316 | %dir %{configpath}snap | |
317 | %dir %attr(750,root,root) /var/log/lxc | |
318 | %dir %attr(750,root,root) /var/cache/lxc | |
319 | ||
320 | %files devel | |
321 | %defattr(644,root,root,755) | |
322 | %attr(755,root,root) %{_libdir}/liblxc.so | |
323 | %{_includedir}/lxc | |
324 | %{_pkgconfigdir}/lxc.pc | |
325 | ||
326 | %if %{with lua} | |
327 | %files -n lua-lxc | |
328 | %defattr(644,root,root,755) | |
329 | %attr(755,root,root) %{_bindir}/lxc-top | |
330 | %dir %{_libdir}/lua/lxc | |
331 | %attr(755,root,root) %{_libdir}/lua/lxc/core.so | |
332 | %{_datadir}/lua/lxc.lua | |
333 | %{_mandir}/man1/lxc-top.1* | |
334 | %lang(ja) %{_mandir}/ja/man1/lxc-top.1* | |
335 | %endif | |
336 | ||
337 | %if %{with python} | |
338 | %files -n python3-lxc | |
339 | %defattr(644,root,root,755) | |
340 | %attr(755,root,root) %{_bindir}/lxc-device | |
341 | %attr(755,root,root) %{_bindir}/lxc-ls | |
342 | %attr(755,root,root) %{_bindir}/lxc-start-ephemeral | |
343 | %{py3_sitedir}/lxc | |
344 | %attr(755,root,root) %{py3_sitedir}/_lxc.cpython-*.so | |
345 | %{py3_sitedir}/_lxc-0.1-py*.egg-info | |
346 | %{_mandir}/man1/lxc-device.1* | |
347 | %{_mandir}/man1/lxc-ls.1* | |
348 | %{_mandir}/man1/lxc-start-ephemeral.1* | |
349 | %lang(ja) %{_mandir}/ja/man1/lxc-device.1* | |
350 | %lang(ja) %{_mandir}/ja/man1/lxc-ls.1* | |
351 | %lang(ja) %{_mandir}/ja/man1/lxc-start-ephemeral.1* | |
352 | %endif | |
353 | ||
354 | %files -n bash-completion-%{name} | |
355 | %defattr(644,root,root,755) | |
356 | /etc/bash_completion.d/lxc |