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
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
279 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
281 #test "$1" != 0 || %chkconfig --del vprocunhide
282 #test "$1" != 0 || %chkconfig --del vservers-default
283 #test "$1" != 0 || %chkconfig --del util-vserver
287 #test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || :
290 %triggerin build -- fedora-release, centos-release
297 test -r "$i" || continue
299 target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
303 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
304 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
305 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
309 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
311 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
312 ln -s /vservers/.hash "$f"/00
314 %_sbindir/setattr --barrier /vservers/.hash || :
318 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
321 ## Temporary workaround to remove old v_* files; it will conflict
322 ## somehow with the -legacy package but can be fixed by reinstalling
324 ## TODO: remove me in the final .spec file
325 %define v_services httpd named portmap sendmail smb sshd xinetd gated
326 %triggerun sysv -- util-vserver-sysv < 0.30.198
327 for i in %v_services; do
328 %chkconfig --del v_$i || :
333 # PlanetLab Node Manager takes care of starting and stopping VServers
334 #%chkconfig --add rebootmgr
335 #%chkconfig --add vservers-legacy
337 # PlanetLab does not require these legacy services
338 #for i in %v_services; do
339 # %chkconfig --add v_$i
344 #test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || :
346 #test "$1" != 0 || for i in %v_services; do
347 # %chkconfig --del v_$i
350 #test "$1" != 0 || %chkconfig --del rebootmgr
351 #test "$1" != 0 || %chkconfig --del vservers-legacy
354 #test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || :
357 %files -f %name-base.list
358 %defattr(-,root,root,-)
359 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
360 %doc doc/*.html doc/*.css
364 %dir %confdefaultdir/apps
365 %dir %confdefaultdir/files
366 %dir %pkglibdir/defaults
367 %ghost %confdefaultdir/cachebase
368 %ghost %confdefaultdir/vdirbase
369 %ghost %confdefaultdir/run.rev
371 %dir %_localstatedir/cache/vservers
372 %dir %_localstatedir/run/vservers
373 %dir %_localstatedir/run/vservers.rev
374 %dir %_localstatedir/run/vshelper
377 %files lib -f %name-lib.list
378 %files sysv -f %name-sysv.list
381 %files core -f %name-core.list
382 %defattr(-,root,root,-)
386 %files build -f %name-build.list
387 %defattr(-,root,root,-)
388 %doc contrib/yum*.patch
389 %dir %confdir/.distributions
390 %dir %confdir/.distributions/*
391 %dir %confdir/.distributions/*/apt
392 %dir %confdir/.distributions/.common
393 %dir %confdir/.distributions/.common/pubkeys
394 %dir %confdefaultdir/apps/vunify
395 %dir %confdefaultdir/apps/vunify/hash
398 %files legacy -f %name-legacy.list
399 %defattr(-,root,root,-)
400 %dir %pkglibdir/legacy
403 %files devel -f %name-devel.list
404 %defattr(-,root,root,-)
405 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
406 %{!?_without_doc:%doc lib/apidoc/html}
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 -m 755 *.so "$python_sitelib"/
431 %triggerpostun python -- util-vserver-python, util-vserver-py23
432 # RPMs get upgraded by installing the new one, then uninstalling the
433 # old one. Since we no longer own the byte-compiled modules, they may
434 # be removed right after we create them in %post if we are upgraded
435 # from a version that did own them at one point. This section should
436 # be removed once all packages have been upgraded to at least this
438 pushd %{_datadir}/%{name} >/dev/null
440 # Byte compile and install modules
442 for file in *.py ; do
443 if [ -n "$py_modules" ] ; then
444 py_modules="$py_modules,"
446 py_modules="$py_modules '${file%*.py}'"
448 %define setup %{__python} -c "from distutils.core import setup; setup(py_modules=[$py_modules])"
452 # Install the prebuilt extensions by hand
453 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
454 install -m 755 *.so "$python_sitelib"/
460 # 0 = erase, 1 = upgrade
461 if [ $1 -eq 0 ] ; then
462 python_sitelib=$(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
463 pushd %{_datadir}/%{name} >/dev/null
464 for file in *.py *.so ; do
465 rm -f "$python_sitelib"/${file}*
474 %{_sbindir}/disklimit
478 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
479 - add --with legacy and --without doc switches
480 - add util-vserver initscript
482 * Fri Feb 17 2006 Steve Muir <smuir@cs.princeton.edu>
483 - add support for setting guaranteed CPU share flag in rspec
485 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
486 - do not require 'xalan' anymore by default
487 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
488 - removed 'chattr' leftovers
489 - create the '/etc/vservers/.defaults/cachebase' symlink
490 - added /var/cache/vservers and the needed support
491 - set barrier attribute on /vservers/.pkg and /vservers/.hash
492 - added 'centos-release' to the list of packages in the copy-the-keys
494 - create '/vservers/.hash' and add initial configuration for it
496 * Fri Jan 13 2006 Steve Muir <smuir@cs.princeton.edu>
497 - fix bug in python/vserverimpl.c where attempting to adjust CPU share
498 for a context that didn't exist would cause an error (it should be a
501 * Fri Dec 2 2005 Steve Muir <smuir@cs.princeton.edu>
502 - fix bugs in python/vserverimpl.c where exceptions were not raised when
503 they should be and thus occured later at unexpected times
504 - add support for stopping a vserver
506 * Wed Nov 9 2005 Steve Muir <smuir@cs.princeton.edu>
507 - add support for removing resource limits e.g., when a slice is deleted
509 * Mon Nov 7 2005 Steve Muir <smuir@cs.princeton.edu>
510 - fix file descriptor leak in vduimpl
511 - clean up handling of network parameters
512 - don't rely upon /etc/vservers/foo.conf to initialise vserver object
514 * Wed Nov 2 2005 Steve Muir <smuir@cs.princeton.edu>
515 - fix Python modules to handling scheduling parameters correctly
517 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
521 * Fri Oct 28 2005 Steve Muir <smuir@cs.princeton.edu>
522 - raise exception about being over disk limit after setting usage values
524 * Fri Oct 7 2005 Steve Muir <smuir@cs.princeton.edu>
525 - create common function to be used for entering a vserver and applying
528 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
529 - restore build of python modules
531 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
532 - upgrade to util-vserver-0.30.208
533 - forward-port vbuild and legacy support until we can find a suitable
535 - make vsh use new vc_create_context() call
537 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
538 - add support for static vserver IDs to vuseradd and vuserdel
540 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
541 - add bwlimit and cpulimit modules
543 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
546 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
548 - require the -lib subpackage by -devel
549 - copy GPG keys from /etc/pki/rpm-gpg/
551 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
552 - import Marc's vdu implementation
554 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
555 - 'vserver-init start' functionality subsumed by Node Manager
557 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
558 - Fixed vlimit command
560 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
561 - add Python modules for manipulating vservers
563 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
564 - added patches to make yum work in chroot environments
567 * Thu Apr 7 2005 Steve Muir <smuir@cs.princeton.edu>
568 - vuserdel changes: don't shutdown vserver, just kill all processes;
569 unmount all mountpoints in vserver before deleting
571 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
572 - added some %%descriptions
573 - copy GPG keys from the system into the confdir
574 - buildrequire dietlibc-0.25
575 - BuildRequire beecrypt-devel
577 - use %%global instead of %%define
578 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
580 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
581 - updated BuildRequires:
582 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
583 - moved the v_* initscripts to legacy
584 - do not ship the /vservers directory itself; as it is immutable, the
585 extraction will fail else
587 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
588 - vcached no longer runs as a daemon
589 - do not restart vservers when package is upgraded
591 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
594 - Both vcached and vuseradd now print a warning message when vbuild
595 succeeds but the resulting new vserver image is smaller in size than
596 the vserver-reference image.
597 - vuseradd: clean up some more junk on failure
599 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
601 - PL3026: This is the upgraded version of vdu that maintains an
602 internal hash table of files with a nlink count > 1. Only if vdu
603 sees all hard links to a particular inode does it add its size and
604 block count to the total.
606 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
607 - PL2445 Use -b option to du to avoid rounding errors.
609 * Sat Nov 6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
611 - don't create the symbolic link /home/slice/.ssh, this is not how
614 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
617 * Thu Sep 9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
618 - documented switches for 'rpmbuild'
620 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
621 - initial PlanetLab 3.0 build.
623 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
624 - (re)added the MANIFEST_* variables which were lost some time ago;
625 this will preserve %%config files...
627 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
628 - use file-list for sysv scripts also
630 * Sat Mar 6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
631 - added vprocunhide-service support
632 - added doxygen support
635 * Wed Oct 1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0