ee196cd5f1eea151359c16faafff225d348583e4
[util-vserver-pl.git] / util-vserver-pl.spec.in
1 %define name    util-vserver-pl
2 %define version 0.1
3 %define release 1%{?pldistro:.%{pldistro}}%{?date:.%{date}}
4
5 %define python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
6
7 Summary: PlanetLab extensions to util-vserver
8 Name: %{name}
9 Version: %{version}
10 Release: %{release}
11 License: GPL
12 Group: System Environment/Base
13 Source0: %{name}-%{version}.tar.bz2
14 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
15 Requires: util-vserver util-vserver-core util-vserver-build util-vserver-sysv
16 Obsoletes: util-vserver-py32 resman util-vserver-python
17 BuildRequires: util-vserver-core util-vserver-devel
18 BuildRequires: autoconf automake libtool
19
20 %description
21 This package contains all PlanetLab extensions to util-vserver.
22
23 %prep
24 %setup -q
25 autoreconf -fi
26
27
28 %build
29 %configure
30 make
31
32
33 %install
34 rm -fr %{buildroot}
35 make DESTDIR=%{buildroot} install
36
37 ln -s ..%{_sbindir}/vsh %{buildroot}/bin/vsh
38
39 rm -f %{buildroot}%{python_sitearch}/vserverimpl.a
40 rm -f %{buildroot}%{python_sitearch}/vserverimpl.la
41
42 # Generate file list for python package
43 find "%{buildroot}" -name '*.py' | { while read FILE; do
44         f="${FILE#%{buildroot}}"
45         echo "${f}"
46         # need to touch these files, as they are not produced on FC4 or below
47         touch ${FILE}c
48         touch ${FILE}o
49         echo %%ghost "${f}c"
50         echo %%ghost "${f}o"
51 done } > %name-python.list
52
53
54 %post
55 # add /bin/vsh to list of secure shells
56 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
57         echo /bin/vsh >> /etc/shells
58 fi
59
60
61 %postun
62 # 0 = erase, 1 = upgrade
63 if [ "$1" = 0 ] ; then
64         perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
65 fi
66
67
68 %clean
69 rm -fr %{buildroot}
70
71
72 %files -f %name-python.list
73 %defattr(-,root,root,-)
74 %{_sbindir}/bwlimit
75 %{_sbindir}/disklimit
76 %{_sbindir}/vuseradd
77 %{_sbindir}/vuserdel
78
79 %{_sbindir}/vsh
80 /bin/vsh
81 %{_mandir}/man8/vsh.8*
82
83 %{_sbindir}/vip6-autod
84 %{_sysconfdir}/init.d/vip6-autod
85
86 %{_sbindir}/vcached
87 %{_sysconfdir}/cron.d/vcached.cron
88 %{_sysconfdir}/logrotate.d/vcached.logorate
89
90
91 %changelog
92 * Fri Nov 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.1-1
93 - Initial release