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