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 @VERSION@ | sed 's/-.*//' )
17 %global subver %( s=`echo @VERSION@ | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
18 %global fullver @VERSION@
21 %define name @PACKAGE@
22 %define version @VERSION@
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
55 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
56 Requires(post): %name-core
57 Requires(pre): %pkglibdir
58 Requires(postun): %pkglibdir
59 %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25}
60 %{?_with_xalan:BuildRequires: xalan-j}
63 Summary: Dynamic libraries for util-vserver
64 Group: System Environment/Libraries
67 Summary: The core-utilities for util-vserver
68 Group: Applications/System
72 Summary: Tools which can be used to build vservers
73 Group: Applications/System
74 Requires: rpm wget tar
75 Requires: %name = %version-%release
76 Requires(pre): %confdir
77 Requires(postun): %confdir
78 Requires(post): %name-core
81 Summary: SysV-initscripts for vserver
82 Group: System Environment/Base
83 Provides: init(%name) = sysv
84 Requires: make diffutils
86 Requires: %name = %version-%release
87 Requires(post): %chkconfig
88 Requires(preun): %chkconfig
89 Requires(pre): %_initrddir %pkglibdir
90 requires(postun): %_initrddir %pkglibdir
93 Summary: Legacy utilities for util-vserver
94 Group: Applications/System
95 Requires: %name = %version-%release
96 Requires(post): %chkconfig
97 Requires(preun): %chkconfig
98 Requires(pre): %_initrddir %pkglibdir
99 requires(postun): %_initrddir %pkglibdir
102 Summary: Header-files and libraries needed to develop vserver based applications
103 Group: Development/Libraries
105 Requires: %name-lib = %version-%release
108 Summary: Python modules for manipulating vservers
109 Group: Applications/System
110 Requires: python util-python
111 Obsoletes: util-vserver-py23 resman
115 util-vserver provides the components and a framework to setup virtual
116 servers. A virtual server runs inside a linux server. It is nevertheless
117 highly independent. As such, you can run various services with normal
118 configuration. The various vservers can't interact with each other and
119 can't interact with services in the main server.
121 This requires a special kernel supporting the new new_s_context and
122 set_ipv4root system call.
125 util-vserver provides the components and a framework to setup virtual
126 servers. A virtual server runs inside a linux server. It is nevertheless
127 highly independent. As such, you can run various services with normal
128 configuration. The various vservers can't interact with each other and
129 can't interact with services in the main server.
131 This package contains the shared libraries needed by all other
132 'util-vserver' subpackages.
135 util-vserver provides the components and a framework to setup virtual
136 servers. A virtual server runs inside a linux server. It is nevertheless
137 highly independent. As such, you can run various services with normal
138 configuration. The various vservers can't interact with each other and
139 can't interact with services in the main server.
141 This package contains utilities which are required to communicate with
142 the Linux-Vserver enabled kernel.
146 util-vserver provides the components and a framework to setup virtual
147 servers. A virtual server runs inside a linux server. It is nevertheless
148 highly independent. As such, you can run various services with normal
149 configuration. The various vservers can't interact with each other and
150 can't interact with services in the main server.
152 This package contains utilities which assist in building Vservers.
155 util-vserver provides the components and a framework to setup virtual
156 servers. A virtual server runs inside a linux server. It is nevertheless
157 highly independent. As such, you can run various services with normal
158 configuration. The various vservers can't interact with each other and
159 can't interact with services in the main server.
161 This package contains the SysV initscripts which start and stop
162 VServers and related tools.
166 util-vserver provides the components and a framework to setup virtual
167 servers. A virtual server runs inside a linux server. It is nevertheless
168 highly independent. As such, you can run various services with normal
169 configuration. The various vservers can't interact with each other and
170 can't interact with services in the main server.
172 This package contains the tools which are needed to work with VServers
173 having an old-style configuration.
177 util-vserver provides the components and a framework to setup virtual
178 servers. A virtual server runs inside a linux server. It is nevertheless
179 highly independent. As such, you can run various services with normal
180 configuration. The various vservers can't interact with each other and
181 can't interact with services in the main server.
183 This package contains header files and libraries which are needed to
184 develop VServer related applications.
188 Python modules for manipulating vservers. Provides a superset of the
189 functionality of the vserver script (at least will do in the future),
190 but more readily accessible from Python code.
194 %setup -q -n %name-%fullver
198 automake --add-missing
201 %configure --with-initrddir=%_initrddir --enable-release \
202 %{?_without_dietlibc:--disable-dietlibc} \
203 %{!?_without_legacy:--enable-apis=NOLEGACY} \
204 --with-initscripts=sysv
206 %__make %{?_smp_mflags} all
207 %{!?_without_doc:%__make %{?_smp_mflags} doc}
212 rm -rf $RPM_BUILD_ROOT
213 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
215 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
217 MANIFEST_CONFIG='%config' \
218 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
219 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
221 # install python bindings
222 %__make -C python DESTDIR="$PWD/tmp" install
223 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
224 install tmp%{_libdir}/python*/site-packages/*.{py,so} $RPM_BUILD_ROOT/%{_datadir}/%{name}/
225 install -D -m 755 python/bwlimit $RPM_BUILD_ROOT/%{_sbindir}/bwlimit
226 install -D -m 755 python/disklimit $RPM_BUILD_ROOT/%{_sbindir}/disklimit
234 rm -rf $RPM_BUILD_ROOT
238 test -d /vservers || mkdir -m0000 /vservers
239 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
241 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers "$f"
242 f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
243 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers "$f"
245 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
249 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
251 # add /bin/vsh to list of secure shells
252 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
253 echo /bin/vsh >> /etc/shells
258 # 0 = erase, 1 = upgrade
259 if [ "$1" = 0 ] ; then
260 perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
264 %post lib -p /sbin/ldconfig
265 %postun lib -p /sbin/ldconfig
269 #%chkconfig --add vservers-default
270 #%chkconfig --add vprocunhide
271 # PlanetLab Node Manager takes care of starting and stopping VServers
272 %chkconfig --del vservers-default
273 %chkconfig --del util-vserver
274 # PlanetLab does not require /proc security
275 %chkconfig --del vprocunhide
276 # vip6-autod handles IPv6 auto-assignments
277 %chkconfig --add vip6-autod
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
286 test "$1" != 0 || %chkconfig --del vip6-autod
290 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
293 %triggerin build -- fedora-release, centos-release
300 test -r "$i" || continue
302 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
306 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
307 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
308 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
312 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
314 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
315 ln -s /vservers/.hash "$f"/00
317 %_sbindir/setattr --barrier /vservers/.hash || :
321 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
324 ## Temporary workaround to remove old v_* files; it will conflict
325 ## somehow with the -legacy package but can be fixed by reinstalling
327 ## TODO: remove me in the final .spec file
328 %define v_services httpd named portmap sendmail smb sshd xinetd gated
329 %triggerun sysv -- util-vserver-sysv < 0.30.198
330 for i in %v_services; do
331 %chkconfig --del v_$i || :
336 # PlanetLab Node Manager takes care of starting and stopping VServers
337 #%chkconfig --add rebootmgr
338 #%chkconfig --add vservers-legacy
340 # PlanetLab does not require these legacy services
341 #for i in %v_services; do
342 # %chkconfig --add v_$i
347 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
349 #test "$1" != 0 || for i in %v_services; do
350 # %chkconfig --del v_$i
353 #test "$1" != 0 || %chkconfig --del rebootmgr
354 #test "$1" != 0 || %chkconfig --del vservers-legacy
357 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
360 %files -f %name-base.list
361 %defattr(-,root,root,-)
362 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
363 %doc doc/*.html doc/*.css
367 %dir %confdefaultdir/apps
368 %dir %confdefaultdir/files
369 %dir %pkglibdir/defaults
370 %ghost %confdefaultdir/cachebase
371 %ghost %confdefaultdir/vdirbase
372 %ghost %confdefaultdir/run.rev
374 %dir %_localstatedir/cache/vservers
375 %dir %_localstatedir/run/vservers
376 %dir %_localstatedir/run/vservers.rev
377 %dir %_localstatedir/run/vshelper
380 %files lib -f %name-lib.list
381 %files sysv -f %name-sysv.list
384 %files core -f %name-core.list
385 %defattr(-,root,root,-)
389 %files build -f %name-build.list
390 %defattr(-,root,root,-)
391 %doc contrib/yum*.patch
392 %dir %confdir/.distributions
393 %dir %confdir/.distributions/*
394 %dir %confdir/.distributions/*/apt
395 %dir %confdir/.distributions/.common
396 %dir %confdir/.distributions/.common/pubkeys
397 %dir %confdefaultdir/apps/vunify
398 %dir %confdefaultdir/apps/vunify/hash
401 %files legacy -f %name-legacy.list
402 %defattr(-,root,root,-)
403 %dir %pkglibdir/legacy
406 %files devel -f %name-devel.list
407 %defattr(-,root,root,-)
408 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
409 %{!?_without_doc:%doc lib/apidoc/html}
413 pushd %{_datadir}/%{name} >/dev/null
415 # Byte compile and install modules
417 for file in *.py ; do
418 if [ -n "$py_modules" ] ; then
419 py_modules="$py_modules,"
421 py_modules="$py_modules '${file%*.py}'"
423 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
427 # Install the prebuilt extensions by hand
428 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
429 install -m 755 *.so "$python_sitelib"/
434 %triggerpostun python -- util-vserver-python, util-vserver-py23
435 # RPMs get upgraded by installing the new one, then uninstalling the
436 # old one. Since we no longer own the byte-compiled modules, they may
437 # be removed right after we create them in %post if we are upgraded
438 # from a version that did own them at one point. This section should
439 # be removed once all packages have been upgraded to at least this
441 pushd %{_datadir}/%{name} >/dev/null
443 # Byte compile and install modules
445 for file in *.py ; do
446 if [ -n "$py_modules" ] ; then
447 py_modules="$py_modules,"
449 py_modules="$py_modules '${file%*.py}'"
451 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
455 # Install the prebuilt extensions by hand
456 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
457 install -m 755 *.so "$python_sitelib"/
463 # 0 = erase, 1 = upgrade
464 if [ $1 -eq 0 ] ; then
465 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
466 pushd %{_datadir}/%{name} >/dev/null
467 for file in *.py *.so ; do
468 rm -f "$python_sitelib"/${file}*
477 %{_sbindir}/disklimit
481 * Mon Jul 30 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
484 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
485 - add --with legacy and --without doc switches
486 - add util-vserver initscript
488 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
489 - add support for setting guaranteed CPU share flag in rspec
491 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
492 - do not require 'xalan' anymore by default
493 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
494 - removed 'chattr' leftovers
495 - create the '/etc/vservers/.defaults/cachebase' symlink
496 - added /var/cache/vservers and the needed support
497 - set barrier attribute on /vservers/.pkg and /vservers/.hash
498 - added 'centos-release' to the list of packages in the copy-the-keys
500 - create '/vservers/.hash' and add initial configuration for it
502 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
503 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
504 for a context that didn't exist would cause an error (it should be a
507 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
508 - fix bugs in python/vserverimpl.c where exceptions were not raised when
509 they should be and thus occured later at unexpected times
510 - add support for stopping a vserver
512 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
513 - add support for removing resource limits e.g., when a slice is deleted
515 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
516 - fix file descriptor leak in vduimpl
517 - clean up handling of network parameters
518 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
520 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
521 - fix Python modules to handling scheduling parameters correctly
523 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
527 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
528 - raise exception about being over disk limit after setting usage values
530 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
531 - create common function to be used for entering a vserver and applying
534 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
535 - restore build of python modules
537 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
538 - upgrade to util-vserver-0.30.208
539 - forward-port vbuild and legacy support until we can find a suitable
541 - make vsh use new vc_create_context() call
543 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
544 - add support for static vserver IDs to vuseradd and vuserdel
546 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
547 - add bwlimit and cpulimit modules
549 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
552 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
554 - require the -lib subpackage by -devel
555 - copy GPG keys from /etc/pki/rpm-gpg/
557 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
558 - import Marc's vdu implementation
560 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
561 - 'vserver-init start' functionality subsumed by Node Manager
563 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
564 - Fixed vlimit command
566 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
567 - add Python modules for manipulating vservers
569 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
570 - added patches to make yum work in chroot environments
573 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
574 - vuserdel changes: don't shutdown vserver, just kill all processes;
575 unmount all mountpoints in vserver before deleting
577 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
578 - added some %%descriptions
579 - copy GPG keys from the system into the confdir
580 - buildrequire dietlibc-0.25
581 - BuildRequire beecrypt-devel
583 - use %%global instead of %%define
584 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
586 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
587 - updated BuildRequires:
588 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
589 - moved the v_* initscripts to legacy
590 - do not ship the /vservers directory itself; as it is immutable, the
591 extraction will fail else
593 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
594 - vcached no longer runs as a daemon
595 - do not restart vservers when package is upgraded
597 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
600 - Both vcached and vuseradd now print a warning message when vbuild
601 succeeds but the resulting new vserver image is smaller in size than
602 the vserver-reference image.
603 - vuseradd: clean up some more junk on failure
605 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
607 - PL3026: This is the upgraded version of vdu that maintains an
608 internal hash table of files with a nlink count > 1. Only if vdu
609 sees all hard links to a particular inode does it add its size and
610 block count to the total.
612 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
613 - PL2445 Use -b option to du to avoid rounding errors.
615 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
617 - don't create the symbolic link /home/slice/.ssh, this is not how
620 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
623 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
624 - documented switches for 'rpmbuild'
626 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
627 - initial PlanetLab 3.0 build.
629 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
630 - (re)added the MANIFEST_* variables which were lost some time ago;
631 this will preserve %%config files...
633 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
634 - use file-list for sysv scripts also
636 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
637 - added vprocunhide-service support
638 - added doxygen support
641 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0