Bump release number to reflect changes in vsh and vserverimpl
[util-vserver.git] / util-vserver.spec
1 # $Id: util-vserver.spec.in,v 1.49 2005/07/15 19:06:58 ensc Exp $
2
3 ## This package understands the following switches:
4 ## --without dietlibc        ...   disable usage of dietlibc
5 ## --without xalan           ...   do not require/use the xalan xslt processor
6
7 %global confdir         %_sysconfdir/vservers
8 %global confdefaultdir  %confdir/.defaults
9 %global pkglibdir       %_libdir/%name
10 %global __chattr        /usr/bin/chattr
11 %global chkconfig       /sbin/chkconfig
12
13 %global _localstatedir  %_var
14
15
16 %{!?release_func:%global release_func() %1%{?dist}}
17
18 %define name util-vserver
19 %define version 0.30.208
20 %define release 2.planetlab%{?date:.%{date}}
21
22 %define _without_dietlibc 1
23 %define _without_xalan 1
24
25 Vendor: PlanetLab
26 Packager: PlanetLab Central <support@planet-lab.org>
27 Distribution: PlanetLab 3.0
28 URL: http://cvs.planet-lab.org/cvs/util-vserver
29
30 Summary:        Linux virtual server utilities
31 Name:           util-vserver
32 Version:        0.30.208
33 Release:        %{release}
34 License:        GPL
35 Group:          System Environment/Base
36 #URL:           http://savannah.nongnu.org/projects/util-vserver/
37 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
38 BuildRoot:      %_tmppath/%name-%version-%release-root
39 Requires:       init(%name)
40 Requires:       %name-core = %version-%release
41 Requires:       %name-lib  = %version-%release
42 Requires:       diffutils mktemp sed
43 Provides:       vserver = %version-%release
44 Obsoletes:      vserver < %version
45 BuildRequires:  mount vconfig gawk iproute iptables
46 BuildRequires:  gcc-c++ wget which diffutils
47 BuildRequires:  e2fsprogs-devel beecrypt-devel
48 BuildRequires:  doxygen tetex-latex
49 Requires(pre):          %pkglibdir
50 Requires(postun):       %pkglibdir
51 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
52 %{!?_without_xalan:BuildRequires:       xalan-j}
53
54 %package lib
55 Summary:                Dynamic libraries for util-vserver
56 Group:                  System Environment/Libraries
57
58 %package core
59 Summary:                The core-utilities for util-vserver
60 Group:                  Applications/System
61 Requires:               util-linux
62
63 %package build
64 Summary:                Tools which can be used to build vservers
65 Group:                  Applications/System
66 Requires:               rpm wget binutils tar e2fsprogs
67 Requires:               %name = %version-%release
68 Requires(pre):          %confdir
69 Requires(postun):       %confdir
70
71 %ifarch %ix86
72 Requires:               apt
73 %endif
74
75 %package sysv
76 Summary:                SysV-initscripts for vserver
77 Group:                  System Environment/Base
78 Provides:               init(%name) = sysv
79 Requires:               make diffutils
80 Requires:               initscripts
81 Requires:               %name = %version-%release
82 Requires(post):         %chkconfig
83 Requires(preun):        %chkconfig
84 Requires(pre):          %_initrddir %pkglibdir
85 requires(postun):       %_initrddir %pkglibdir
86
87 %package legacy
88 Summary:                Legacy utilities for util-vserver
89 Group:                  Applications/System
90 Requires:               %name = %version-%release
91 Requires(post):         %chkconfig
92 Requires(preun):        %chkconfig
93 Requires(pre):          %_initrddir %pkglibdir
94 requires(postun):       %_initrddir %pkglibdir
95
96 %package devel
97 Summary:                Header-files and libraries needed to develop vserver based applications
98 Group:                  Development/Libraries
99 Requires:               pkgconfig
100 Requires:               %name-lib = %version-%release
101
102 %package python
103 Summary:                Python modules for manipulating vservers
104 Group:                  Applications/System
105 Requires:               python util-python
106 Obsoletes:              util-vserver-py23
107
108
109 %description
110 util-vserver provides the components and a framework to setup virtual
111 servers.  A virtual server runs inside a linux server. It is nevertheless
112 highly independent. As such, you can run various services with normal
113 configuration. The various vservers can't interact with each other and
114 can't interact with services in the main server.
115
116 This requires a special kernel supporting the new new_s_context and
117 set_ipv4root system call.
118
119 %description lib
120 util-vserver provides the components and a framework to setup virtual
121 servers.  A virtual server runs inside a linux server. It is nevertheless
122 highly independent. As such, you can run various services with normal
123 configuration. The various vservers can't interact with each other and
124 can't interact with services in the main server.
125
126 This package contains the shared libraries needed by all other
127 'util-vserver' subpackages.
128
129 %description core
130 util-vserver provides the components and a framework to setup virtual
131 servers.  A virtual server runs inside a linux server. It is nevertheless
132 highly independent. As such, you can run various services with normal
133 configuration. The various vservers can't interact with each other and
134 can't interact with services in the main server.
135
136 This package contains utilities which are required to communicate with
137 the Linux-Vserver enabled kernel.
138
139
140 %description build
141 util-vserver provides the components and a framework to setup virtual
142 servers.  A virtual server runs inside a linux server. It is nevertheless
143 highly independent. As such, you can run various services with normal
144 configuration. The various vservers can't interact with each other and
145 can't interact with services in the main server.
146
147 This package contains utilities which assist in building Vservers.
148
149 %description sysv
150 util-vserver provides the components and a framework to setup virtual
151 servers.  A virtual server runs inside a linux server. It is nevertheless
152 highly independent. As such, you can run various services with normal
153 configuration. The various vservers can't interact with each other and
154 can't interact with services in the main server.
155
156 This package contains the SysV initscripts which start and stop
157 VServers and related tools.
158
159
160 %description legacy
161 util-vserver provides the components and a framework to setup virtual
162 servers.  A virtual server runs inside a linux server. It is nevertheless
163 highly independent. As such, you can run various services with normal
164 configuration. The various vservers can't interact with each other and
165 can't interact with services in the main server.
166
167 This package contains the tools which are needed to work with VServers
168 having an old-style configuration.
169
170
171 %description devel
172 util-vserver provides the components and a framework to setup virtual
173 servers.  A virtual server runs inside a linux server. It is nevertheless
174 highly independent. As such, you can run various services with normal
175 configuration. The various vservers can't interact with each other and
176 can't interact with services in the main server.
177
178 This package contains header files and libraries which are needed to
179 develop VServer related applications.
180
181
182 %description python
183 Python modules for manipulating vservers.  Provides a superset of the
184 functionality of the vserver script (at least will do in the future),
185 but more readily accessible from Python code.
186
187
188 %prep
189 %setup -q
190
191 aclocal -I m4
192 autoconf
193 automake --add-missing
194
195 %build
196 %configure --with-initrddir=%_initrddir --enable-release \
197            %{?_without_dietlibc:--disable-dietlibc}
198
199 %__make %{?_smp_mflags} all
200 %__make %{?_smp_mflags} doc
201
202 %__make -C python
203
204 %install
205 rm -rf $RPM_BUILD_ROOT
206 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
207
208 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
209
210 MANIFEST_CONFIG='%config' \
211 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
212 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
213
214 # install python bindings
215 %__make -C python DESTDIR="$RPM_BUILD_ROOT" install
216
217
218 %check || :
219 #%__make check
220
221
222 %clean
223 rm -rf $RPM_BUILD_ROOT
224
225
226 %post
227 test -d /vservers      || mkdir -m0000 /vservers
228 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
229
230 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
231 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
232
233 %_sbindir/setattr --barrier /vservers || :
234
235 # add /bin/vsh to list of secure shells
236 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
237     echo /bin/vsh >> /etc/shells
238 fi
239
240
241 %postun
242 # 0 = erase, 1 = upgrade
243 if [ "$1" = 0 ] ; then
244     perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
245 fi
246
247
248 %post   lib -p /sbin/ldconfig
249 %postun lib -p /sbin/ldconfig
250
251
252 %post sysv
253 #%chkconfig --add vservers-default
254 #%chkconfig --add vprocunhide
255 # PlanetLab Node Manager takes care of starting and stopping VServers
256 %chkconfig --del vservers-default
257 # PlanetLab does not require /proc security
258 %chkconfig --del vprocunhide
259
260 %preun sysv
261 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
262
263 #test "$1" != 0 || %chkconfig --del vprocunhide
264 #test "$1" != 0 || %chkconfig --del vservers-default
265
266
267 %postun sysv
268 #test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
269
270
271 %triggerin build -- fedora-release
272 function copy()
273 {
274     base=$1
275     shift
276
277     for i; do
278         test -r "$i" || continue
279
280         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
281         cp -a "$i" "$target"
282     done
283 }
284 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
285 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
286
287
288 %preun build
289 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
290
291
292 ## Temporary workaround to remove old v_* files; it will conflict
293 ## somehow with the -legacy package but can be fixed by reinstalling
294 ## this package.
295 ## TODO: remove me in the final .spec file
296 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
297 %triggerun sysv -- util-vserver-sysv < 0.30.198
298 for i in %v_services; do
299         %chkconfig --del v_$i || :
300 done
301
302
303 %post legacy
304 # PlanetLab Node Manager takes care of starting and stopping VServers
305 #%chkconfig --add rebootmgr
306 #%chkconfig --add vservers-legacy
307
308 # PlanetLab does not require these legacy services
309 #for i in %v_services; do
310 #       %chkconfig --add v_$i
311 #done
312
313
314 %preun legacy
315 #test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
316
317 #test "$1" != 0 || for i in %v_services; do
318 #       %chkconfig --del v_$i
319 #done
320
321 #test "$1" != 0 || %chkconfig --del rebootmgr
322 #test "$1" != 0 || %chkconfig --del vservers-legacy
323
324 %postun legacy
325 #test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
326
327
328 %files -f %name-base.list
329 %defattr(-,root,root,-)
330 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
331 %doc doc/*.html doc/*.css
332 /sbin/vshelper
333 %dir %confdir
334 %dir %confdefaultdir
335 %dir %confdefaultdir/apps
336 %dir %confdefaultdir/files
337 %dir %pkglibdir/defaults
338 %ghost %confdefaultdir/vdirbase
339 %ghost %confdefaultdir/run.rev
340
341 %dir %_localstatedir/run/vservers
342 %dir %_localstatedir/run/vservers.rev
343 %dir %_localstatedir/run/vshelper
344
345
346 %files lib -f %name-lib.list
347 %files sysv -f %name-sysv.list
348
349
350 %files core -f %name-core.list
351 %defattr(-,root,root,-)
352 %dir %pkglibdir
353
354
355 %files build -f %name-build.list
356 %defattr(-,root,root,-)
357 %doc contrib/yum*.patch
358 %dir %confdir/.distributions
359 %dir %confdir/.distributions/*
360 %dir %confdir/.distributions/*/apt
361 %dir %confdir/.distributions/.common
362 %dir %confdir/.distributions/.common/pubkeys
363 %dir %confdefaultdir/apps/vunify
364 %dir %confdefaultdir/apps/vunify/hash
365
366
367 %files legacy -f %name-legacy.list
368 %defattr(-,root,root,-)
369 %dir %pkglibdir/legacy
370
371
372 %files devel -f %name-devel.list
373 %defattr(-,root,root,-)
374 %doc lib/apidoc/latex/refman.pdf
375 %doc lib/apidoc/html
376
377
378 %files python
379 %defattr(0644,root,root)
380 %_libdir/python2.3/site-packages/*
381
382
383 %changelog
384 * Fri Oct  7 2005 Steve Muir <smuir@cs.princeton.edu>
385 - create common function to be used for entering a vserver and applying
386   resource limits
387
388 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
389 - restore build of python modules
390
391 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
392 - upgrade to util-vserver-0.30.208
393 - forward-port vbuild and legacy support until we can find a suitable
394   replacement
395 - make vsh use new vc_create_context() call
396
397 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
398 - add support for static vserver IDs to vuseradd and vuserdel
399
400 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
401 - add bwlimit and cpulimit modules
402
403 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
404 - require the -lib subpackage by -devel
405 - copy GPG keys from /etc/pki/rpm-gpg/
406
407 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
408 - import Marc's vdu implementation
409
410 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
411 - 'vserver-init start' functionality subsumed by Node Manager
412
413 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
414 - Fixed vlimit command
415
416 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
417 - add Python modules for manipulating vservers
418
419 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
420 - added patches to make yum work in chroot environments
421 - version 0.30.206
422
423 * Thu Apr  7 2005 Steve Muir <smuir@cs.princeton.edu>
424 - vuserdel changes: don't shutdown vserver, just kill all processes;
425   unmount all mountpoints in vserver before deleting
426
427 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
428 - added some %%descriptions
429 - copy GPG keys from the system into the confdir
430 - buildrequire dietlibc-0.25
431 - BuildRequire beecrypt-devel
432 - cleanups
433 - use %%global instead of %%define
434 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
435
436 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
437 - updated BuildRequires:
438 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
439 - moved the v_* initscripts to legacy
440 - do not ship the /vservers directory itself; as it is immutable, the
441   extraction will fail else
442
443 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
444 - vcached no longer runs as a daemon
445 - do not restart vservers when package is upgraded
446
447 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
448 + planetlab-3_0-rc4
449 - PL2445
450 - Both vcached and vuseradd now print a warning message when vbuild
451   succeeds but the resulting new vserver image is smaller in size than
452   the vserver-reference image.
453 - vuseradd: clean up some more junk on failure
454
455 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
456 + planetlab-3_0-rc3
457 - PL3026: This is the upgraded version of vdu that maintains an
458   internal hash table of files with a nlink count > 1.  Only if vdu
459   sees all hard links to a particular inode does it add its size and
460   block count to the total.
461
462 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
463 - PL2445 Use -b option to du to avoid rounding errors.
464
465 * Sat Nov  6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
466 + planetlab-3_0-rc2
467 - don't create the symbolic link /home/slice/.ssh, this is not how
468   pl_sshd works
469
470 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
471 - added vsh
472
473 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
474 - documented switches for 'rpmbuild'
475
476 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
477 - initial PlanetLab 3.0 build.
478
479 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
480 - (re)added the MANIFEST_* variables which were lost some time ago;
481   this will preserve %%config files...
482
483 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
484 - use file-list for sysv scripts also
485
486 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
487 - added vprocunhide-service support
488 - added doxygen support
489 - updated Requires:
490
491 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
492 - Initial build.