vshost-util-vserver

Build script and sources for util-vserver.
git clone https://ccx.te2000.cz/git/vshost-util-vserver
Log | Files | Refs

util-vserver.spec.in (14518B)


      1 # $Id$
      2 
      3 %if "%{?_without_python:1}" != "1"
      4 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
      5 %endif
      6 
      7 ## This package understands the following switches:
      8 ## --without dietlibc        ...   disable usage of dietlibc
      9 ## --with xalan              ...   require/use the xalan xslt processor
     10 ## --without doc             ...   disable doc generation
     11 ## --with legacy             ...   enable the legacy APIs
     12 ## --without python          ...   disable the Python bindings
     13 
     14 %global confdir		%_sysconfdir/vservers
     15 %global confdefaultdir	%confdir/.defaults
     16 %global pkglibdir	%_libdir/%name
     17 %global pkgdatadir	%_datadir/%name
     18 %global pkglibexecdir %_libexecdir/%name
     19 %global chkconfig	/sbin/chkconfig
     20 
     21 %global _localstatedir	%_var
     22 
     23 %global fullver		@VERSION@
     24 %global ver		%( echo %fullver | sed 's/-.*//' )
     25 %global subver		%( s=`echo %fullver | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
     26 
     27 
     28 # Mandriva does funky stuff that break us.
     29 %if %{?mandriva_release:1}%{!?mandriva_release:0}
     30 %global mandriva			1
     31 %global _disable_libtoolize		1
     32 %global _disable_ld_as_needed		1
     33 %global _disable_ld_no_undefined	1
     34 %global before_configure	\
     35 	%setup_compile_flags	\
     36 	CONFIGURE_TOP="${CONFIGURE_TOP:-.}"
     37 %endif
     38 
     39 
     40 %{!?release_func:%global release_func() %1%{?dist}}
     41 
     42 Summary:	Linux virtual server utilities
     43 Name:		@PACKAGE@
     44 Version:	%ver
     45 Release:	%release_func 0%subver
     46 License:	GPL
     47 Group:		System Environment/Base
     48 URL:		http://savannah.nongnu.org/projects/util-vserver/
     49 Source0:	http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2
     50 #Source1:	http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc
     51 BuildRoot:	%_tmppath/%name-%version-%release-root
     52 Requires:	init(%name)
     53 Requires:	%name-core = %version-%release
     54 Requires:	%name-lib  = %version-%release
     55 Requires:	diffutils mktemp sed
     56 Provides:	vserver = %version-%release
     57 Obsoletes:	vserver < %version
     58 BuildRequires:	/bin/mount gawk /sbin/ip iptables
     59 BuildRequires:	gcc-c++ wget which diffutils
     60 BuildRequires:	e2fsprogs-devel e2fsprogs
     61 %{!?_without_beecrypt:BuildRequires: beecrypt-devel}
     62 %{?_without_beecrypt:BuildRequires: nss-devel}
     63 BuildRequires:	e2fsprogs
     64 %{!?_without_doc:BuildRequires:	doxygen tetex-latex}
     65 %{!?_without_python:BuildRequires: python python-devel ctags}
     66 Requires(post):		%name-core
     67 Requires(pre):		%pkglibdir
     68 Requires(postun):	%pkglibdir
     69 %{!?_without_dietlibc:BuildRequires:	dietlibc >= 0:0.25}
     70 %{?_with_xalan:BuildRequires:	xalan-j}
     71 
     72 %package lib
     73 Summary:		Dynamic libraries for util-vserver
     74 Group:			System Environment/Libraries
     75 
     76 %package core
     77 Summary:		The core-utilities for util-vserver
     78 Group:			Applications/System
     79 Requires:		util-linux
     80 
     81 %package build
     82 Summary:		Tools which can be used to build vservers
     83 Group:			Applications/System
     84 Requires:		rpm wget binutils tar
     85 Requires:		%name = %version-%release
     86 Requires(pre):		%confdir
     87 Requires(postun):	%confdir
     88 Requires(post):		%name-core
     89 
     90 %package sysv
     91 Summary:		SysV-initscripts for vserver
     92 Group:			System Environment/Base
     93 Provides:		init(%name) = sysv
     94 Requires:		make diffutils
     95 Requires:		initscripts
     96 Requires:		%name = %version-%release
     97 Requires(post):		%chkconfig
     98 Requires(preun):	%chkconfig
     99 Requires(pre):		%_initrddir %pkglibdir
    100 requires(postun):	%_initrddir %pkglibdir
    101 
    102 %package legacy
    103 Summary:		Legacy utilities for util-vserver
    104 Group:			Applications/System
    105 Requires:		%name = %version-%release
    106 Requires(post):		%chkconfig
    107 Requires(preun):	%chkconfig
    108 Requires(pre):		%_initrddir %pkglibdir
    109 requires(postun):	%_initrddir %pkglibdir
    110 
    111 %package devel
    112 Summary:		Header-files and libraries needed to develop vserver based applications
    113 Group:			Development/Libraries
    114 Requires:		pkgconfig
    115 Requires:		%name-lib = %version-%release
    116 
    117 %package python
    118 Summary:		Python bindings to develop vserver-based applications
    119 Group:			Development/Libraries
    120 Requires:		%name-lib = %version-%release
    121 
    122 
    123 %description
    124 util-vserver provides the components and a framework to setup virtual
    125 servers.  A virtual server runs inside a linux server. It is nevertheless
    126 highly independent. As such, you can run various services with normal
    127 configuration. The various vservers can't interact with each other and
    128 can't interact with services in the main server.
    129 
    130 This requires a special kernel supporting the new new_s_context and
    131 set_ipv4root system call.
    132 
    133 %description lib
    134 util-vserver provides the components and a framework to setup virtual
    135 servers.  A virtual server runs inside a linux server. It is nevertheless
    136 highly independent. As such, you can run various services with normal
    137 configuration. The various vservers can't interact with each other and
    138 can't interact with services in the main server.
    139 
    140 This package contains the shared libraries needed by all other
    141 'util-vserver' subpackages.
    142 
    143 %description core
    144 util-vserver provides the components and a framework to setup virtual
    145 servers.  A virtual server runs inside a linux server. It is nevertheless
    146 highly independent. As such, you can run various services with normal
    147 configuration. The various vservers can't interact with each other and
    148 can't interact with services in the main server.
    149 
    150 This package contains utilities which are required to communicate with
    151 the Linux-Vserver enabled kernel.
    152 
    153 
    154 %description build
    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.
    160 
    161 This package contains utilities which assist in building Vservers.
    162 
    163 %description sysv
    164 util-vserver provides the components and a framework to setup virtual
    165 servers.  A virtual server runs inside a linux server. It is nevertheless
    166 highly independent. As such, you can run various services with normal
    167 configuration. The various vservers can't interact with each other and
    168 can't interact with services in the main server.
    169 
    170 This package contains the SysV initscripts which start and stop
    171 VServers and related tools.
    172 
    173 
    174 %description legacy
    175 util-vserver provides the components and a framework to setup virtual
    176 servers.  A virtual server runs inside a linux server. It is nevertheless
    177 highly independent. As such, you can run various services with normal
    178 configuration. The various vservers can't interact with each other and
    179 can't interact with services in the main server.
    180 
    181 This package contains the tools which are needed to work with VServers
    182 having an old-style configuration.
    183 
    184 
    185 %description devel
    186 util-vserver provides the components and a framework to setup virtual
    187 servers.  A virtual server runs inside a linux server. It is nevertheless
    188 highly independent. As such, you can run various services with normal
    189 configuration. The various vservers can't interact with each other and
    190 can't interact with services in the main server.
    191 
    192 This package contains header files and libraries which are needed to
    193 develop VServer related applications.
    194 
    195 %description python
    196 util-vserver provides the components and a framework to setup virtual
    197 servers.  A virtual server runs inside a linux server. It is nevertheless
    198 highly independent. As such, you can run various services with normal
    199 configuration. The various vservers can't interact with each other and
    200 can't interact with services in the main server.
    201 
    202 This package contains the files needed to interface with the
    203 Linux-VServer API from Python.
    204 
    205 
    206 %prep
    207 %setup -q -n %name-%fullver
    208 
    209 
    210 %build
    211 %configure --with-initrddir=%_initrddir --enable-release \
    212            %{?_without_dietlibc:--disable-dietlibc} \
    213            %{?_with_legacy:--enable-apis=NOLEGACY} \
    214            --with-initscripts=sysv \
    215            %{?_without_python:--without-python}
    216 
    217 %__make %{?_smp_mflags} all
    218 %{!?_without_doc:%__make %{?_smp_mflags} doc}
    219 
    220 
    221 %install
    222 rm -rf $RPM_BUILD_ROOT
    223 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
    224 
    225 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
    226 
    227 MANIFEST_CONFIG='%config' \
    228 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
    229 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
    230 
    231 
    232 %check
    233 %__make check
    234 
    235 
    236 %clean
    237 rm -rf $RPM_BUILD_ROOT
    238 
    239 
    240 %post
    241 test -d /vservers      || mkdir -m0000 /vservers
    242 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
    243 
    244 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
    245 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
    246 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
    247 
    248 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
    249 
    250 
    251 %preun
    252 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
    253 
    254 
    255 %post   lib -p /sbin/ldconfig
    256 %postun lib -p /sbin/ldconfig
    257 
    258 
    259 %post sysv
    260 %chkconfig --add vservers-default
    261 %chkconfig --add vprocunhide
    262 %chkconfig --add util-vserver
    263 
    264 
    265 
    266 %preun sysv
    267 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
    268 
    269 test "$1" != 0 || %chkconfig --del vprocunhide
    270 test "$1" != 0 || %chkconfig --del vservers-default
    271 test "$1" != 0 || %chkconfig --del util-vserver
    272 
    273 
    274 %postun sysv
    275 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
    276 
    277 
    278 %triggerin build -- fedora-release, centos-release
    279 function copy()
    280 {
    281     base=$1
    282     shift
    283 
    284     for i; do
    285 	test -r "$i" || continue
    286 
    287 	target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
    288 	cp -a "$i" "$target"
    289     done
    290 }
    291 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
    292 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
    293 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
    294 
    295 
    296 %pre build
    297 x="%_libdir/util-vserver/distributions/etch"
    298 test -d "$x" && mv "$x" "$x.rpmsave" || :
    299 
    300 
    301 %post build
    302 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
    303 
    304 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
    305 	ln -s /vservers/.hash "$f"/00
    306 
    307 %_sbindir/setattr --barrier /vservers/.hash || :
    308 
    309 
    310 %preun build
    311 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
    312 
    313 
    314 ## Temporary workaround to remove old v_* files; it will conflict
    315 ## somehow with the -legacy package but can be fixed by reinstalling
    316 ## this package.
    317 ## TODO: remove me in the final .spec file
    318 %define v_services	httpd named portmap sendmail smb sshd xinetd gated
    319 %triggerun sysv -- util-vserver-sysv < 0.30.198
    320 for i in %v_services; do
    321 	%chkconfig --del v_$i || :
    322 done
    323 
    324 
    325 %post legacy
    326 %chkconfig --add rebootmgr
    327 %chkconfig --add vservers-legacy
    328 
    329 for i in %v_services; do
    330 	%chkconfig --add v_$i
    331 done
    332 
    333 
    334 %preun legacy
    335 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
    336 
    337 test "$1" != 0 || for i in %v_services; do
    338 	%chkconfig --del v_$i
    339 done
    340 
    341 test "$1" != 0 || %chkconfig --del rebootmgr
    342 test "$1" != 0 || %chkconfig --del vservers-legacy
    343 
    344 %postun legacy
    345 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
    346 
    347 
    348 %files -f %name-base.list
    349 %defattr(-,root,root,-)
    350 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
    351 %doc doc/*.html doc/*.css
    352 %ghost %confdefaultdir/cachebase
    353 %ghost %confdefaultdir/vdirbase
    354 %ghost %confdefaultdir/run.rev
    355 
    356 
    357 %files lib -f %name-lib.list
    358 %files sysv -f %name-sysv.list
    359 
    360 
    361 %files core -f %name-core.list
    362 %defattr(-,root,root,-)
    363 
    364 
    365 %files build -f %name-build.list
    366 %defattr(-,root,root,-)
    367 %doc contrib/yum*.patch
    368 %dir %confdir/.distributions/*
    369 %dir %confdir/.distributions/*/apt
    370 
    371 
    372 %files legacy -f %name-legacy.list
    373 %defattr(-,root,root,-)
    374 
    375 
    376 %files devel -f %name-devel.list
    377 %defattr(-,root,root,-)
    378 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
    379 %{!?_without_doc:%doc lib/apidoc/html}
    380 
    381 
    382 %if 0%{!?_without_python:1}
    383 %files python -f %name-python.list
    384 %defattr(-,root,root,-)
    385 %endif
    386 
    387 
    388 %changelog
    389 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
    390 - updated URLs
    391 - get rid of e2fsprogs requirement
    392 
    393 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
    394 - add --with legacy and --without doc switches
    395 - add util-vserver initscript
    396 
    397 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
    398 - do not require 'xalan' anymore by default
    399 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
    400 - removed 'chattr' leftovers
    401 - create the '/etc/vservers/.defaults/cachebase' symlink
    402 - added /var/cache/vservers and the needed support
    403 - set barrier attribute on /vservers/.pkg and /vservers/.hash
    404 - added 'centos-release' to the list of packages in the copy-the-keys
    405   trigger script
    406 - create '/vservers/.hash' and add initial configuration for it
    407 
    408 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
    409 - version 0.30.209
    410 - copy centos keys
    411 
    412 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
    413 - updated URLs
    414 
    415 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
    416 - version 0.30.208
    417 - require the -lib subpackage by -devel
    418 - copy GPG keys from /etc/pki/rpm-gpg/
    419 
    420 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
    421 - added patches to make yum work in chroot environments
    422 - version 0.30.206
    423 
    424 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
    425 - added some %%descriptions
    426 - copy GPG keys from the system into the confdir
    427 - buildrequire dietlibc-0.25
    428 - BuildRequire beecrypt-devel
    429 - cleanups
    430 - use %%global instead of %%define
    431 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
    432 
    433 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
    434 - updated BuildRequires:
    435 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
    436 - moved the v_* initscripts to legacy
    437 - do not ship the /vservers directory itself; as it is immutable, the
    438   extraction will fail else
    439 
    440 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
    441 - documented switches for 'rpmbuild'
    442 
    443 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
    444 - (re)added the MANIFEST_* variables which were lost some time ago;
    445   this will preserve %%config files...
    446 
    447 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
    448 - use file-list for sysv scripts also
    449 
    450 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
    451 - added vprocunhide-service support
    452 - added doxygen support
    453 - updated Requires:
    454 
    455 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
    456 - Initial build.