Add missing file.
[util-vserver-pl.git] / util-vserver-pl.spec
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 mkdir %{buildroot}/bin
38 ln -s ..%{_sbindir}/vsh %{buildroot}/bin/vsh
39
40 rm -f %{buildroot}%{python_sitearch}/vserverimpl.a
41 rm -f %{buildroot}%{python_sitearch}/vserverimpl.la
42
43 # Generate file list for python package
44 find "%{buildroot}" -name '*.py' | { while read FILE; do
45         f="${FILE#%{buildroot}}"
46         echo "${f}"
47         # need to touch these files, as they are not produced on FC4 or below
48         touch ${FILE}c
49         touch ${FILE}o
50         echo %%ghost "${f}c"
51         echo %%ghost "${f}o"
52 done } > %name-python.list
53
54
55 %post
56 # add /bin/vsh to list of secure shells
57 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
58         echo /bin/vsh >> /etc/shells
59 fi
60
61
62 %postun
63 # 0 = erase, 1 = upgrade
64 if [ "$1" = 0 ] ; then
65         perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
66 fi
67
68
69 %clean
70 rm -fr %{buildroot}
71
72
73 %files -f %name-python.list
74 %defattr(-,root,root,-)
75 %{_sbindir}/bwlimit
76 %{_sbindir}/disklimit
77 %{_sbindir}/vuseradd
78 %{_sbindir}/vuserdel
79 %{python_sitearch}/vserverimpl.so
80
81 %{_sbindir}/vsh
82 /bin/vsh
83 %{_mandir}/man8/vsh.8*
84
85 %{_sbindir}/vip6-autod
86 %{_sysconfdir}/init.d/vip6-autod
87
88 %{_sbindir}/vcached
89 %{_sysconfdir}/cron.d/vcached.cron
90 %{_sysconfdir}/logrotate.d/vcached.logrotate
91
92
93 %changelog
94 * Fri Nov 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.1-1
95 - Initial release