4 ## This package understands the following switches:
5 ## --without dietlibc ... disable usage of dietlibc
6 ## --with xalan ... require/use the xalan xslt processor
7 ## --without doc ... disable doc generation
8 ## --with legacy ... enable the legacy APIs
10 %global confdir %_sysconfdir/vservers
11 %global confdefaultdir %confdir/.defaults
12 %global pkglibdir %_libdir/%name
13 %global chkconfig /sbin/chkconfig
15 %global _localstatedir %_var
17 %define name util-vserver
18 %define version 0.30.214
21 %global ver %( echo %{version} | sed 's/-.*//' )
22 %global subver %( s=`echo %{version} | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
23 %global fullver %{version}
26 %{!?release_func:%global release_func() %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}}
28 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
30 %define _without_dietlibc 1
31 %define _without_xalan 1
33 # don't build debuginfo RPM
34 %define debug_package %{nil}
37 Packager: PlanetLab Central <support@planet-lab.org>
38 Distribution: PlanetLab %{plrelease}
39 URL: %(echo %{url} | cut -d ' ' -f 2)
41 Summary: Linux virtual server utilities
44 Release: %release_func 0%subver
46 Group: System Environment/Base
47 #URL: http://savannah.nongnu.org/projects/util-vserver/
48 Source0: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version.tar.bz2
49 #Source1: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version.tar.bz2.asc
50 BuildRoot: %_tmppath/%name-%version-%release-root
52 Requires: %name-core = %version-%release
53 Requires: %name-lib = %version-%release
54 Requires: diffutils mktemp sed
55 Provides: vserver = %version-%release
56 Obsoletes: vserver < %version
57 BuildRequires: mount vconfig gawk iproute iptables
58 BuildRequires: gcc-c++ wget which diffutils
59 BuildRequires: e2fsprogs-devel beecrypt-devel
60 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
61 Requires(post): %name-core
62 Requires(pre): %pkglibdir
63 Requires(postun): %pkglibdir
64 %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25}
65 %{?_with_xalan:BuildRequires: xalan-j}
68 Summary: Dynamic libraries for util-vserver
69 Group: System Environment/Libraries
72 Summary: The core-utilities for util-vserver
73 Group: Applications/System
77 Summary: Tools which can be used to build vservers
78 Group: Applications/System
79 Requires: rpm wget tar
80 Requires: %name = %version-%release
81 Requires(pre): %confdir
82 Requires(postun): %confdir
83 Requires(post): %name-core
86 Summary: SysV-initscripts for vserver
87 Group: System Environment/Base
88 Provides: init(%name) = sysv
89 Requires: make diffutils
91 Requires: %name = %version-%release
92 Requires(post): %chkconfig
93 Requires(preun): %chkconfig
94 Requires(pre): %_initrddir %pkglibdir
95 requires(postun): %_initrddir %pkglibdir
98 Summary: Legacy utilities for util-vserver
99 Group: Applications/System
100 Requires: %name = %version-%release
101 Requires(post): %chkconfig
102 Requires(preun): %chkconfig
103 Requires(pre): %_initrddir %pkglibdir
104 requires(postun): %_initrddir %pkglibdir
107 Summary: Header-files and libraries needed to develop vserver based applications
108 Group: Development/Libraries
110 Requires: %name-lib = %version-%release
113 Summary: Python modules for manipulating vservers
114 Group: Applications/System
116 Obsoletes: util-vserver-py23 resman
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.
126 This requires a special kernel supporting the new new_s_context and
127 set_ipv4root system call.
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.
136 This package contains the shared libraries needed by all other
137 'util-vserver' subpackages.
140 util-vserver provides the components and a framework to setup virtual
141 servers. A virtual server runs inside a linux server. It is nevertheless
142 highly independent. As such, you can run various services with normal
143 configuration. The various vservers can't interact with each other and
144 can't interact with services in the main server.
146 This package contains utilities which are required to communicate with
147 the Linux-Vserver enabled kernel.
151 util-vserver provides the components and a framework to setup virtual
152 servers. A virtual server runs inside a linux server. It is nevertheless
153 highly independent. As such, you can run various services with normal
154 configuration. The various vservers can't interact with each other and
155 can't interact with services in the main server.
157 This package contains utilities which assist in building Vservers.
160 util-vserver provides the components and a framework to setup virtual
161 servers. A virtual server runs inside a linux server. It is nevertheless
162 highly independent. As such, you can run various services with normal
163 configuration. The various vservers can't interact with each other and
164 can't interact with services in the main server.
166 This package contains the SysV initscripts which start and stop
167 VServers and related tools.
171 util-vserver provides the components and a framework to setup virtual
172 servers. A virtual server runs inside a linux server. It is nevertheless
173 highly independent. As such, you can run various services with normal
174 configuration. The various vservers can't interact with each other and
175 can't interact with services in the main server.
177 This package contains the tools which are needed to work with VServers
178 having an old-style configuration.
182 util-vserver provides the components and a framework to setup virtual
183 servers. A virtual server runs inside a linux server. It is nevertheless
184 highly independent. As such, you can run various services with normal
185 configuration. The various vservers can't interact with each other and
186 can't interact with services in the main server.
188 This package contains header files and libraries which are needed to
189 develop VServer related applications.
193 Python modules for manipulating vservers. Provides a superset of the
194 functionality of the vserver script (at least will do in the future),
195 but more readily accessible from Python code.
199 %setup -q -n %name-%fullver
203 automake --add-missing
206 %configure --with-initrddir=%_initrddir --enable-release \
207 %{?_without_dietlibc:--disable-dietlibc} \
208 %{!?_without_legacy:--enable-apis=NOLEGACY} \
209 --with-initscripts=sysv
211 %__make %{?_smp_mflags} all
212 %{!?_without_doc:%__make %{?_smp_mflags} doc}
215 rm -rf $RPM_BUILD_ROOT
216 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
218 rm -f $RPM_BUILD_ROOT/%_libdir/*.la $RPM_BUILD_ROOT%{python_sitearch}/*.{la,a}
220 MANIFEST_CONFIG='%config' \
221 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
222 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
224 # Generate file list for python package
225 find "%{buildroot}" -name '*.py' | { while read FILE; do
226 f="${FILE#%{buildroot}}"
228 # need to touch these files, as they are not produced on FC4 or below
233 done } > %name-python.list
241 rm -rf $RPM_BUILD_ROOT
245 test -d /vservers || mkdir -m0000 /vservers
246 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
248 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
249 f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
250 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers "$f"
252 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
256 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
258 # add /bin/vsh to list of secure shells
259 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
260 echo /bin/vsh >> /etc/shells
265 # 0 = erase, 1 = upgrade
266 if [ "$1" = 0 ] ; then
267 perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
271 %post lib -p /sbin/ldconfig
272 %postun lib -p /sbin/ldconfig
276 #%chkconfig --add vservers-default
277 #%chkconfig --add vprocunhide
278 # PlanetLab Node Manager takes care of starting and stopping VServers
279 %chkconfig --del vservers-default
280 %chkconfig --del util-vserver
281 # PlanetLab does not require /proc security
282 %chkconfig --del vprocunhide
283 # vip6-autod handles IPv6 auto-assignments
284 %chkconfig --add vip6-autod
288 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
290 #test "$1" != 0 || %chkconfig --del vprocunhide
291 #test "$1" != 0 || %chkconfig --del vservers-default
292 #test "$1" != 0 || %chkconfig --del util-vserver
293 test "$1" != 0 || %chkconfig --del vip6-autod
297 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
300 %triggerin build -- fedora-release, centos-release
307 test -r "$i" || continue
309 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
313 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
314 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
315 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
319 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
321 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
322 ln -s /vservers/.hash "$f"/00
324 %_sbindir/setattr --barrier /vservers/.hash || :
328 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
331 ## Temporary workaround to remove old v_* files; it will conflict
332 ## somehow with the -legacy package but can be fixed by reinstalling
334 ## TODO: remove me in the final .spec file
335 %define v_services httpd named portmap sendmail smb sshd xinetd gated
336 %triggerun sysv -- util-vserver-sysv < 0.30.198
337 for i in %v_services; do
338 %chkconfig --del v_$i || :
343 # PlanetLab Node Manager takes care of starting and stopping VServers
344 #%chkconfig --add rebootmgr
345 #%chkconfig --add vservers-legacy
347 # PlanetLab does not require these legacy services
348 #for i in %v_services; do
349 # %chkconfig --add v_$i
354 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
356 #test "$1" != 0 || for i in %v_services; do
357 # %chkconfig --del v_$i
360 #test "$1" != 0 || %chkconfig --del rebootmgr
361 #test "$1" != 0 || %chkconfig --del vservers-legacy
364 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
367 %files -f %name-base.list
368 %defattr(-,root,root,-)
369 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
370 %doc doc/*.html doc/*.css
374 %dir %confdefaultdir/apps
375 %dir %confdefaultdir/files
376 %dir %pkglibdir/defaults
377 %ghost %confdefaultdir/cachebase
378 %ghost %confdefaultdir/vdirbase
379 %ghost %confdefaultdir/run.rev
381 %dir %_localstatedir/cache/vservers
382 %dir %_localstatedir/run/vservers
383 %dir %_localstatedir/run/vservers.rev
384 %dir %_localstatedir/run/vshelper
387 %files lib -f %name-lib.list
388 %files sysv -f %name-sysv.list
391 %files core -f %name-core.list
392 %defattr(-,root,root,-)
396 %files build -f %name-build.list
397 %defattr(-,root,root,-)
398 %doc contrib/yum*.patch
399 %dir %confdir/.distributions
400 %dir %confdir/.distributions/*
401 %dir %confdir/.distributions/*/apt
402 %dir %confdir/.distributions/.common
403 %dir %confdir/.distributions/.common/pubkeys
404 %dir %confdefaultdir/apps/vunify
405 %dir %confdefaultdir/apps/vunify/hash
408 %files legacy -f %name-legacy.list
409 %defattr(-,root,root,-)
410 %dir %pkglibdir/legacy
413 %files devel -f %name-devel.list
414 %defattr(-,root,root,-)
415 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
416 %{!?_without_doc:%doc lib/apidoc/html}
419 %files python -f %name-python.list
421 %{_sbindir}/disklimit
422 %{python_sitearch}/vserverimpl.so
426 * Wed Oct 03 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
427 - build python code as part of the regular build process
429 * Mon Jul 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
432 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
434 - get rid of e2fsprogs requirement
436 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
437 - add --with legacy and --without doc switches
438 - add util-vserver initscript
440 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
441 - add support for setting guaranteed CPU share flag in rspec
443 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
444 - do not require 'xalan' anymore by default
445 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
446 - removed 'chattr' leftovers
447 - create the '/etc/vservers/.defaults/cachebase' symlink
448 - added /var/cache/vservers and the needed support
449 - set barrier attribute on /vservers/.pkg and /vservers/.hash
450 - added 'centos-release' to the list of packages in the copy-the-keys
452 - create '/vservers/.hash' and add initial configuration for it
454 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
455 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
456 for a context that didn't exist would cause an error (it should be a
459 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
460 - fix bugs in python/vserverimpl.c where exceptions were not raised when
461 they should be and thus occured later at unexpected times
462 - add support for stopping a vserver
464 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
465 - add support for removing resource limits e.g., when a slice is deleted
467 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
468 - fix file descriptor leak in vduimpl
469 - clean up handling of network parameters
470 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
472 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
473 - fix Python modules to handling scheduling parameters correctly
475 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
479 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
480 - raise exception about being over disk limit after setting usage values
482 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
483 - create common function to be used for entering a vserver and applying
486 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
487 - restore build of python modules
489 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
490 - upgrade to util-vserver-0.30.208
491 - forward-port vbuild and legacy support until we can find a suitable
493 - make vsh use new vc_create_context() call
495 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
496 - add support for static vserver IDs to vuseradd and vuserdel
498 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
499 - add bwlimit and cpulimit modules
501 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
504 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
506 - require the -lib subpackage by -devel
507 - copy GPG keys from /etc/pki/rpm-gpg/
509 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
510 - import Marc's vdu implementation
512 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
513 - 'vserver-init start' functionality subsumed by Node Manager
515 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
516 - Fixed vlimit command
518 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
519 - add Python modules for manipulating vservers
521 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
522 - added patches to make yum work in chroot environments
525 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
526 - vuserdel changes: don't shutdown vserver, just kill all processes;
527 unmount all mountpoints in vserver before deleting
529 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
530 - added some %%descriptions
531 - copy GPG keys from the system into the confdir
532 - buildrequire dietlibc-0.25
533 - BuildRequire beecrypt-devel
535 - use %%global instead of %%define
536 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
538 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
539 - updated BuildRequires:
540 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
541 - moved the v_* initscripts to legacy
542 - do not ship the /vservers directory itself; as it is immutable, the
543 extraction will fail else
545 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
546 - vcached no longer runs as a daemon
547 - do not restart vservers when package is upgraded
549 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
552 - Both vcached and vuseradd now print a warning message when vbuild
553 succeeds but the resulting new vserver image is smaller in size than
554 the vserver-reference image.
555 - vuseradd: clean up some more junk on failure
557 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
559 - PL3026: This is the upgraded version of vdu that maintains an
560 internal hash table of files with a nlink count > 1. Only if vdu
561 sees all hard links to a particular inode does it add its size and
562 block count to the total.
564 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
565 - PL2445 Use -b option to du to avoid rounding errors.
567 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
569 - don't create the symbolic link /home/slice/.ssh, this is not how
572 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
575 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
576 - documented switches for 'rpmbuild'
578 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
579 - initial PlanetLab 3.0 build.
581 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
582 - (re)added the MANIFEST_* variables which were lost some time ago;
583 this will preserve %%config files...
585 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
586 - use file-list for sysv scripts also
588 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
589 - added vprocunhide-service support
590 - added doxygen support
593 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0