source: projects/specs/trunk/l/lxc/lxc-vl.spec @ 9815

Revision 9815, 11.5 KB checked in by daisuke, 8 years ago (diff)

lxc: enable python3 support by default

Line 
1%{!?python3_sitearch: %define python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
2
3%global with_python3 1
4%global with_systemd 0
5
6%global luaver 5.1
7%global lualibdir %{_libdir}/lua/%{luaver}
8%global luapkgdir %{_datadir}/lua/%{luaver}
9
10Name:           lxc
11Version:        1.1.5
12Release:        2%{?_dist_release}
13Summary:        Linux Resource Containers
14Summary(ja):    Linux リソースコンテナ
15Group:          Applications/System
16License:        LGPLv2+ and GPLv2
17URL:            http://linuxcontainers.org
18
19Source0:        http://linuxcontainers.org/downloads/%{name}-%{version}.tar.gz
20Source10:       lxc-vinelinux
21Source11:       vinelinux.common.conf
22Source12:       vinelinux.userns.conf
23
24Patch0:         lxc-1.1.0-fix-init.patch
25Patch1:         lxc-1.1.5-disable-setproctitle-error.patch
26
27BuildRequires:  docbook-utils
28Buildrequires:  docbook2X
29Buildrequires:  doxygen
30BuildRequires:  kernel-headers
31BuildRequires:  libcap-devel
32BuildRequires:  libtool
33BuildRequires:  lua-devel
34BuildRequires:  perl-XML-SAX
35%if 0%{?with_python3}
36BuildRequires:  python3-devel >= 3.2
37%endif # with_python3
38%if 0%{?with_systemd}
39BuildRequires:  systemd
40%endif # with_systemd
41# for lxc-top
42Requires:       lua-%{name}%{?_isa} = %{version}-%{release}
43Requires:       lua-alt-getopt
44
45%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
46
47%description
48Linux Resource Containers provide process and resource isolation without the
49overhead of full virtualization.
50
51
52%package        libs
53Summary:        Runtime library files for %{name}
54Summary(ja):    %{name}のランタイムライブラリ
55Group:          System Environment/Libraries
56%if 0%{?with_systemd}
57Requires(post): systemd
58Requires(preun): systemd
59Requires(postun): systemd
60%else
61Requires(post): chkconfig
62Requires(preun): initscripts, chkconfig
63Requires(postun): initscripts
64%endif # with_systemd
65
66
67%description    libs
68Linux Resource Containers provide process and resource isolation without the
69overhead of full virtualization.
70
71The %{name}-libs package contains libraries for running %{name} applications.
72
73
74%if 0%{?with_python3}
75%package        -n python3-%{name}
76Summary:        Python binding for %{name}
77Summary(ja):    %{name} の Python バインディング
78Group:          System Environment/Libraries
79
80%description    -n python3-%{name}
81Linux Resource Containers provide process and resource isolation without the
82overhead of full virtualization.
83
84The python3-%{name} package contains the Python3 binding for %{name}.
85
86%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}_lxc\\..*\\.so
87
88
89%package        extra
90Summary:        Extra tools for %{name}
91Summary(ja):    %{name} の追加ツール
92Group:          Applications/System
93Requires:       python3-%{name} = %{version}-%{release}
94
95%description    extra
96Linux Resource Containers provide process and resource isolation without the
97overhead of full virtualization.
98
99This package contains tools needing the Python3 bindings.
100%endif # with_python3
101
102
103%package        -n lua-%{name}
104Summary:        Lua binding for %{name}
105Summary(ja):    %{name} の Lua バインディング
106Group:          System Environment/Libraries
107
108%description    -n lua-%{name}
109Linux Resource Containers provide process and resource isolation without the
110overhead of full virtualization.
111
112The lua-%{name} package contains the Lua binding for %{name}.
113
114%global __provides_exclude %{?__provides_exclude:%__provides_exclude|}core\\.so\\.0
115
116
117%package        templates
118Summary:        Templates for %{name}
119Summary(ja):    %{name} のテンプレート
120Group:          System Environment/Libraries
121Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
122# Note: Requirements for the template scripts (busybox, dpkg,
123# debootstrap, vbootstrap, rsync, openssh-server, dhclient, apt, pacman, zypper,
124# ubuntu-cloudimg-query etc...) are not explicitly mentioned here:
125# their presence varies wildly on supported Fedora/EPEL releases and
126# archs, and they are in most cases needed for a single template
127# only. Also, the templates normally fail graciously when such a tool
128# is missing. Moving each template to its own subpackage on the other
129# hand would be overkill.
130
131
132%description    templates
133Linux Resource Containers provide process and resource isolation without the
134overhead of full virtualization.
135
136The %{name}-templates package contains templates for creating containers.
137
138
139%package        devel
140Summary:        Development files for %{name}
141Summary(ja):    %{name}の開発ファイル
142Group:          Development/Libraries
143Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
144Requires:       pkgconfig
145
146%description    devel
147Linux Resource Containers provide process and resource isolation without the
148overhead of full virtualization.
149
150The %{name}-devel package contains libraries and header files for
151developing applications that use %{name}.
152
153
154%package        doc
155Summary:        Documentation for %{name}
156Summary(ja):    %{name} のドキュメント
157Group:          Documentation
158BuildArch:      noarch
159
160%description    doc
161This package contains documentation for %{name}.
162
163
164%prep
165%setup -q -n %{name}-%{version}
166%patch0 -p1
167%patch1 -p1
168
169
170%build
171%configure --with-distro=centos \
172           --enable-doc \
173           --enable-api-docs \
174           --disable-silent-rules \
175           --docdir=%{_pkgdocdir} \
176           --disable-rpath \
177           --disable-apparmor \
178           --disable-cgmanager \
179           --disable-selinux \
180           --enable-capabilities \
181           --enable-examples \
182           --enable-bash \
183           --enable-lua \
184%if 0%{?with_python3}
185           --enable-python \
186%endif # with_python3
187%if 0%{?with_systemd}
188           --with-init-script=systemd \
189%else
190           --with-init-script=sysvinit \
191%endif # with_systemd
192# intentionally blank line
193make %{?_smp_mflags}
194
195
196%install
197%{make_install}
198make DESTDIR=%{buildroot} install
199mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
200chmod -x %{buildroot}%{luapkgdir}/lxc.lua
201
202mkdir -p %{buildroot}%{_pkgdocdir}
203cp -a AUTHORS COPYING README %{buildroot}%{_pkgdocdir}
204mkdir -p %{buildroot}%{_pkgdocdir}/api
205cp -a doc/api/html/* %{buildroot}%{_pkgdocdir}/api/
206
207# cache dir
208mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
209
210rm -rf %{buildroot}%{_datadir}/lxc/selinux
211
212# install vinelinux template
213install -m775 %{SOURCE10} %{buildroot}%{_datadir}/lxc/templates/
214install -m775 %{SOURCE11} %{buildroot}%{_datadir}/lxc/config/
215install -m775 %{SOURCE12} %{buildroot}%{_datadir}/lxc/config/
216
217
218%check
219make check
220
221
222%post libs
223/sbin/ldconfig
224%if 0%{?with_systemd}
225%systemd_post %{name}.service
226%else
227/sbin/chkconfig --add %{name}
228%endif # with_systemd
229
230
231%preun libs
232%if 0%{?with_systemd}
233%systemd_preun %{name}.service
234%else
235if [ $1 -eq 0 ]; then
236        /sbin/service %{name} stop > /dev/null 2>&1
237        /sbin/chkconfig --del %{name}
238fi
239%endif # with_systemd
240
241
242%postun libs
243/sbin/ldconfig
244%if 0%{?with_systemd}
245%systemd_postun %{name}.service
246%else
247if [ $1 -ge 1 ]; then
248        /sbin/service %{name} condrestart > /dev/null 2>&1 || :
249fi
250%endif # with_systemd
251
252
253%files
254%{_bindir}/%{name}-*
255%{_mandir}/man1/%{name}*
256%{_mandir}/*/man1/%{name}*
257# in lxc-libs:
258%exclude %{_bindir}/%{name}-autostart
259%exclude %{_mandir}/man1/%{name}-autostart*
260%exclude %{_mandir}/*/man1/%{name}-autostart*
261%exclude %{_mandir}/man1/%{name}-user-nic*
262%exclude %{_mandir}/*/man1/%{name}-user-nic*
263%{_datadir}/%{name}/%{name}.functions
264%if 0%{?with_python3}
265%exclude %{_bindir}/%{name}-device
266%exclude %{_bindir}/%{name}-ls
267%exclude %{_bindir}/%{name}-start-ephemeral
268%exclude %{_mandir}/man1/%{name}-device*
269%exclude %{_mandir}/man1/%{name}-ls*
270%exclude %{_mandir}/man1/%{name}-start-ephemeral*
271%exclude %{_mandir}/*/man1/%{name}-device*
272%exclude %{_mandir}/*/man1/%{name}-ls*
273%exclude %{_mandir}/*/man1/%{name}-start-ephemeral*
274%endif
275%dir %{_sysconfdir}/bash_completion.d/
276%{_sysconfdir}/bash_completion.d/%{name}
277
278
279%files libs
280%dir %{_datadir}/%{name}
281%dir %{_datadir}/%{name}/templates
282%dir %{_datadir}/%{name}/config
283%{_datadir}/%{name}/hooks
284%{_datadir}/%{name}/%{name}-patch.py*
285%{_libdir}/liblxc.so.*
286%{_libdir}/%{name}
287%{_libexecdir}/%{name}
288# fixme: should be in libexecdir?
289%{_sbindir}/init.%{name}
290%{_bindir}/%{name}-autostart
291%{_sharedstatedir}/%{name}
292%dir %{_sysconfdir}/%{name}
293%config(noreplace) %{_sysconfdir}/%{name}/default.conf
294%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
295%{_mandir}/man1/%{name}-autostart*
296%{_mandir}/*/man1/%{name}-autostart*
297%{_mandir}/man1/%{name}-user-nic*
298%{_mandir}/*/man1/%{name}-user-nic*
299%{_mandir}/man5/%{name}*
300%{_mandir}/man7/%{name}*
301%{_mandir}/*/man5/%{name}*
302%{_mandir}/*/man7/%{name}*
303%dir %{_pkgdocdir}
304%{_pkgdocdir}/AUTHORS
305%{_pkgdocdir}/COPYING
306%{_pkgdocdir}/README
307%if 0%{?with_systemd}
308%{_unitdir}/%{name}.service
309%else
310%{_sysconfdir}/rc.d/init.d/%{name}
311%{_sysconfdir}/rc.d/init.d/%{name}-net
312%endif # with_systemd
313%dir %{_localstatedir}/cache/%{name}
314
315
316%if 0%{?with_python3}
317%files -n python3-%{name}
318%{python3_sitearch}/*
319
320
321%files extra
322%{_bindir}/%{name}-device
323%{_bindir}/%{name}-ls
324%{_bindir}/%{name}-start-ephemeral
325%{_mandir}/man1/%{name}-device*
326%{_mandir}/man1/%{name}-ls*
327%{_mandir}/man1/%{name}-start-ephemeral*
328%{_mandir}/*/man1/%{name}-device*
329%{_mandir}/*/man1/%{name}-ls*
330%{_mandir}/*/man1/%{name}-start-ephemeral*
331%endif # with_python3
332
333
334%files -n lua-%{name}
335%{lualibdir}/%{name}
336%{luapkgdir}/%{name}.lua
337
338
339%files templates
340%{_datadir}/%{name}/templates/lxc-*
341%{_datadir}/%{name}/config/*
342
343
344%files devel
345%{_libdir}/pkgconfig/%{name}.pc
346%{_includedir}/lxc
347%{_libdir}/liblxc.so
348
349
350%files doc
351%dir %{_pkgdocdir}
352# README, AUTHORS and COPYING intentionally duplicated because -doc
353# can be installed on its own.
354%{_pkgdocdir}/*
355
356
357%changelog
358* Tue Nov 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-2
359- enable python3 support by default
360
361* Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.5-1
362- update vinelinux template
363  - add vinelinux.{common,userns}.conf
364- add patch1 to disable setproctitle error message,
365  cherry picked from upstream git.
366
367* Sun Nov 15 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 1.1.4-1
368- update to 1.1.4-1
369- add vinelinux template
370
371* Wed Apr 10 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-3
372- add patch10 to not fail on failure to link kmsg
373
374* Wed Nov 21 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-2
375- update to 0.8.0 release
376
377* Fri May 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-1.20120525
378- update to git master
379
380* Wed Apr 25 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.8.0-0.rc1
381- new upstream release
382
383* Thu Jan 26 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.5-1.20120105
384- update to git current (20120105)
385
386* Mon Jun 06 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.2-1
387- update to 0.7.4.2
388
389* Thu Apr 28 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-2
390- include all templates
391
392* Wed Apr 27 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 0.7.4.1-1
393- initial build for Vine Linux
394
395* Fri Mar 25 2011 Silas Sewell <silas@sewell.ch> - 0.7.4.1-1
396- Update to 0.7.4.1
397
398* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-2
399- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
400
401* Mon Jul 26 2010 Silas Sewell <silas@sewell.ch> - 0.7.2-1
402- Update to 0.7.2
403- Remove templates
404
405* Tue Jul 06 2010 Silas Sewell <silas@sewell.ch> - 0.7.1-1
406- Update to 0.7.1
407
408* Wed Feb 17 2010 Silas Sewell <silas@sewell.ch> - 0.6.5-1
409- Update to latest release
410- Add /var/lib/lxc directory
411- Patch for sys/stat.h
412
413* Fri Nov 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.4-1
414- Update to latest release
415- Add documentation sub-package
416
417* Mon Jul 27 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-2
418- Apply patch for rawhide kernel
419
420* Sat Jul 25 2009 Silas Sewell <silas@sewell.ch> - 0.6.3-1
421- Initial package
Note: See TracBrowser for help on using the repository browser.