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