fix
[util-vserver.git] / util-vserver.spec
1 #
2 # $Id$
3 # $URL$
4 #
5 ## This package understands the following switches:
6 ## --without dietlibc        ...   disable usage of dietlibc
7 ## --with    xalan           ...   require/use the xalan xslt processor
8
9 ## Fedora Extras specific customization below...
10
11 %ifarch ppc64
12 ## fails because '__sigsetjmp' and '__longjmp' are undefined
13 %bcond_with             dietlibc
14 %else
15 %bcond_without          dietlibc
16 %endif
17
18 %bcond_with             xalan
19 ##
20
21 %global confdir         %_sysconfdir/vservers
22 %global confdefaultdir  %confdir/.defaults
23 %global pkglibdir       %_libdir/%name
24 %global chkconfig       /sbin/chkconfig
25
26 %global _localstatedir  %_var
27
28 %{!?python_sitearch:%global python_sitearch %(%__python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
29
30 %global release pre2864
31
32 Summary:        Linux virtual server utilities
33 Name:           util-vserver
34 Version:        0.30.216
35 Release:        %release
36 License:        GPLv2
37 Group:          System Environment/Base
38 URL:            http://savannah.nongnu.org/projects/util-vserver/
39 Source0:        http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version-%release.tar.bz2
40 #Source1:       http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%version.tar.bz2.asc
41
42 BuildRoot:      %_tmppath/%name-%version-%release-root
43 Requires:       init(%name)
44 Requires:       %name-core = %version-%release
45 Requires:       %name-lib  = %version-%release
46 Requires:       diffutils mktemp sed
47 Provides:       vserver = %version-%release
48 Obsoletes:      vserver < %version
49 BuildRequires:  mount vconfig gawk iproute iptables
50 BuildRequires:  gcc-c++ wget which diffutils
51 BuildRequires:  e2fsprogs-devel nss-devel
52 BuildRequires:  doxygen tetex-latex graphviz ghostscript
53 BuildRequires:  libxslt rsync dump
54 Requires(post):         %name-core
55 Requires(pre):          %pkglibdir
56 Requires(postun):       %pkglibdir
57 %{?with_dietlibc:BuildRequires: dietlibc}
58 %{?with_xalan:BuildRequires:    xalan-j}
59
60 %package lib
61 Summary:                Dynamic libraries for util-vserver
62 Group:                  System Environment/Libraries
63
64 %package core
65 Summary:                The core-utilities for util-vserver
66 Group:                  Applications/System
67 Requires:               util-linux
68
69 %package build
70 Summary:                Tools which can be used to build vservers
71 Group:                  Applications/System
72 Requires:               rpm wget binutils tar
73 Requires:               %name = %version-%release
74 Requires(pre):          %confdir
75 Requires(postun):       %confdir
76 Requires(post):         %name-core
77
78 %package sysv
79 Summary:                SysV-initscripts for vserver
80 Group:                  System Environment/Base
81 Provides:               init(%name) = sysv
82 Requires:               make diffutils
83 Requires:               initscripts
84 Requires:               %name = %version-%release
85 Requires(post):         %chkconfig
86 Requires(preun):        %chkconfig
87 Requires(pre):          %_initrddir %pkglibdir
88 requires(postun):       %_initrddir %pkglibdir
89
90 %package legacy
91 Summary:                Legacy utilities for util-vserver
92 Group:                  Applications/System
93 Requires:               %name = %version-%release
94 Requires(post):         %chkconfig
95 Requires(preun):        %chkconfig
96 Requires(pre):          %_initrddir %pkglibdir
97 requires(postun):       %_initrddir %pkglibdir
98
99 %package devel
100 Summary:                Header-files and libraries needed to develop vserver based applications
101 Group:                  Development/Libraries
102 Requires:               pkgconfig
103 Requires:               %name-lib = %version-%release
104
105 %package python
106 Summary:                Python bindings to develop vserver-based applications
107 Group:                  Development/Libraries
108 BuildRequires:          python-devel ctags
109 Requires:               %name-lib = %version-%release
110
111
112 %description
113 util-vserver provides the components and a framework to setup virtual
114 servers.  A virtual server runs inside a linux server. It is nevertheless
115 highly independent. As such, you can run various services with normal
116 configuration. The various vservers can't interact with each other and
117 can't interact with services in the main server.
118
119 This requires a special kernel supporting the new new_s_context and
120 set_ipv4root system call.
121
122 %description lib
123 util-vserver provides the components and a framework to setup virtual
124 servers.  A virtual server runs inside a linux server. It is nevertheless
125 highly independent. As such, you can run various services with normal
126 configuration. The various vservers can't interact with each other and
127 can't interact with services in the main server.
128
129 This package contains the shared libraries needed by all other
130 'util-vserver' subpackages.
131
132 %description core
133 util-vserver provides the components and a framework to setup virtual
134 servers.  A virtual server runs inside a linux server. It is nevertheless
135 highly independent. As such, you can run various services with normal
136 configuration. The various vservers can't interact with each other and
137 can't interact with services in the main server.
138
139 This package contains utilities which are required to communicate with
140 the Linux-Vserver enabled kernel.
141
142
143 %description build
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 assist in building Vservers.
151
152 %description sysv
153 util-vserver provides the components and a framework to setup virtual
154 servers.  A virtual server runs inside a linux server. It is nevertheless
155 highly independent. As such, you can run various services with normal
156 configuration. The various vservers can't interact with each other and
157 can't interact with services in the main server.
158
159 This package contains the SysV initscripts which start and stop
160 VServers and related tools.
161
162
163 %description legacy
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 tools which are needed to work with VServers
171 having an old-style configuration.
172
173
174 %description devel
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 header files and libraries which are needed to
182 develop VServer related applications.
183
184 %description python
185 util-vserver provides the components and a framework to setup virtual
186 servers.  A virtual server runs inside a linux server. It is nevertheless
187 highly independent. As such, you can run various services with normal
188 configuration. The various vservers can't interact with each other and
189 can't interact with services in the main server.
190
191 This package contains the files needed to interface with the
192 Linux-VServer API from Python.
193
194
195 %prep
196 %setup -q -n %{name}-%{version}-%{release}
197
198 sed -i -e 's!^\(# chkconfig: \)[0-9]\+ !\1- !' sysv/*
199
200
201 %build
202 %configure --with-initrddir=%_initrddir --enable-release \
203            --with-crypto-api=nss \
204            --with-python \
205            %{!?with_dietlibc:--disable}%{?with_dietlibc:--enable}-dietlibc
206
207 %__make %{?_smp_mflags} all
208 %__make %{?_smp_mflags} doc
209
210
211 %install
212 rm -rf $RPM_BUILD_ROOT
213 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
214
215 rm -f $RPM_BUILD_ROOT%_libdir/*.la \
216       $RPM_BUILD_ROOT%python_sitearch/*.*a
217
218 MANIFEST_CONFIG='%config' \
219 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
220 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
221
222
223 %check
224 %__make check
225 LC_NUMERIC=de_DE.UTF-8 ./lib_internal/testsuite/crypto-speed || :
226
227
228 %clean
229 rm -rf $RPM_BUILD_ROOT
230
231
232 %post
233 test -d /vservers      || mkdir -m0000 /vservers
234 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
235
236 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
237 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
238 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
239
240 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
241
242
243 %preun
244 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
245
246
247 %post   lib -p /sbin/ldconfig
248 %postun lib -p /sbin/ldconfig
249
250
251 %post sysv
252 %chkconfig --add vservers-default
253 %chkconfig --add vprocunhide
254 %chkconfig --add util-vserver
255
256
257 %preun sysv
258 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
259
260 test "$1" != 0 || %chkconfig --del vprocunhide
261 test "$1" != 0 || %chkconfig --del vservers-default
262 test "$1" != 0 || %chkconfig --del util-vserver
263
264
265 %postun sysv
266 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
267
268
269 %triggerin build -- fedora-release, centos-release
270 function copy()
271 {
272     base=$1
273     shift
274
275     for i; do
276         test -r "$i" || continue
277
278         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
279         cp -a "$i" "$target"
280     done
281 }
282 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
283 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
284 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
285
286
287 %post build
288 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
289
290 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
291         ln -s /vservers/.hash "$f"/00
292
293 %_sbindir/setattr --barrier /vservers/.hash || :
294
295
296 %preun build
297 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
298
299
300 ## Temporary workaround to remove old v_* files; it will conflict
301 ## somehow with the -legacy package but can be fixed by reinstalling
302 ## this package.
303 ## TODO: remove me in the final .spec file
304 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
305 %triggerun sysv -- util-vserver-sysv < 0.30.198
306 for i in %v_services; do
307         %chkconfig --del v_$i || :
308 done
309
310
311 %post legacy
312 %chkconfig --add rebootmgr
313 %chkconfig --add vservers-legacy
314
315 for i in %v_services; do
316         %chkconfig --add v_$i
317 done
318
319
320 %preun legacy
321 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
322
323 test "$1" != 0 || for i in %v_services; do
324         %chkconfig --del v_$i
325 done
326
327 test "$1" != 0 || %chkconfig --del rebootmgr
328 test "$1" != 0 || %chkconfig --del vservers-legacy
329
330 %postun legacy
331 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
332
333
334 %files -f %name-base.list
335 %defattr(-,root,root,-)
336 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
337 %doc doc/*.html doc/*.css
338 /sbin/vshelper
339 %dir %confdir
340 %dir %confdefaultdir
341 %dir %confdefaultdir/apps
342 %dir %confdefaultdir/files
343 %dir %pkglibdir/defaults
344 %ghost %confdefaultdir/cachebase
345 %ghost %confdefaultdir/vdirbase
346 %ghost %confdefaultdir/run.rev
347
348 %dir %_localstatedir/cache/vservers
349 %dir %_localstatedir/run/vservers
350 %dir %_localstatedir/run/vservers.rev
351 %dir %_localstatedir/run/vshelper
352
353
354 %files lib -f %name-lib.list
355 %files sysv -f %name-sysv.list
356
357
358 %files core -f %name-core.list
359 %defattr(-,root,root,-)
360 %dir %pkglibdir
361
362
363 %files build -f %name-build.list
364 %defattr(-,root,root,-)
365 %doc contrib/yum*.patch
366 %dir %confdir/.distributions
367 %dir %confdir/.distributions/*
368 %dir %confdir/.distributions/*/apt
369 %dir %confdir/.distributions/.common
370 %dir %confdir/.distributions/.common/pubkeys
371 %dir %confdefaultdir/apps/vunify
372 %dir %confdefaultdir/apps/vunify/hash
373
374
375 %files legacy -f %name-legacy.list
376 %defattr(-,root,root,-)
377 %dir %pkglibdir/legacy
378
379
380 %files devel -f %name-devel.list
381 %defattr(-,root,root,-)
382 %doc lib/apidoc/latex/refman.pdf
383 %doc lib/apidoc/html
384
385
386 %files python
387 %defattr(-,root,root,-)
388 %python_sitearch/*.so
389
390
391 %changelog
392 * Sun Aug 23 2009 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.215+svn2847-0
393 - updated to svn 2847 snapshot
394 - added -python subpackage
395
396 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.30.215-8
397 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
398
399 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.30.215-7
400 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
401
402 * Sat Oct 18 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.215-6
403 - rebuilt with recent dietlibc
404
405 * Sat Oct 18 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.215-5
406 - fixed build with recent rpm
407
408 * Mon Sep  8 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.30.215-4
409 - fix license tag
410
411 * Sat Apr 19 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.215-3
412 - reenabled %%check
413
414 * Mon Apr 14 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.30.215-2
415 - Temporarily disable check to get it to at least build and fix broken
416   dep in rawhide/F-9.
417
418 * Sat Apr 12 2008 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.215-1
419 - updated to 0.30.215
420 - use nss-devel instead of beecrypt-devel as BR
421 - run crypto-suite benchmark in %%check
422 - fixed initscript runlevels (#441311)
423
424 * Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0.30.214-3
425 - Autorebuild for GCC 4.3
426
427 * Wed Sep 19 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.214-2
428 - fixed upgrade path from 0.30.213 to 0.30.214; rpm fails to handle when
429   a directory becomes a symlink. Hence, remove the 'etch' directory in
430   %%pre
431
432 * Mon Sep  3 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.214-1
433 - updated to 0.30.214
434
435 * Sat Aug  4 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.213-2
436 - added patch to make 'vyum' work with a patched yum-3.2
437
438 * Thu May 31 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.213-1
439 - updated to 0.30.213
440 - disabled dietlibc build for PPC64
441 - enabled support for 'util-vserver' initscript
442
443 * Fri Apr 20 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.212-4
444 - BR some tools tested by ./configure
445
446 * Fri Jan 19 2007 David Woodhouse <dwmw2@infradead.org> - 0.30.212-3
447 - Build with 64KiB page size
448
449 * Fri Jan 19 2007 David Woodhouse <dwmw2@infradead.org> - 0.30.212-2
450 - rebuilt with PPC support
451
452 * Sun Dec 10 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.212-1
453 - updated to 0.30.212
454 - updated URLs
455 - requires 'rsync' for -build to support new 'rsync' build method
456
457 * Thu Oct 12 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.211-2
458 - added graphiz + ghostscript BR
459
460 * Thu Oct 12 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.211-1
461 - updated to 0.30.211
462
463 * Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 0.30.210-5
464 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
465
466 * Mon Sep 18 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-4
467 - rebuilt
468
469 * Sun Jul  9 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-3
470 - rebuilt with dietlibc-0.30
471
472 * Mon Feb 20 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-2
473 - rebuilt for FC5
474
475 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-1
476 - version 0.30.210
477 - removed patches which were from upstream
478
479 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
480 - do not require 'xalan' anymore by default
481 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
482 - removed 'chattr' leftovers
483 - create the '/etc/vservers/.defaults/cachebase' symlink
484 - added /var/cache/vservers and the needed support
485 - set barrier attribute on /vservers/.pkg and /vservers/.hash
486 - added 'centos-release' to the list of packages in the copy-the-keys
487   trigger script
488 - create '/vservers/.hash' and add initial configuration for it
489
490 * Thu Nov  3 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.209-4
491 - exclude PPC from build; see
492   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=172389
493 - added patch to make 'vyum' work with yum-2.4
494
495 * Tue Nov  1 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.209-3
496 - added lot of debug stuff to find out the reason for the 'make check'
497   failure on PPC (cflags & personlity get killed there)
498
499 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.209-2
500 - made sure that ensc_fmt/* it compiled with dietlibc. Else, it will
501   fail with the stack-protector in FC5's gcc
502
503 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-1
504 - version 0.30.209
505 - copy centos keys
506
507 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
508 - updated URLs
509
510 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
511 - version 0.30.208
512 - require the -lib subpackage by -devel
513 - copy GPG keys from /etc/pki/rpm-gpg/
514
515 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
516 - added patches to make yum work in chroot environments
517 - version 0.30.206
518
519 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-1
520 - added some %%descriptions
521 - copy GPG keys from the system into the confdir
522 - buildrequire dietlibc-0.25
523 - BuildRequire beecrypt-devel
524 - cleanups
525 - use %%global instead of %%define
526 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
527
528 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
529 - updated BuildRequires:
530 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
531 - moved the v_* initscripts to legacy
532 - do not ship the /vservers directory itself; as it is immutable, the
533   extraction will fail else
534
535 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
536 - documented switches for 'rpmbuild'
537
538 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
539 - (re)added the MANIFEST_* variables which were lost some time ago;
540   this will preserve %%config files...
541
542 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
543 - use file-list for sysv scripts also
544
545 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
546 - added vprocunhide-service support
547 - added doxygen support
548 - updated Requires:
549
550 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
551 - Initial build.