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
278 # vip6-autod handles IPv6 auto-assignments
279 %chkconfig --add vip6-autod
283 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
285 #test "$1" != 0 || %chkconfig --del vprocunhide
286 #test "$1" != 0 || %chkconfig --del vservers-default
287 #test "$1" != 0 || %chkconfig --del util-vserver
288 test "$1" != 0 || %chkconfig --del vip6-autod
292 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
295 %triggerin build -- fedora-release, centos-release
302 test -r "$i" || continue
304 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
308 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
309 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
310 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
314 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
316 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
317 ln -s /vservers/.hash "$f"/00
319 %_sbindir/setattr --barrier /vservers/.hash || :
323 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
326 ## Temporary workaround to remove old v_* files; it will conflict
327 ## somehow with the -legacy package but can be fixed by reinstalling
329 ## TODO: remove me in the final .spec file
330 %define v_services httpd named portmap sendmail smb sshd xinetd gated
331 %triggerun sysv -- util-vserver-sysv < 0.30.198
332 for i in %v_services; do
333 %chkconfig --del v_$i || :
338 # PlanetLab Node Manager takes care of starting and stopping VServers
339 #%chkconfig --add rebootmgr
340 #%chkconfig --add vservers-legacy
342 # PlanetLab does not require these legacy services
343 #for i in %v_services; do
344 # %chkconfig --add v_$i
349 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
351 #test "$1" != 0 || for i in %v_services; do
352 # %chkconfig --del v_$i
355 #test "$1" != 0 || %chkconfig --del rebootmgr
356 #test "$1" != 0 || %chkconfig --del vservers-legacy
359 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
362 %files -f %name-base.list
363 %defattr(-,root,root,-)
364 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
365 %doc doc/*.html doc/*.css
369 %dir %confdefaultdir/apps
370 %dir %confdefaultdir/files
371 %dir %pkglibdir/defaults
372 %ghost %confdefaultdir/cachebase
373 %ghost %confdefaultdir/vdirbase
374 %ghost %confdefaultdir/run.rev
376 %dir %_localstatedir/cache/vservers
377 %dir %_localstatedir/run/vservers
378 %dir %_localstatedir/run/vservers.rev
379 %dir %_localstatedir/run/vshelper
382 %files lib -f %name-lib.list
383 %files sysv -f %name-sysv.list
386 %files core -f %name-core.list
387 %defattr(-,root,root,-)
391 %files build -f %name-build.list
392 %defattr(-,root,root,-)
393 %doc contrib/yum*.patch
394 %dir %confdir/.distributions
395 %dir %confdir/.distributions/*
396 %dir %confdir/.distributions/*/apt
397 %dir %confdir/.distributions/.common
398 %dir %confdir/.distributions/.common/pubkeys
399 %dir %confdefaultdir/apps/vunify
400 %dir %confdefaultdir/apps/vunify/hash
403 %files legacy -f %name-legacy.list
404 %defattr(-,root,root,-)
405 %dir %pkglibdir/legacy
408 %files devel -f %name-devel.list
409 %defattr(-,root,root,-)
410 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
411 %{!?_without_doc:%doc lib/apidoc/html}
415 pushd %{_datadir}/%{name} >/dev/null
417 # Byte compile and install modules
419 for file in *.py ; do
420 if [ -n "$py_modules" ] ; then
421 py_modules="$py_modules,"
423 py_modules="$py_modules '${file%*.py}'"
425 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
429 # Install the prebuilt extensions by hand
430 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
431 install -m 755 *.so "$python_sitelib"/
436 %triggerpostun python -- util-vserver-python, util-vserver-py23
437 # RPMs get upgraded by installing the new one, then uninstalling the
438 # old one. Since we no longer own the byte-compiled modules, they may
439 # be removed right after we create them in %post if we are upgraded
440 # from a version that did own them at one point. This section should
441 # be removed once all packages have been upgraded to at least this
443 pushd %{_datadir}/%{name} >/dev/null
445 # Byte compile and install modules
447 for file in *.py ; do
448 if [ -n "$py_modules" ] ; then
449 py_modules="$py_modules,"
451 py_modules="$py_modules '${file%*.py}'"
453 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
457 # Install the prebuilt extensions by hand
458 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
459 install -m 755 *.so "$python_sitelib"/
465 # 0 = erase, 1 = upgrade
466 if [ $1 -eq 0 ] ; then
467 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
468 pushd %{_datadir}/%{name} >/dev/null
469 for file in *.py *.so ; do
470 rm -f "$python_sitelib"/${file}*
479 %{_sbindir}/disklimit
483 * Mon Jul 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
486 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
487 - add --with legacy and --without doc switches
488 - add util-vserver initscript
490 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
491 - add support for setting guaranteed CPU share flag in rspec
493 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
494 - do not require 'xalan' anymore by default
495 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
496 - removed 'chattr' leftovers
497 - create the '/etc/vservers/.defaults/cachebase' symlink
498 - added /var/cache/vservers and the needed support
499 - set barrier attribute on /vservers/.pkg and /vservers/.hash
500 - added 'centos-release' to the list of packages in the copy-the-keys
502 - create '/vservers/.hash' and add initial configuration for it
504 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
505 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
506 for a context that didn't exist would cause an error (it should be a
509 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
510 - fix bugs in python/vserverimpl.c where exceptions were not raised when
511 they should be and thus occured later at unexpected times
512 - add support for stopping a vserver
514 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
515 - add support for removing resource limits e.g., when a slice is deleted
517 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
518 - fix file descriptor leak in vduimpl
519 - clean up handling of network parameters
520 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
522 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
523 - fix Python modules to handling scheduling parameters correctly
525 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
529 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
530 - raise exception about being over disk limit after setting usage values
532 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
533 - create common function to be used for entering a vserver and applying
536 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
537 - restore build of python modules
539 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
540 - upgrade to util-vserver-0.30.208
541 - forward-port vbuild and legacy support until we can find a suitable
543 - make vsh use new vc_create_context() call
545 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
546 - add support for static vserver IDs to vuseradd and vuserdel
548 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
549 - add bwlimit and cpulimit modules
551 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
554 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
556 - require the -lib subpackage by -devel
557 - copy GPG keys from /etc/pki/rpm-gpg/
559 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
560 - import Marc's vdu implementation
562 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
563 - 'vserver-init start' functionality subsumed by Node Manager
565 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
566 - Fixed vlimit command
568 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
569 - add Python modules for manipulating vservers
571 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
572 - added patches to make yum work in chroot environments
575 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
576 - vuserdel changes: don't shutdown vserver, just kill all processes;
577 unmount all mountpoints in vserver before deleting
579 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
580 - added some %%descriptions
581 - copy GPG keys from the system into the confdir
582 - buildrequire dietlibc-0.25
583 - BuildRequire beecrypt-devel
585 - use %%global instead of %%define
586 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
588 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
589 - updated BuildRequires:
590 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
591 - moved the v_* initscripts to legacy
592 - do not ship the /vservers directory itself; as it is immutable, the
593 extraction will fail else
595 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
596 - vcached no longer runs as a daemon
597 - do not restart vservers when package is upgraded
599 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
602 - Both vcached and vuseradd now print a warning message when vbuild
603 succeeds but the resulting new vserver image is smaller in size than
604 the vserver-reference image.
605 - vuseradd: clean up some more junk on failure
607 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
609 - PL3026: This is the upgraded version of vdu that maintains an
610 internal hash table of files with a nlink count > 1. Only if vdu
611 sees all hard links to a particular inode does it add its size and
612 block count to the total.
614 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
615 - PL2445 Use -b option to du to avoid rounding errors.
617 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
619 - don't create the symbolic link /home/slice/.ssh, this is not how
622 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
625 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
626 - documented switches for 'rpmbuild'
628 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
629 - initial PlanetLab 3.0 build.
631 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
632 - (re)added the MANIFEST_* variables which were lost some time ago;
633 this will preserve %%config files...
635 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
636 - use file-list for sysv scripts also
638 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
639 - added vprocunhide-service support
640 - added doxygen support
643 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0