Add support for static vserver IDs (needed for putting pl_conf in a slice)
[util-vserver.git] / util-vserver.spec
1 %define name util-vserver
2 %define version 0.30
3 %define release 15.planetlab%{?date:.%{date}}
4
5 Vendor: PlanetLab
6 Packager: PlanetLab Central <support@planet-lab.org>
7 Distribution: PlanetLab 3.0
8 URL: http://cvs.planet-lab.org/cvs/util-vserver
9
10 Summary:        Linux virtual server utilities
11 Name:           %{name}
12 Version:        %{version}
13 Release:        %{release}
14 Epoch:          0
15 Copyright:      GPL
16 Group:          System Environment/Base
17 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
18 Provides:       %name-devel = %epoch:%version-%release
19 BuildRoot:      %_tmppath/%name-%version-%release-root
20 Provides:       vserver = %epoch:%version-%release
21 Conflicts:      vserver < %epoch:%version-%release
22 Conflicts:      vserver > %epoch:%version-%release
23 BuildRequires:  e2fsprogs-devel
24
25 %package linuxconf
26 Summary:        Linuxconf administration modules for vservers
27 Group:          Applications/System
28 Requires:       %name = %epoch:%version-%release
29 Provides:       vserver-admin = %epoch:%version-%release
30 Conflicts:      vserver-admin < %epoch:%version-%release
31 Conflicts:      vserver-admin > %epoch:%version-%release
32
33 %description
34 This package provides the components and a framework to setup virtual
35 servers.  A virtual server runs inside a linux server. It is nevertheless
36 highly independent. As such, you can run various services with normal
37 configuration. The various vservers can't interact with each other and
38 can't interact with services in the main server.
39
40 This requires a special kernel supporting the new new_s_context and
41 set_ipv4root system call.
42
43
44 %description linuxconf
45 This package provides the components to setup virtual servers with
46 linuxconf.
47
48
49 %prep
50 %setup -q
51 aclocal -I m4
52 autoconf
53 automake --add-missing
54 # bootstrap to avoid BuildRequires of kernel-source
55 for linux in $RPM_BUILD_DIR/linux-* /lib/modules/`uname -r`/build ; do
56    [[ -d $linux/include ]] && %configure --with-kerneldir=$linux --enable-linuxconf && break
57 done
58
59
60 %build
61 make
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 %__make DESTDIR=$RPM_BUILD_ROOT install
66
67 mkdir -p $RPM_BUILD_ROOT/vservers
68 test "%_initrddir" = %_sysconfdir/init.d || {
69         mkdir -p ${RPM_BUILD_ROOT}%_initrddir
70         mv ${RPM_BUILD_ROOT}%_sysconfdir/init.d/* ${RPM_BUILD_ROOT}%_initrddir/
71 }
72
73 mkdir -p ${RPM_BUILD_ROOT}/bin
74 ln -f ${RPM_BUILD_ROOT}%_sbindir/vsh ${RPM_BUILD_ROOT}/bin/vsh
75
76 install -D -m 644 sysv/vcached.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/vcached
77
78 mkdir -p $RPM_BUILD_ROOT/etc/cron.d
79 . sysv/vcached.conf
80 echo "*/$(($period / 60)) * * * * root %_sbindir/vcached -s -f -l $logfile" > $RPM_BUILD_ROOT/etc/cron.d/vcached
81
82 %__make -C python INSTALL_ROOT=$RPM_BUILD_ROOT install
83
84 %clean
85 rm -rf $RPM_BUILD_ROOT
86
87 %post
88 chkconfig --add vservers
89 chkconfig vservers on
90
91 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
92     echo /bin/vsh >> /etc/shells
93 fi
94
95 # make sure barrier bit is set on /vservers to prevent chroot() escapes
96 %_libdir/%name/setattr --barrier /vservers
97
98 %postun
99 # 0 = erase, 1 = upgrade
100 if [ "$1" = 0 ] ; then
101     perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
102 fi
103
104 %preun
105 # 0 = erase, 1 = upgrade
106 if [ $1 -eq 0 ] ; then
107     [ "$PL_BOOTCD" = "1" ] || service vservers stop
108     chkconfig vservers off
109     chkconfig --del vservers
110 fi
111
112 %files
113 %defattr(-,root,root)
114 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
115 %_sbindir/*
116 %_libdir/%name
117 %_includedir/vserver.h
118 %_libdir/libvserver.a
119 %_mandir/man8/*
120 %config %_initrddir/*
121 %config(noreplace) /etc/vservers.conf
122 %config(noreplace) /etc/vcached.conf
123 /etc/logrotate.d/vcached
124 /etc/cron.d/vcached
125 %dir /etc/vservers
126 %attr(0,root,root) %dir /vservers
127 %attr(4755,root,root) /usr/sbin/vsh
128 %attr(4755,root,root) /bin/vsh
129
130 %exclude %_sbindir/newvserver
131 %exclude %_mandir/man8/newvserver*
132
133 %files linuxconf
134 %defattr(-,root,root)
135 %config(noreplace) /etc/vservers/newvserver.defaults
136 %_sbindir/newvserver
137 %_mandir/man8/newvserver*
138
139
140
141 %package py23
142 Summary: Python modules for manipulating vservers
143 Group: Applications/System
144 Requires: python /usr/lib/util-vserver/util-vserver-vars util-python
145
146 %description py23
147 Python modules for manipulating vservers.  Provides a superset of the
148 functionality of the vserver script (at least will do in the future),
149 but more readily accessible from Python code.
150
151 %files py23
152 %defattr(0644,root,root)
153 /usr/lib/python2.3/site-packages/bwlimit.py
154 /usr/lib/python2.3/site-packages/bwlimit.pyc
155 /usr/lib/python2.3/site-packages/cpulimit.py
156 /usr/lib/python2.3/site-packages/cpulimit.pyc
157 /usr/lib/python2.3/site-packages/util_vserver_vars.py
158 /usr/lib/python2.3/site-packages/vduimpl.so
159 /usr/lib/python2.3/site-packages/vserver.py
160 /usr/lib/python2.3/site-packages/vserver.pyc
161 /usr/lib/python2.3/site-packages/vserverimpl.so
162
163
164
165 %changelog
166 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
167 - add support for static vserver IDs to vuseradd and vuserdel
168
169 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
170 - add bwlimit and cpulimit modules
171
172 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
173 - import Marc's vdu implementation
174
175 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
176 - 'vserver-init start' functionality subsumed by Node Manager
177
178 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
179 - Fixed vlimit command
180
181 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
182 - add Python modules for manipulating vservers
183
184 * Thu Apr  7 2005 Steve Muir <smuir@cs.princeton.edu>
185 - vuserdel changes: don't shutdown vserver, just kill all processes;
186   unmount all mountpoints in vserver before deleting
187
188 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
189 - vcached no longer runs as a daemon
190 - do not restart vservers when package is upgraded
191
192 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
193 + planetlab-3_0-rc4
194 - PL2445
195 - Both vcached and vuseradd now print a warning message when vbuild
196   succeeds but the resulting new vserver image is smaller in size than
197   the vserver-reference image.
198 - vuseradd: clean up some more junk on failure
199
200 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
201 + planetlab-3_0-rc3
202 - PL3026: This is the upgraded version of vdu that maintains an
203   internal hash table of files with a nlink count > 1.  Only if vdu
204   sees all hard links to a particular inode does it add its size and
205   block count to the total.
206
207 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
208 - PL2445 Use -b option to du to avoid rounding errors.
209
210 * Sat Nov  6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
211 + planetlab-3_0-rc2
212 - don't create the symbolic link /home/slice/.ssh, this is not how
213   pl_sshd works
214
215 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
216 - added vsh
217
218 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
219 - initial PlanetLab 3.0 build.
220
221 * Thu Mar 18 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.3-0
222 - removed '%%doc doc/FAQ.txt' since file does not exist anymore
223
224 * Fri Sep 26 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.4-1
225 - initial build.
226