1 # $Id: util-vserver.spec.in 2283 2006-09-10 17:07:57Z hollow $
3 ## This package understands the following switches:
4 ## --without dietlibc ... disable usage of dietlibc
5 ## --with xalan ... require/use the xalan xslt processor
7 %global confdir %_sysconfdir/vservers
8 %global confdefaultdir %confdir/.defaults
9 %global pkglibdir %_libdir/%name
10 %global chkconfig /sbin/chkconfig
12 %global _localstatedir %_var
15 %{!?release_func:%global release_func() %1%{?dist}}
17 %define name @PACKAGE@
18 %define version @VERSION@
19 %define release 15%{?pldistro:.%{pldistro}}%{?date:.%{date}}
21 %define _without_dietlibc 1
22 %define _without_xalan 1
24 # don't build debuginfo RPM
25 %define debug_package %{nil}
28 Packager: PlanetLab Central <support@planet-lab.org>
29 Distribution: PlanetLab 3.0
30 URL: http://cvs.planet-lab.org/cvs/util-vserver
32 Summary: Linux virtual server utilities
37 Group: System Environment/Base
38 URL: http://savannah.nongnu.org/projects/util-vserver/
39 Source0: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2
40 #Source1: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2.asc
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(post): %name-core
53 Requires(pre): %pkglibdir
54 Requires(postun): %pkglibdir
55 %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25}
56 %{?_with_xalan:BuildRequires: xalan-j}
59 Summary: Dynamic libraries for util-vserver
60 Group: System Environment/Libraries
63 Summary: The core-utilities for util-vserver
64 Group: Applications/System
68 Summary: Tools which can be used to build vservers
69 Group: Applications/System
70 Requires: rpm wget binutils tar e2fsprogs
71 Requires: %name = %version-%release
72 Requires(pre): %confdir
73 Requires(postun): %confdir
74 Requires(post): %name-core
77 Summary: SysV-initscripts for vserver
78 Group: System Environment/Base
79 Provides: init(%name) = sysv
80 Requires: make diffutils
82 Requires: %name = %version-%release
83 Requires(post): %chkconfig
84 Requires(preun): %chkconfig
85 Requires(pre): %_initrddir %pkglibdir
86 requires(postun): %_initrddir %pkglibdir
89 Summary: Legacy utilities for util-vserver
90 Group: Applications/System
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: Header-files and libraries needed to develop vserver based applications
99 Group: Development/Libraries
101 Requires: %name-lib = %version-%release
104 Summary: Python modules for manipulating vservers
105 Group: Applications/System
106 Requires: python util-python
107 Obsoletes: util-vserver-py23 resman
111 util-vserver provides the components and a framework to setup virtual
112 servers. A virtual server runs inside a linux server. It is nevertheless
113 highly independent. As such, you can run various services with normal
114 configuration. The various vservers can't interact with each other and
115 can't interact with services in the main server.
117 This requires a special kernel supporting the new new_s_context and
118 set_ipv4root system call.
121 util-vserver provides the components and a framework to setup virtual
122 servers. A virtual server runs inside a linux server. It is nevertheless
123 highly independent. As such, you can run various services with normal
124 configuration. The various vservers can't interact with each other and
125 can't interact with services in the main server.
127 This package contains the shared libraries needed by all other
128 'util-vserver' subpackages.
131 util-vserver provides the components and a framework to setup virtual
132 servers. A virtual server runs inside a linux server. It is nevertheless
133 highly independent. As such, you can run various services with normal
134 configuration. The various vservers can't interact with each other and
135 can't interact with services in the main server.
137 This package contains utilities which are required to communicate with
138 the Linux-Vserver enabled kernel.
142 util-vserver provides the components and a framework to setup virtual
143 servers. A virtual server runs inside a linux server. It is nevertheless
144 highly independent. As such, you can run various services with normal
145 configuration. The various vservers can't interact with each other and
146 can't interact with services in the main server.
148 This package contains utilities which assist in building Vservers.
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 the SysV initscripts which start and stop
158 VServers and related tools.
162 util-vserver provides the components and a framework to setup virtual
163 servers. A virtual server runs inside a linux server. It is nevertheless
164 highly independent. As such, you can run various services with normal
165 configuration. The various vservers can't interact with each other and
166 can't interact with services in the main server.
168 This package contains the tools which are needed to work with VServers
169 having an old-style configuration.
173 util-vserver provides the components and a framework to setup virtual
174 servers. A virtual server runs inside a linux server. It is nevertheless
175 highly independent. As such, you can run various services with normal
176 configuration. The various vservers can't interact with each other and
177 can't interact with services in the main server.
179 This package contains header files and libraries which are needed to
180 develop VServer related applications.
184 Python modules for manipulating vservers. Provides a superset of the
185 functionality of the vserver script (at least will do in the future),
186 but more readily accessible from Python code.
194 automake --add-missing
197 %configure --with-initrddir=%_initrddir --enable-release \
198 %{?_without_dietlibc:--disable-dietlibc}
200 %__make %{?_smp_mflags} all
201 %__make %{?_smp_mflags} doc
206 rm -rf $RPM_BUILD_ROOT
207 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
209 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
211 MANIFEST_CONFIG='%config' \
212 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
213 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
215 # install python bindings
216 %__make -C python DESTDIR="$PWD/tmp" install
217 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
218 install tmp/usr/lib/python*/site-packages/*.{py,so} $RPM_BUILD_ROOT/%{_datadir}/%{name}/
219 install -D -m 755 python/bwlimit $RPM_BUILD_ROOT/%{_sbindir}/bwlimit
227 rm -rf $RPM_BUILD_ROOT
231 test -d /vservers || mkdir -m0000 /vservers
232 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
234 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
235 f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
236 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers "$f"
238 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
242 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
244 # add /bin/vsh to list of secure shells
245 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
246 echo /bin/vsh >> /etc/shells
251 # 0 = erase, 1 = upgrade
252 if [ "$1" = 0 ] ; then
253 perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
257 %post lib -p /sbin/ldconfig
258 %postun lib -p /sbin/ldconfig
262 #%chkconfig --add vservers-default
263 #%chkconfig --add vprocunhide
264 # PlanetLab Node Manager takes care of starting and stopping VServers
265 %chkconfig --del vservers-default
266 # PlanetLab does not require /proc security
267 %chkconfig --del vprocunhide
270 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
272 #test "$1" != 0 || %chkconfig --del vprocunhide
273 #test "$1" != 0 || %chkconfig --del vservers-default
277 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
280 %triggerin build -- fedora-release, centos-release
287 test -r "$i" || continue
289 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
293 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
294 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
295 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
299 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
301 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
302 ln -s /vservers/.hash "$f"/00
304 %_sbindir/setattr --barrier /vservers/.hash || :
308 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
311 ## Temporary workaround to remove old v_* files; it will conflict
312 ## somehow with the -legacy package but can be fixed by reinstalling
314 ## TODO: remove me in the final .spec file
315 %define v_services httpd named portmap sendmail smb sshd xinetd gated
316 %triggerun sysv -- util-vserver-sysv < 0.30.198
317 for i in %v_services; do
318 %chkconfig --del v_$i || :
323 # PlanetLab Node Manager takes care of starting and stopping VServers
324 #%chkconfig --add rebootmgr
325 #%chkconfig --add vservers-legacy
327 # PlanetLab does not require these legacy services
328 #for i in %v_services; do
329 # %chkconfig --add v_$i
334 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
336 #test "$1" != 0 || for i in %v_services; do
337 # %chkconfig --del v_$i
340 #test "$1" != 0 || %chkconfig --del rebootmgr
341 #test "$1" != 0 || %chkconfig --del vservers-legacy
344 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
347 %files -f %name-base.list
348 %defattr(-,root,root,-)
349 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
350 %doc doc/*.html doc/*.css
354 %dir %confdefaultdir/apps
355 %dir %confdefaultdir/files
356 %dir %pkglibdir/defaults
357 %ghost %confdefaultdir/cachebase
358 %ghost %confdefaultdir/vdirbase
359 %ghost %confdefaultdir/run.rev
361 %dir %_localstatedir/cache/vservers
362 %dir %_localstatedir/run/vservers
363 %dir %_localstatedir/run/vservers.rev
364 %dir %_localstatedir/run/vshelper
367 %files lib -f %name-lib.list
368 %files sysv -f %name-sysv.list
371 %files core -f %name-core.list
372 %defattr(-,root,root,-)
376 %files build -f %name-build.list
377 %defattr(-,root,root,-)
378 %doc contrib/yum*.patch
379 %dir %confdir/.distributions
380 %dir %confdir/.distributions/*
381 %dir %confdir/.distributions/*/apt
382 %dir %confdir/.distributions/.common
383 %dir %confdir/.distributions/.common/pubkeys
384 %dir %confdefaultdir/apps/vunify
385 %dir %confdefaultdir/apps/vunify/hash
388 %files legacy -f %name-legacy.list
389 %defattr(-,root,root,-)
390 %dir %pkglibdir/legacy
393 %files devel -f %name-devel.list
394 %defattr(-,root,root,-)
395 %doc lib/apidoc/latex/refman.pdf
400 pushd %{_datadir}/%{name} >/dev/null
402 # Byte compile and install modules
404 for file in *.py ; do
405 if [ -n "$py_modules" ] ; then
406 py_modules="$py_modules,"
408 py_modules="$py_modules '${file%*.py}'"
410 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
414 # Install the prebuilt extensions by hand
415 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
416 install -D -m 755 *.so "$python_sitelib"/
421 %triggerpostun python -- util-vserver-python, util-vserver-py23
422 # RPMs get upgraded by installing the new one, then uninstalling the
423 # old one. Since we no longer own the byte-compiled modules, they may
424 # be removed right after we create them in %post if we are upgraded
425 # from a version that did own them at one point. This section should
426 # be removed once all packages have been upgraded to at least this
428 pushd %{_datadir}/%{name} >/dev/null
430 # Byte compile and install modules
432 for file in *.py ; do
433 if [ -n "$py_modules" ] ; then
434 py_modules="$py_modules,"
436 py_modules="$py_modules '${file%*.py}'"
438 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
442 # Install the prebuilt extensions by hand
443 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
444 install -D -m 755 *.so "$python_sitelib"/
450 # 0 = erase, 1 = upgrade
451 if [ $1 -eq 0 ] ; then
452 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
453 pushd %{_datadir}/%{name} >/dev/null
454 for file in *.py *.so ; do
455 rm -f "$python_sitelib"/${file}*
467 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
468 - add support for setting guaranteed CPU share flag in rspec
470 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
471 - do not require 'xalan' anymore by default
472 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
473 - removed 'chattr' leftovers
474 - create the '/etc/vservers/.defaults/cachebase' symlink
475 - added /var/cache/vservers and the needed support
476 - set barrier attribute on /vservers/.pkg and /vservers/.hash
477 - added 'centos-release' to the list of packages in the copy-the-keys
479 - create '/vservers/.hash' and add initial configuration for it
481 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
482 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
483 for a context that didn't exist would cause an error (it should be a
486 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
487 - fix bugs in python/vserverimpl.c where exceptions were not raised when
488 they should be and thus occured later at unexpected times
489 - add support for stopping a vserver
491 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
492 - add support for removing resource limits e.g., when a slice is deleted
494 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
495 - fix file descriptor leak in vduimpl
496 - clean up handling of network parameters
497 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
499 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
500 - fix Python modules to handling scheduling parameters correctly
502 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
506 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
507 - raise exception about being over disk limit after setting usage values
509 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
510 - create common function to be used for entering a vserver and applying
513 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
514 - restore build of python modules
516 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
517 - upgrade to util-vserver-0.30.208
518 - forward-port vbuild and legacy support until we can find a suitable
520 - make vsh use new vc_create_context() call
522 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
523 - add support for static vserver IDs to vuseradd and vuserdel
525 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
526 - add bwlimit and cpulimit modules
528 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
531 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
533 - require the -lib subpackage by -devel
534 - copy GPG keys from /etc/pki/rpm-gpg/
536 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
537 - import Marc's vdu implementation
539 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
540 - 'vserver-init start' functionality subsumed by Node Manager
542 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
543 - Fixed vlimit command
545 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
546 - add Python modules for manipulating vservers
548 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
549 - added patches to make yum work in chroot environments
552 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
553 - vuserdel changes: don't shutdown vserver, just kill all processes;
554 unmount all mountpoints in vserver before deleting
556 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
557 - added some %%descriptions
558 - copy GPG keys from the system into the confdir
559 - buildrequire dietlibc-0.25
560 - BuildRequire beecrypt-devel
562 - use %%global instead of %%define
563 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
565 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
566 - updated BuildRequires:
567 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
568 - moved the v_* initscripts to legacy
569 - do not ship the /vservers directory itself; as it is immutable, the
570 extraction will fail else
572 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
573 - vcached no longer runs as a daemon
574 - do not restart vservers when package is upgraded
576 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
579 - Both vcached and vuseradd now print a warning message when vbuild
580 succeeds but the resulting new vserver image is smaller in size than
581 the vserver-reference image.
582 - vuseradd: clean up some more junk on failure
584 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
586 - PL3026: This is the upgraded version of vdu that maintains an
587 internal hash table of files with a nlink count > 1. Only if vdu
588 sees all hard links to a particular inode does it add its size and
589 block count to the total.
591 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
592 - PL2445 Use -b option to du to avoid rounding errors.
594 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
596 - don't create the symbolic link /home/slice/.ssh, this is not how
599 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
602 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
603 - documented switches for 'rpmbuild'
605 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
606 - initial PlanetLab 3.0 build.
608 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
609 - (re)added the MANIFEST_* variables which were lost some time ago;
610 this will preserve %%config files...
612 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
613 - use file-list for sysv scripts also
615 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
616 - added vprocunhide-service support
617 - added doxygen support
620 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0