# $Id$ ## This package understands the following switches: ## --without dietlibc ... disable usage of dietlibc ## --with xalan ... require/use the xalan xslt processor ## --without doc ... disable doc generation ## --with legacy ... enable the legacy APIs ## --without python ... disable the Python bindings %global confdir %_sysconfdir/vservers %global confdefaultdir %confdir/.defaults %global pkglibdir %_libdir/%name %global chkconfig /sbin/chkconfig %global vrdir /vservers %global fullver 0.30.216-pre2966 %global ver %( echo %fullver | sed 's/-.*//' ) %global subver %( s=`echo %fullver | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} ) # Mageia release %global rel 1 # Mandriva does funky stuff that break us. %if %{?mandriva_release:1}%{!?mandriva_release:0} %global mandriva 1 %global _disable_libtoolize 1 %global _disable_ld_as_needed 1 %global _disable_ld_no_undefined 1 %global before_configure \ %setup_compile_flags \ CONFIGURE_TOP="${CONFIGURE_TOP:-.}" %endif Summary: Linux virtual server utilities Name: util-vserver Version: %ver Release: 0%subver.%mkrel %rel License: GPLv2+ Group: System/Base URL: http://savannah.nongnu.org/projects/util-vserver/ Source0: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2 Patch0: util-vserver-0.30.216-pre2966-urpmi-fix.patch #Source1: http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc Requires: init(%name) Requires: %name-core = %version-%release Requires: %name-lib = %version-%release Requires: diffutils mktemp sed Provides: vserver = %version-%release Obsoletes: vserver < %version BuildRequires: mount vlan-utils gawk iproute2 iptables BuildRequires: gcc-c++ wget which diffutils BuildRequires: e2fsprogs-devel e2fsprogs %{!?_without_beecrypt:BuildRequires: beecrypt-devel} %{?_without_beecrypt:BuildRequires: nss-devel} BuildRequires: e2fsprogs %{!?_without_doc:BuildRequires: doxygen tetex-latex} %{!?_without_python:BuildRequires: python-devel ctags} Requires(post): %name-core %{!?_without_dietlibc:BuildRequires: dietlibc >= 0:0.25} %{?_with_xalan:BuildRequires: xalan-j} %package lib Summary: Dynamic libraries for util-vserver Group: System/Libraries %package core Summary: The core-utilities for util-vserver Group: System/Base Requires: util-linux %package build Summary: Tools which can be used to build vservers Group: System/Base Requires: wget binutils Requires: %name = %version-%release Requires(pre): %name = %version-%release Requires(postun): %name = %version-%release Requires(post): %name-core %package sysv Summary: SysV-initscripts for vserver Group: System/Base Provides: init(%name) = sysv Requires: make diffutils Requires: initscripts Requires: %name = %version-%release Requires(post): chkconfig Requires(preun): chkconfig Requires(pre): %name = %version-%release Requires(postun): %name = %version-%release %package legacy Summary: Legacy utilities for util-vserver Group: System/Base Requires: %name = %version-%release Requires(post): chkconfig Requires(preun): chkconfig Requires(pre): %name = %version-%release Requires(postun): %name = %version-%release %package devel Summary: Header-files and libraries needed to develop vserver based applications Group: Development/Other Requires: pkgconfig Requires: %name-lib = %version-%release %package python Summary: Python bindings to develop vserver-based applications Group: Development/Other Requires: %name-lib = %version-%release %description util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This requires a special kernel supporting the new new_s_context and set_ipv4root system call. %description lib util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains the shared libraries needed by all other 'util-vserver' subpackages. %description core util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains utilities which are required to communicate with the Linux-Vserver enabled kernel. %description build util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains utilities which assist in building Vservers. %description sysv util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains the SysV initscripts which start and stop VServers and related tools. %description legacy util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains the tools which are needed to work with VServers having an old-style configuration. %description devel util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains header files and libraries which are needed to develop VServer related applications. %description python util-vserver provides the components and a framework to setup virtual servers. A virtual server runs inside a linux server. It is nevertheless highly independent. As such, you can run various services with normal configuration. The various vservers can't interact with each other and can't interact with services in the main server. This package contains the files needed to interface with the Linux-VServer API from Python. %prep %setup -q -n %name-%fullver %patch0 -p1 %build %configure --with-initrddir=%_initrddir --enable-release \ --prefix=/usr --mandir=/usr/share/man \ --sysconfdir=/etc --localstatedir=/var \ %{?_without_dietlibc:--disable-dietlibc} \ %{?_with_legacy:--enable-apis=NOLEGACY} \ --with-initscripts=sysv \ %{?_without_python:--without-python} \ --with-vrootdir=%vrdir %__make %{?_smp_mflags} all %{!?_without_doc:%__make %{?_smp_mflags} doc} %install rm -rf $RPM_BUILD_ROOT %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution rm -f $RPM_BUILD_ROOT/%_libdir/*.la # create vrootdir and subdirs mkdir -p $RPM_BUILD_ROOT%vrdir mkdir -p $RPM_BUILD_ROOT%vrdir/.hash mkdir -p $RPM_BUILD_ROOT%vrdir/.pkg MANIFEST_CONFIG='%config' \ MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \ contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat %check %__make check %clean rm -rf $RPM_BUILD_ROOT %post f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s %vrdir "$f" f="%confdefaultdir/run.rev"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f" f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers "$f" %_sbindir/setattr --barrier %vrdir %vrdir/.pkg || : %preun test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || : %post lib -p /sbin/ldconfig %postun lib -p /sbin/ldconfig %post sysv %chkconfig --add vservers-default %chkconfig --add vprocunhide %chkconfig --add util-vserver %preun sysv test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || : test "$1" != 0 || %chkconfig --del vprocunhide test "$1" != 0 || %chkconfig --del vservers-default test "$1" != 0 || %chkconfig --del util-vserver %postun sysv test "$1" = 0 || %_initrddir/vprocunhide condrestart >/dev/null || : %triggerin build -- fedora-release, centos-release function copy() { base=$1 shift for i; do test -r "$i" || continue target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i") cp -a "$i" "$target" done } copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-* copy fedora /etc/pki/rpm-gpg/RPM-GPG-* copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-* %pre build x="%_libdir/util-vserver/distributions/etch" test -d "$x" && mv "$x" "$x.rpmsave" || : %post build f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \ ln -s %vrdir/.hash "$f"/00 %_sbindir/setattr --barrier %vrdir/.hash || : %preun build test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-* ## Temporary workaround to remove old v_* files; it will conflict ## somehow with the -legacy package but can be fixed by reinstalling ## this package. ## TODO: remove me in the final .spec file %define v_services httpd named portmap sendmail smb sshd xinetd gated %triggerun sysv -- util-vserver-sysv < 0.30.198 for i in %v_services; do %chkconfig --del v_$i || : done %post legacy %chkconfig --add rebootmgr %chkconfig --add vservers-legacy for i in %v_services; do %chkconfig --add v_$i done %preun legacy test "$1" != 0 || %_initrddir/rebootmgr stop &>/dev/null || : test "$1" != 0 || for i in %v_services; do %chkconfig --del v_$i done test "$1" != 0 || %chkconfig --del rebootmgr test "$1" != 0 || %chkconfig --del vservers-legacy %postun legacy test "$1" = 0 || %_initrddir/rebootmgr condrestart >/dev/null || : %files -f %name-base.list %defattr(-,root,root,-) %doc AUTHORS COPYING ChangeLog NEWS README THANKS %doc doc/*.html doc/*.css %attr(0000,root,root) %dir %vrdir %attr(0755,root,root) %dir %vrdir/.pkg %ghost %confdefaultdir/cachebase %ghost %confdefaultdir/vdirbase %ghost %confdefaultdir/run.rev %files lib -f %name-lib.list %files sysv -f %name-sysv.list %files core -f %name-core.list %defattr(-,root,root,-) %files build -f %name-build.list %defattr(-,root,root,-) %doc contrib/yum*.patch %dir %confdir/.distributions/* %dir %confdir/.distributions/*/apt %attr(0700,root,root) %dir %vrdir/.hash %files legacy -f %name-legacy.list %defattr(-,root,root,-) %files devel -f %name-devel.list %defattr(-,root,root,-) %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf} %{!?_without_doc:%doc lib/apidoc/html} %if 0%{!?_without_python:1} %files python -f %name-python.list %defattr(-,root,root,-) %endif %changelog * Wed May 11 2011 Herbert Poetzl 0.30.216-0.pre2966 - Update to pre2966 which includes urpm* support