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
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
13 %global _localstatedir %_var
16 %{!?release_func:%global release_func() %1%{?dist}}
18 %define name util-vserver
19 %define version 0.30.208
20 %define release 17%{?pldistro:.%{pldistro}}%{?date:.%{date}}
22 %define _without_dietlibc 1
23 %define _without_xalan 1
25 # don't build debuginfo RPM
26 %define debug_package %{nil}
29 Packager: PlanetLab Central <support@planet-lab.org>
30 Distribution: PlanetLab 3.0
31 URL: http://cvs.planet-lab.org/cvs/util-vserver
33 Summary: Linux virtual server utilities
38 Group: System Environment/Base
39 #URL: http://savannah.nongnu.org/projects/util-vserver/
40 Source0: http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
41 BuildRoot: %_tmppath/%name-%version-%release-root
43 Requires: %name-core = %version-%release
44 Requires: %name-lib = %version-%release
45 Requires: diffutils mktemp sed
46 Provides: vserver = %version-%release
47 Obsoletes: vserver < %version
48 BuildRequires: mount vconfig gawk iproute iptables
49 BuildRequires: gcc-c++ wget which diffutils
50 BuildRequires: e2fsprogs-devel beecrypt-devel
51 BuildRequires: doxygen tetex-latex
52 Requires(pre): %pkglibdir
53 Requires(postun): %pkglibdir
54 %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25}
55 %{!?_without_xalan:BuildRequires: xalan-j}
58 Summary: Dynamic libraries for util-vserver
59 Group: System Environment/Libraries
62 Summary: The core-utilities for util-vserver
63 Group: Applications/System
67 Summary: Tools which can be used to build vservers
68 Group: Applications/System
69 Requires: rpm wget binutils tar e2fsprogs
70 Requires: %name = %version-%release
71 Requires(pre): %confdir
72 Requires(postun): %confdir
75 Summary: SysV-initscripts for vserver
76 Group: System Environment/Base
77 Provides: init(%name) = sysv
78 Requires: make diffutils
80 Requires: %name = %version-%release
81 Requires(post): %chkconfig
82 Requires(preun): %chkconfig
83 Requires(pre): %_initrddir %pkglibdir
84 requires(postun): %_initrddir %pkglibdir
87 Summary: Legacy utilities for util-vserver
88 Group: Applications/System
89 Requires: %name = %version-%release
90 Requires(post): %chkconfig
91 Requires(preun): %chkconfig
92 Requires(pre): %_initrddir %pkglibdir
93 requires(postun): %_initrddir %pkglibdir
96 Summary: Header-files and libraries needed to develop vserver based applications
97 Group: Development/Libraries
99 Requires: %name-lib = %version-%release
102 Summary: Python modules for manipulating vservers
103 Group: Applications/System
104 Requires: python util-python
105 Obsoletes: util-vserver-py23 resman
109 util-vserver provides the components and a framework to setup virtual
110 servers. A virtual server runs inside a linux server. It is nevertheless
111 highly independent. As such, you can run various services with normal
112 configuration. The various vservers can't interact with each other and
113 can't interact with services in the main server.
115 This requires a special kernel supporting the new new_s_context and
116 set_ipv4root system call.
119 util-vserver provides the components and a framework to setup virtual
120 servers. A virtual server runs inside a linux server. It is nevertheless
121 highly independent. As such, you can run various services with normal
122 configuration. The various vservers can't interact with each other and
123 can't interact with services in the main server.
125 This package contains the shared libraries needed by all other
126 'util-vserver' subpackages.
129 util-vserver provides the components and a framework to setup virtual
130 servers. A virtual server runs inside a linux server. It is nevertheless
131 highly independent. As such, you can run various services with normal
132 configuration. The various vservers can't interact with each other and
133 can't interact with services in the main server.
135 This package contains utilities which are required to communicate with
136 the Linux-Vserver enabled kernel.
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 assist in building Vservers.
149 util-vserver provides the components and a framework to setup virtual
150 servers. A virtual server runs inside a linux server. It is nevertheless
151 highly independent. As such, you can run various services with normal
152 configuration. The various vservers can't interact with each other and
153 can't interact with services in the main server.
155 This package contains the SysV initscripts which start and stop
156 VServers and related tools.
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 tools which are needed to work with VServers
167 having an old-style configuration.
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 header files and libraries which are needed to
178 develop VServer related applications.
182 Python modules for manipulating vservers. Provides a superset of the
183 functionality of the vserver script (at least will do in the future),
184 but more readily accessible from Python code.
192 automake --add-missing
195 %configure --with-initrddir=%_initrddir --enable-release \
196 %{?_without_dietlibc:--disable-dietlibc}
198 %__make %{?_smp_mflags} all
199 %__make %{?_smp_mflags} doc
204 rm -rf $RPM_BUILD_ROOT
205 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
207 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
209 MANIFEST_CONFIG='%config' \
210 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
211 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
213 # install python bindings
214 %__make -C python DESTDIR="$PWD/tmp" install
215 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
216 install tmp/usr/lib/python*/site-packages/*.{py,so} $RPM_BUILD_ROOT/%{_datadir}/%{name}/
217 install -D -m 755 python/bwlimit $RPM_BUILD_ROOT/%{_sbindir}/bwlimit
218 install -D -m 755 python/disklimit $RPM_BUILD_ROOT/%{_sbindir}/disklimit
226 rm -rf $RPM_BUILD_ROOT
230 test -d /vservers || mkdir -m0000 /vservers
231 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
233 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
234 f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
236 %_sbindir/setattr --barrier /vservers || :
238 # add /bin/vsh to list of secure shells
239 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
240 echo /bin/vsh >> /etc/shells
245 # 0 = erase, 1 = upgrade
246 if [ "$1" = 0 ] ; then
247 perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
251 %post lib -p /sbin/ldconfig
252 %postun lib -p /sbin/ldconfig
256 #%chkconfig --add vservers-default
257 #%chkconfig --add vprocunhide
258 # PlanetLab Node Manager takes care of starting and stopping VServers
259 %chkconfig --del vservers-default
260 # PlanetLab does not require /proc security
261 %chkconfig --del vprocunhide
264 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
266 #test "$1" != 0 || %chkconfig --del vprocunhide
267 #test "$1" != 0 || %chkconfig --del vservers-default
271 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
274 %triggerin build -- fedora-release
281 test -r "$i" || continue
283 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
287 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
288 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
292 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
295 ## Temporary workaround to remove old v_* files; it will conflict
296 ## somehow with the -legacy package but can be fixed by reinstalling
298 ## TODO: remove me in the final .spec file
299 %define v_services httpd named portmap sendmail smb sshd xinetd gated
300 %triggerun sysv -- util-vserver-sysv < 0.30.198
301 for i in %v_services; do
302 %chkconfig --del v_$i || :
307 # PlanetLab Node Manager takes care of starting and stopping VServers
308 #%chkconfig --add rebootmgr
309 #%chkconfig --add vservers-legacy
311 # PlanetLab does not require these legacy services
312 #for i in %v_services; do
313 # %chkconfig --add v_$i
318 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
320 #test "$1" != 0 || for i in %v_services; do
321 # %chkconfig --del v_$i
324 #test "$1" != 0 || %chkconfig --del rebootmgr
325 #test "$1" != 0 || %chkconfig --del vservers-legacy
328 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
331 %files -f %name-base.list
332 %defattr(-,root,root,-)
333 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
334 %doc doc/*.html doc/*.css
338 %dir %confdefaultdir/apps
339 %dir %confdefaultdir/files
340 %dir %pkglibdir/defaults
341 %ghost %confdefaultdir/vdirbase
342 %ghost %confdefaultdir/run.rev
344 %dir %_localstatedir/run/vservers
345 %dir %_localstatedir/run/vservers.rev
346 %dir %_localstatedir/run/vshelper
349 %files lib -f %name-lib.list
350 %files sysv -f %name-sysv.list
353 %files core -f %name-core.list
354 %defattr(-,root,root,-)
358 %files build -f %name-build.list
359 %defattr(-,root,root,-)
360 %doc contrib/yum*.patch
361 %dir %confdir/.distributions
362 %dir %confdir/.distributions/*
363 %dir %confdir/.distributions/*/apt
364 %dir %confdir/.distributions/.common
365 %dir %confdir/.distributions/.common/pubkeys
366 %dir %confdefaultdir/apps/vunify
367 %dir %confdefaultdir/apps/vunify/hash
370 %files legacy -f %name-legacy.list
371 %defattr(-,root,root,-)
372 %dir %pkglibdir/legacy
375 %files devel -f %name-devel.list
376 %defattr(-,root,root,-)
377 %doc lib/apidoc/latex/refman.pdf
382 pushd %{_datadir}/%{name} >/dev/null
384 # Byte compile and install modules
386 for file in *.py ; do
387 if [ -n "$py_modules" ] ; then
388 py_modules="$py_modules,"
390 py_modules="$py_modules '${file%*.py}'"
392 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
396 # Install the prebuilt extensions by hand
397 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
398 install -D -m 755 *.so "$python_sitelib"/
403 %triggerpostun python -- util-vserver-python, util-vserver-py23
404 # RPMs get upgraded by installing the new one, then uninstalling the
405 # old one. Since we no longer own the byte-compiled modules, they may
406 # be removed right after we create them in %post if we are upgraded
407 # from a version that did own them at one point. This section should
408 # be removed once all packages have been upgraded to at least this
410 pushd %{_datadir}/%{name} >/dev/null
412 # Byte compile and install modules
414 for file in *.py ; do
415 if [ -n "$py_modules" ] ; then
416 py_modules="$py_modules,"
418 py_modules="$py_modules '${file%*.py}'"
420 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
424 # Install the prebuilt extensions by hand
425 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
426 install -D -m 755 *.so "$python_sitelib"/
432 # 0 = erase, 1 = upgrade
433 if [ $1 -eq 0 ] ; then
434 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
435 pushd %{_datadir}/%{name} >/dev/null
436 for file in *.py *.so ; do
437 rm -f "$python_sitelib"/${file}*
446 %{_sbindir}/disklimit
450 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
451 - add support for setting guaranteed CPU share flag in rspec
453 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
454 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
455 for a context that didn't exist would cause an error (it should be a
458 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
459 - fix bugs in python/vserverimpl.c where exceptions were not raised when
460 they should be and thus occured later at unexpected times
461 - add support for stopping a vserver
463 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
464 - add support for removing resource limits e.g., when a slice is deleted
466 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
467 - fix file descriptor leak in vduimpl
468 - clean up handling of network parameters
469 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
471 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
472 - fix Python modules to handling scheduling parameters correctly
474 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
475 - raise exception about being over disk limit after setting usage values
477 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
478 - create common function to be used for entering a vserver and applying
481 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
482 - restore build of python modules
484 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
485 - upgrade to util-vserver-0.30.208
486 - forward-port vbuild and legacy support until we can find a suitable
488 - make vsh use new vc_create_context() call
490 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
491 - add support for static vserver IDs to vuseradd and vuserdel
493 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
494 - add bwlimit and cpulimit modules
496 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
497 - require the -lib subpackage by -devel
498 - copy GPG keys from /etc/pki/rpm-gpg/
500 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
501 - import Marc's vdu implementation
503 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
504 - 'vserver-init start' functionality subsumed by Node Manager
506 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
507 - Fixed vlimit command
509 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
510 - add Python modules for manipulating vservers
512 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
513 - added patches to make yum work in chroot environments
516 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
517 - vuserdel changes: don't shutdown vserver, just kill all processes;
518 unmount all mountpoints in vserver before deleting
520 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
521 - added some %%descriptions
522 - copy GPG keys from the system into the confdir
523 - buildrequire dietlibc-0.25
524 - BuildRequire beecrypt-devel
526 - use %%global instead of %%define
527 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
529 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
530 - updated BuildRequires:
531 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
532 - moved the v_* initscripts to legacy
533 - do not ship the /vservers directory itself; as it is immutable, the
534 extraction will fail else
536 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
537 - vcached no longer runs as a daemon
538 - do not restart vservers when package is upgraded
540 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
543 - Both vcached and vuseradd now print a warning message when vbuild
544 succeeds but the resulting new vserver image is smaller in size than
545 the vserver-reference image.
546 - vuseradd: clean up some more junk on failure
548 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
550 - PL3026: This is the upgraded version of vdu that maintains an
551 internal hash table of files with a nlink count > 1. Only if vdu
552 sees all hard links to a particular inode does it add its size and
553 block count to the total.
555 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
556 - PL2445 Use -b option to du to avoid rounding errors.
558 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
560 - don't create the symbolic link /home/slice/.ssh, this is not how
563 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
566 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
567 - documented switches for 'rpmbuild'
569 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
570 - initial PlanetLab 3.0 build.
572 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
573 - (re)added the MANIFEST_* variables which were lost some time ago;
574 this will preserve %%config files...
576 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
577 - use file-list for sysv scripts also
579 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
580 - added vprocunhide-service support
581 - added doxygen support
584 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0