1 # $Id: util-vserver.spec.in 2482 2007-01-29 23:37:07Z dhozac $
3 ## This package understands the following switches:
4 ## --without dietlibc ... disable usage of dietlibc
5 ## --with xalan ... require/use the xalan xslt processor
6 ## --without doc ... disable doc generation
7 ## --with legacy ... enable the legacy APIs
9 %global confdir %_sysconfdir/vservers
10 %global confdefaultdir %confdir/.defaults
11 %global pkglibdir %_libdir/%name
12 %global chkconfig /sbin/chkconfig
14 %global _localstatedir %_var
16 %global ver %( echo 0.30.213 | sed 's/-.*//' )
17 %global subver %( s=`echo 0.30.213 | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
18 %global fullver 0.30.213
21 %define name util-vserver
22 %define version 0.30.213
23 %{!?release_func:%global release_func() 1%{?pldistro:.%{pldistro}}%{?date:.%{date}}}
25 %define _without_dietlibc 1
26 %define _without_xalan 1
28 # don't build debuginfo RPM
29 %define debug_package %{nil}
32 Packager: PlanetLab Central <support@planet-lab.org>
33 Distribution: PlanetLab 3.0
34 URL: http://cvs.planet-lab.org/cvs/util-vserver
36 Summary: Linux virtual server utilities
39 Release: %release_func 0%subver
41 Group: System Environment/Base
42 #URL: http://savannah.nongnu.org/projects/util-vserver/
43 Source0: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version.tar.bz2
44 #Source1: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version.tar.bz2.asc
45 BuildRoot: %_tmppath/%name-%version-%release-root
47 Requires: %name-core = %version-%release
48 Requires: %name-lib = %version-%release
49 Requires: diffutils mktemp sed
50 Provides: vserver = %version-%release
51 Obsoletes: vserver < %version
52 BuildRequires: mount vconfig gawk iproute iptables
53 BuildRequires: gcc-c++ wget which diffutils
54 BuildRequires: e2fsprogs-devel beecrypt-devel
56 BuildRequires: libnl-devel
57 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
58 Requires(post): %name-core
59 Requires(pre): %pkglibdir
60 Requires(postun): %pkglibdir
61 %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25}
62 %{?_with_xalan:BuildRequires: xalan-j}
65 Summary: Dynamic libraries for util-vserver
66 Group: System Environment/Libraries
69 Summary: The core-utilities for util-vserver
70 Group: Applications/System
74 Summary: Tools which can be used to build vservers
75 Group: Applications/System
76 Requires: rpm wget tar
77 Requires: %name = %version-%release
78 Requires(pre): %confdir
79 Requires(postun): %confdir
80 Requires(post): %name-core
83 Summary: SysV-initscripts for vserver
84 Group: System Environment/Base
85 Provides: init(%name) = sysv
86 Requires: make diffutils
88 Requires: %name = %version-%release
89 Requires(post): %chkconfig
90 Requires(preun): %chkconfig
91 Requires(pre): %_initrddir %pkglibdir
92 requires(postun): %_initrddir %pkglibdir
95 Summary: Legacy utilities for util-vserver
96 Group: Applications/System
97 Requires: %name = %version-%release
98 Requires(post): %chkconfig
99 Requires(preun): %chkconfig
100 Requires(pre): %_initrddir %pkglibdir
101 requires(postun): %_initrddir %pkglibdir
104 Summary: Header-files and libraries needed to develop vserver based applications
105 Group: Development/Libraries
107 Requires: %name-lib = %version-%release
110 Summary: Python modules for manipulating vservers
111 Group: Applications/System
112 Requires: python util-python
113 Obsoletes: util-vserver-py23 resman
117 util-vserver provides the components and a framework to setup virtual
118 servers. A virtual server runs inside a linux server. It is nevertheless
119 highly independent. As such, you can run various services with normal
120 configuration. The various vservers can't interact with each other and
121 can't interact with services in the main server.
123 This requires a special kernel supporting the new new_s_context and
124 set_ipv4root system call.
127 util-vserver provides the components and a framework to setup virtual
128 servers. A virtual server runs inside a linux server. It is nevertheless
129 highly independent. As such, you can run various services with normal
130 configuration. The various vservers can't interact with each other and
131 can't interact with services in the main server.
133 This package contains the shared libraries needed by all other
134 'util-vserver' subpackages.
137 util-vserver provides the components and a framework to setup virtual
138 servers. A virtual server runs inside a linux server. It is nevertheless
139 highly independent. As such, you can run various services with normal
140 configuration. The various vservers can't interact with each other and
141 can't interact with services in the main server.
143 This package contains utilities which are required to communicate with
144 the Linux-Vserver enabled kernel.
148 util-vserver provides the components and a framework to setup virtual
149 servers. A virtual server runs inside a linux server. It is nevertheless
150 highly independent. As such, you can run various services with normal
151 configuration. The various vservers can't interact with each other and
152 can't interact with services in the main server.
154 This package contains utilities which assist in building Vservers.
157 util-vserver provides the components and a framework to setup virtual
158 servers. A virtual server runs inside a linux server. It is nevertheless
159 highly independent. As such, you can run various services with normal
160 configuration. The various vservers can't interact with each other and
161 can't interact with services in the main server.
163 This package contains the SysV initscripts which start and stop
164 VServers and related tools.
168 util-vserver provides the components and a framework to setup virtual
169 servers. A virtual server runs inside a linux server. It is nevertheless
170 highly independent. As such, you can run various services with normal
171 configuration. The various vservers can't interact with each other and
172 can't interact with services in the main server.
174 This package contains the tools which are needed to work with VServers
175 having an old-style configuration.
179 util-vserver provides the components and a framework to setup virtual
180 servers. A virtual server runs inside a linux server. It is nevertheless
181 highly independent. As such, you can run various services with normal
182 configuration. The various vservers can't interact with each other and
183 can't interact with services in the main server.
185 This package contains header files and libraries which are needed to
186 develop VServer related applications.
190 Python modules for manipulating vservers. Provides a superset of the
191 functionality of the vserver script (at least will do in the future),
192 but more readily accessible from Python code.
196 %setup -q -n %name-%fullver
200 automake --add-missing
203 %configure --with-initrddir=%_initrddir --enable-release \
204 %{?_without_dietlibc:--disable-dietlibc} \
205 %{!?_without_legacy:--enable-apis=NOLEGACY} \
206 --with-initscripts=sysv
208 %__make %{?_smp_mflags} all
209 %{!?_without_doc:%__make %{?_smp_mflags} doc}
214 rm -rf $RPM_BUILD_ROOT
215 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
217 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
219 MANIFEST_CONFIG='%config' \
220 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
221 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
223 # install python bindings
224 %__make -C python DESTDIR="$PWD/tmp" install
225 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
226 install tmp%{_libdir}/python*/site-packages/*.{py,so} $RPM_BUILD_ROOT/%{_datadir}/%{name}/
227 install -D -m 755 python/bwlimit $RPM_BUILD_ROOT/%{_sbindir}/bwlimit
228 install -D -m 755 python/disklimit $RPM_BUILD_ROOT/%{_sbindir}/disklimit
236 rm -rf $RPM_BUILD_ROOT
240 test -d /vservers || mkdir -m0000 /vservers
241 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
243 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
244 f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
245 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers "$f"
247 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
251 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
253 # add /bin/vsh to list of secure shells
254 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
255 echo /bin/vsh >> /etc/shells
260 # 0 = erase, 1 = upgrade
261 if [ "$1" = 0 ] ; then
262 perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
266 %post lib -p /sbin/ldconfig
267 %postun lib -p /sbin/ldconfig
271 #%chkconfig --add vservers-default
272 #%chkconfig --add vprocunhide
273 # PlanetLab Node Manager takes care of starting and stopping VServers
274 %chkconfig --del vservers-default
275 %chkconfig --del util-vserver
276 # PlanetLab does not require /proc security
277 %chkconfig --del vprocunhide
281 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
283 #test "$1" != 0 || %chkconfig --del vprocunhide
284 #test "$1" != 0 || %chkconfig --del vservers-default
285 #test "$1" != 0 || %chkconfig --del util-vserver
289 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
292 %triggerin build -- fedora-release, centos-release
299 test -r "$i" || continue
301 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
305 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
306 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
307 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
311 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
313 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
314 ln -s /vservers/.hash "$f"/00
316 %_sbindir/setattr --barrier /vservers/.hash || :
320 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
323 ## Temporary workaround to remove old v_* files; it will conflict
324 ## somehow with the -legacy package but can be fixed by reinstalling
326 ## TODO: remove me in the final .spec file
327 %define v_services httpd named portmap sendmail smb sshd xinetd gated
328 %triggerun sysv -- util-vserver-sysv < 0.30.198
329 for i in %v_services; do
330 %chkconfig --del v_$i || :
335 # PlanetLab Node Manager takes care of starting and stopping VServers
336 #%chkconfig --add rebootmgr
337 #%chkconfig --add vservers-legacy
339 # PlanetLab does not require these legacy services
340 #for i in %v_services; do
341 # %chkconfig --add v_$i
346 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
348 #test "$1" != 0 || for i in %v_services; do
349 # %chkconfig --del v_$i
352 #test "$1" != 0 || %chkconfig --del rebootmgr
353 #test "$1" != 0 || %chkconfig --del vservers-legacy
356 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
359 %files -f %name-base.list
360 %defattr(-,root,root,-)
361 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
362 %doc doc/*.html doc/*.css
366 %dir %confdefaultdir/apps
367 %dir %confdefaultdir/files
368 %dir %pkglibdir/defaults
369 %ghost %confdefaultdir/cachebase
370 %ghost %confdefaultdir/vdirbase
371 %ghost %confdefaultdir/run.rev
373 %dir %_localstatedir/cache/vservers
374 %dir %_localstatedir/run/vservers
375 %dir %_localstatedir/run/vservers.rev
376 %dir %_localstatedir/run/vshelper
379 %files lib -f %name-lib.list
380 %files sysv -f %name-sysv.list
383 %files core -f %name-core.list
384 %defattr(-,root,root,-)
388 %files build -f %name-build.list
389 %defattr(-,root,root,-)
390 %doc contrib/yum*.patch
391 %dir %confdir/.distributions
392 %dir %confdir/.distributions/*
393 %dir %confdir/.distributions/*/apt
394 %dir %confdir/.distributions/.common
395 %dir %confdir/.distributions/.common/pubkeys
396 %dir %confdefaultdir/apps/vunify
397 %dir %confdefaultdir/apps/vunify/hash
400 %files legacy -f %name-legacy.list
401 %defattr(-,root,root,-)
402 %dir %pkglibdir/legacy
405 %files devel -f %name-devel.list
406 %defattr(-,root,root,-)
407 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
408 %{!?_without_doc:%doc lib/apidoc/html}
412 pushd %{_datadir}/%{name} >/dev/null
414 # Byte compile and install modules
416 for file in *.py ; do
417 if [ -n "$py_modules" ] ; then
418 py_modules="$py_modules,"
420 py_modules="$py_modules '${file%*.py}'"
422 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
426 # Install the prebuilt extensions by hand
427 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
428 install -m 755 *.so "$python_sitelib"/
433 %triggerpostun python -- util-vserver-python, util-vserver-py23
434 # RPMs get upgraded by installing the new one, then uninstalling the
435 # old one. Since we no longer own the byte-compiled modules, they may
436 # be removed right after we create them in %post if we are upgraded
437 # from a version that did own them at one point. This section should
438 # be removed once all packages have been upgraded to at least this
440 pushd %{_datadir}/%{name} >/dev/null
442 # Byte compile and install modules
444 for file in *.py ; do
445 if [ -n "$py_modules" ] ; then
446 py_modules="$py_modules,"
448 py_modules="$py_modules '${file%*.py}'"
450 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
454 # Install the prebuilt extensions by hand
455 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
456 install -m 755 *.so "$python_sitelib"/
462 # 0 = erase, 1 = upgrade
463 if [ $1 -eq 0 ] ; then
464 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
465 pushd %{_datadir}/%{name} >/dev/null
466 for file in *.py *.so ; do
467 rm -f "$python_sitelib"/${file}*
476 %{_sbindir}/disklimit
480 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
481 - add --with legacy and --without doc switches
482 - add util-vserver initscript
484 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
485 - add support for setting guaranteed CPU share flag in rspec
487 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
488 - do not require 'xalan' anymore by default
489 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
490 - removed 'chattr' leftovers
491 - create the '/etc/vservers/.defaults/cachebase' symlink
492 - added /var/cache/vservers and the needed support
493 - set barrier attribute on /vservers/.pkg and /vservers/.hash
494 - added 'centos-release' to the list of packages in the copy-the-keys
496 - create '/vservers/.hash' and add initial configuration for it
498 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
499 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
500 for a context that didn't exist would cause an error (it should be a
503 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
504 - fix bugs in python/vserverimpl.c where exceptions were not raised when
505 they should be and thus occured later at unexpected times
506 - add support for stopping a vserver
508 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
509 - add support for removing resource limits e.g., when a slice is deleted
511 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
512 - fix file descriptor leak in vduimpl
513 - clean up handling of network parameters
514 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
516 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
517 - fix Python modules to handling scheduling parameters correctly
519 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
523 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
524 - raise exception about being over disk limit after setting usage values
526 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
527 - create common function to be used for entering a vserver and applying
530 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
531 - restore build of python modules
533 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
534 - upgrade to util-vserver-0.30.208
535 - forward-port vbuild and legacy support until we can find a suitable
537 - make vsh use new vc_create_context() call
539 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
540 - add support for static vserver IDs to vuseradd and vuserdel
542 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
543 - add bwlimit and cpulimit modules
545 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
548 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
550 - require the -lib subpackage by -devel
551 - copy GPG keys from /etc/pki/rpm-gpg/
553 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
554 - import Marc's vdu implementation
556 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
557 - 'vserver-init start' functionality subsumed by Node Manager
559 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
560 - Fixed vlimit command
562 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
563 - add Python modules for manipulating vservers
565 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
566 - added patches to make yum work in chroot environments
569 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
570 - vuserdel changes: don't shutdown vserver, just kill all processes;
571 unmount all mountpoints in vserver before deleting
573 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
574 - added some %%descriptions
575 - copy GPG keys from the system into the confdir
576 - buildrequire dietlibc-0.25
577 - BuildRequire beecrypt-devel
579 - use %%global instead of %%define
580 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
582 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
583 - updated BuildRequires:
584 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
585 - moved the v_* initscripts to legacy
586 - do not ship the /vservers directory itself; as it is immutable, the
587 extraction will fail else
589 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
590 - vcached no longer runs as a daemon
591 - do not restart vservers when package is upgraded
593 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
596 - Both vcached and vuseradd now print a warning message when vbuild
597 succeeds but the resulting new vserver image is smaller in size than
598 the vserver-reference image.
599 - vuseradd: clean up some more junk on failure
601 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
603 - PL3026: This is the upgraded version of vdu that maintains an
604 internal hash table of files with a nlink count > 1. Only if vdu
605 sees all hard links to a particular inode does it add its size and
606 block count to the total.
608 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
609 - PL2445 Use -b option to du to avoid rounding errors.
611 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
613 - don't create the symbolic link /home/slice/.ssh, this is not how
616 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
619 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
620 - documented switches for 'rpmbuild'
622 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
623 - initial PlanetLab 3.0 build.
625 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
626 - (re)added the MANIFEST_* variables which were lost some time ago;
627 this will preserve %%config files...
629 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
630 - use file-list for sysv scripts also
632 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
633 - added vprocunhide-service support
634 - added doxygen support
637 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0