second attempt to have util-vserver ready for module-tools
[util-vserver.git] / util-vserver.spec.in
1 # $Id: util-vserver.spec.in 2626 2007-10-16 00:27:58Z dhozac $
2
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
8
9 %global confdir         %_sysconfdir/vservers
10 %global confdefaultdir  %confdir/.defaults
11 %global pkglibdir       %_libdir/%name
12 %global chkconfig       /sbin/chkconfig
13
14 %global _localstatedir  %_var
15
16 %global fullver @VERSION@
17 %global ver             %( echo %fullver | sed 's/-.*//' )
18 %global subver          %( s=`echo %fullver | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
19
20 # for module-tools
21 %global module_version_varname fullver
22 %global taglevel 2
23
24 %{!?release_func:%global release_func() %1%{?dist}}
25
26 Summary:        Linux virtual server utilities
27 Name:           @PACKAGE@
28 Version:        %ver
29 Release:        %taglevel
30 License:        GPL
31 Group:          System Environment/Base
32 URL:            http://savannah.nongnu.org/projects/util-vserver/
33 Source0:        http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2
34 #Source1:       http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc
35 BuildRoot:      %_tmppath/%name-%version-%release-root
36 Requires:       init(%name)
37 Requires:       %name-core = %version-%release
38 Requires:       %name-lib  = %version-%release
39 Requires:       diffutils mktemp sed
40 Provides:       vserver = %version-%release
41 Obsoletes:      vserver < %version
42 BuildRequires:  mount vconfig gawk iproute iptables
43 BuildRequires:  gcc-c++ wget which diffutils
44 BuildRequires:  e2fsprogs-devel beecrypt-devel
45 BuildRequires:  e2fsprogs
46 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
47 Requires(post):         %name-core
48 Requires(pre):          %pkglibdir
49 Requires(postun):       %pkglibdir
50 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
51 %{?_with_xalan:BuildRequires:   xalan-j}
52
53 %package lib
54 Summary:                Dynamic libraries for util-vserver
55 Group:                  System Environment/Libraries
56
57 %package core
58 Summary:                The core-utilities for util-vserver
59 Group:                  Applications/System
60 Requires:               util-linux
61
62 %package build
63 Summary:                Tools which can be used to build vservers
64 Group:                  Applications/System
65 Requires:               rpm wget binutils tar
66 Requires:               %name = %version-%release
67 Requires(pre):          %confdir
68 Requires(postun):       %confdir
69 Requires(post):         %name-core
70
71 %package sysv
72 Summary:                SysV-initscripts for vserver
73 Group:                  System Environment/Base
74 Provides:               init(%name) = sysv
75 Requires:               make diffutils
76 Requires:               initscripts
77 Requires:               %name = %version-%release
78 Requires(post):         %chkconfig
79 Requires(preun):        %chkconfig
80 Requires(pre):          %_initrddir %pkglibdir
81 requires(postun):       %_initrddir %pkglibdir
82
83 %package legacy
84 Summary:                Legacy utilities for util-vserver
85 Group:                  Applications/System
86 Requires:               %name = %version-%release
87 Requires(post):         %chkconfig
88 Requires(preun):        %chkconfig
89 Requires(pre):          %_initrddir %pkglibdir
90 requires(postun):       %_initrddir %pkglibdir
91
92 %package devel
93 Summary:                Header-files and libraries needed to develop vserver based applications
94 Group:                  Development/Libraries
95 Requires:               pkgconfig
96 Requires:               %name-lib = %version-%release
97
98
99 %description
100 util-vserver provides the components and a framework to setup virtual
101 servers.  A virtual server runs inside a linux server. It is nevertheless
102 highly independent. As such, you can run various services with normal
103 configuration. The various vservers can't interact with each other and
104 can't interact with services in the main server.
105
106 This requires a special kernel supporting the new new_s_context and
107 set_ipv4root system call.
108
109 %description lib
110 util-vserver provides the components and a framework to setup virtual
111 servers.  A virtual server runs inside a linux server. It is nevertheless
112 highly independent. As such, you can run various services with normal
113 configuration. The various vservers can't interact with each other and
114 can't interact with services in the main server.
115
116 This package contains the shared libraries needed by all other
117 'util-vserver' subpackages.
118
119 %description core
120 util-vserver provides the components and a framework to setup virtual
121 servers.  A virtual server runs inside a linux server. It is nevertheless
122 highly independent. As such, you can run various services with normal
123 configuration. The various vservers can't interact with each other and
124 can't interact with services in the main server.
125
126 This package contains utilities which are required to communicate with
127 the Linux-Vserver enabled kernel.
128
129
130 %description build
131 util-vserver provides the components and a framework to setup virtual
132 servers.  A virtual server runs inside a linux server. It is nevertheless
133 highly independent. As such, you can run various services with normal
134 configuration. The various vservers can't interact with each other and
135 can't interact with services in the main server.
136
137 This package contains utilities which assist in building Vservers.
138
139 %description sysv
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 the SysV initscripts which start and stop
147 VServers and related tools.
148
149
150 %description legacy
151 util-vserver provides the components and a framework to setup virtual
152 servers.  A virtual server runs inside a linux server. It is nevertheless
153 highly independent. As such, you can run various services with normal
154 configuration. The various vservers can't interact with each other and
155 can't interact with services in the main server.
156
157 This package contains the tools which are needed to work with VServers
158 having an old-style configuration.
159
160
161 %description devel
162 util-vserver provides the components and a framework to setup virtual
163 servers.  A virtual server runs inside a linux server. It is nevertheless
164 highly independent. As such, you can run various services with normal
165 configuration. The various vservers can't interact with each other and
166 can't interact with services in the main server.
167
168 This package contains header files and libraries which are needed to
169 develop VServer related applications.
170
171
172 %prep
173 %setup -q -n %name-%fullver
174
175
176 %build
177 %configure --with-initrddir=%_initrddir --enable-release \
178            %{?_without_dietlibc:--disable-dietlibc} \
179            %{?_with_legacy:--enable-apis=NOLEGACY} \
180            --with-initscripts=sysv
181
182 %__make %{?_smp_mflags} all
183 %{!?_without_doc:%__make %{?_smp_mflags} doc}
184
185
186 %install
187 rm -rf $RPM_BUILD_ROOT
188 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
189
190 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
191
192 MANIFEST_CONFIG='%config' \
193 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
194 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
195
196
197 %check || :
198 %__make check
199
200
201 %clean
202 rm -rf $RPM_BUILD_ROOT
203
204
205 %post
206 test -d /vservers      || mkdir -m0000 /vservers
207 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
208
209 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
210 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
211 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
212
213 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
214
215
216 %preun
217 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
218
219
220 %post   lib -p /sbin/ldconfig
221 %postun lib -p /sbin/ldconfig
222
223
224 %post sysv
225 %chkconfig --add vservers-default
226 %chkconfig --add vprocunhide
227 %chkconfig --add util-vserver
228
229
230
231 %preun sysv
232 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
233
234 test "$1" != 0 || %chkconfig --del vprocunhide
235 test "$1" != 0 || %chkconfig --del vservers-default
236 test "$1" != 0 || %chkconfig --del util-vserver
237
238
239 %postun sysv
240 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
241
242
243 %triggerin build -- fedora-release, centos-release
244 function copy()
245 {
246     base=$1
247     shift
248
249     for i; do
250         test -r "$i" || continue
251
252         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
253         cp -a "$i" "$target"
254     done
255 }
256 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
257 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
258 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
259
260
261 %post build
262 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
263
264 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
265         ln -s /vservers/.hash "$f"/00
266
267 %_sbindir/setattr --barrier /vservers/.hash || :
268
269
270 %preun build
271 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
272
273
274 ## Temporary workaround to remove old v_* files; it will conflict
275 ## somehow with the -legacy package but can be fixed by reinstalling
276 ## this package.
277 ## TODO: remove me in the final .spec file
278 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
279 %triggerun sysv -- util-vserver-sysv < 0.30.198
280 for i in %v_services; do
281         %chkconfig --del v_$i || :
282 done
283
284
285 %post legacy
286 %chkconfig --add rebootmgr
287 %chkconfig --add vservers-legacy
288
289 for i in %v_services; do
290         %chkconfig --add v_$i
291 done
292
293
294 %preun legacy
295 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
296
297 test "$1" != 0 || for i in %v_services; do
298         %chkconfig --del v_$i
299 done
300
301 test "$1" != 0 || %chkconfig --del rebootmgr
302 test "$1" != 0 || %chkconfig --del vservers-legacy
303
304 %postun legacy
305 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
306
307
308 %files -f %name-base.list
309 %defattr(-,root,root,-)
310 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
311 %doc doc/*.html doc/*.css
312 /sbin/vshelper
313 %dir %confdir
314 %dir %confdefaultdir
315 %dir %confdefaultdir/apps
316 %dir %confdefaultdir/files
317 %dir %pkglibdir/defaults
318 %ghost %confdefaultdir/cachebase
319 %ghost %confdefaultdir/vdirbase
320 %ghost %confdefaultdir/run.rev
321
322 %dir %_localstatedir/cache/vservers
323 %dir %_localstatedir/run/vservers
324 %dir %_localstatedir/run/vservers.rev
325 %dir %_localstatedir/run/vshelper
326
327
328 %files lib -f %name-lib.list
329 %files sysv -f %name-sysv.list
330
331
332 %files core -f %name-core.list
333 %defattr(-,root,root,-)
334 %dir %pkglibdir
335
336
337 %files build -f %name-build.list
338 %defattr(-,root,root,-)
339 %doc contrib/yum*.patch
340 %dir %confdir/.distributions
341 %dir %confdir/.distributions/*
342 %dir %confdir/.distributions/*/apt
343 %dir %confdir/.distributions/.common
344 %dir %confdir/.distributions/.common/pubkeys
345 %dir %confdefaultdir/apps/vunify
346 %dir %confdefaultdir/apps/vunify/hash
347
348
349 %files legacy -f %name-legacy.list
350 %defattr(-,root,root,-)
351 %dir %pkglibdir/legacy
352
353
354 %files devel -f %name-devel.list
355 %defattr(-,root,root,-)
356 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
357 %{!?_without_doc:%doc lib/apidoc/html}
358
359
360 %changelog
361 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
362 - updated URLs
363 - get rid of e2fsprogs requirement
364
365 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
366 - add --with legacy and --without doc switches
367 - add util-vserver initscript
368
369 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
370 - do not require 'xalan' anymore by default
371 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
372 - removed 'chattr' leftovers
373 - create the '/etc/vservers/.defaults/cachebase' symlink
374 - added /var/cache/vservers and the needed support
375 - set barrier attribute on /vservers/.pkg and /vservers/.hash
376 - added 'centos-release' to the list of packages in the copy-the-keys
377   trigger script
378 - create '/vservers/.hash' and add initial configuration for it
379
380 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
381 - version 0.30.209
382 - copy centos keys
383
384 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
385 - updated URLs
386
387 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
388 - version 0.30.208
389 - require the -lib subpackage by -devel
390 - copy GPG keys from /etc/pki/rpm-gpg/
391
392 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
393 - added patches to make yum work in chroot environments
394 - version 0.30.206
395
396 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
397 - added some %%descriptions
398 - copy GPG keys from the system into the confdir
399 - buildrequire dietlibc-0.25
400 - BuildRequire beecrypt-devel
401 - cleanups
402 - use %%global instead of %%define
403 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
404
405 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
406 - updated BuildRequires:
407 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
408 - moved the v_* initscripts to legacy
409 - do not ship the /vservers directory itself; as it is immutable, the
410   extraction will fail else
411
412 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
413 - documented switches for 'rpmbuild'
414
415 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
416 - (re)added the MANIFEST_* variables which were lost some time ago;
417   this will preserve %%config files...
418
419 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
420 - use file-list for sysv scripts also
421
422 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
423 - added vprocunhide-service support
424 - added doxygen support
425 - updated Requires:
426
427 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
428 - Initial build.
429 # $Id: util-vserver.spec.in 2626 2007-10-16 00:27:58Z dhozac $
430
431 ## This package understands the following switches:
432 ## --without dietlibc        ...   disable usage of dietlibc
433 ## --with xalan              ...   require/use the xalan xslt processor
434 ## --without doc             ...   disable doc generation
435 ## --with legacy             ...   enable the legacy APIs
436
437 %global confdir         %_sysconfdir/vservers
438 %global confdefaultdir  %confdir/.defaults
439 %global pkglibdir       %_libdir/%name
440 %global chkconfig       /sbin/chkconfig
441
442 %global _localstatedir  %_var
443
444 %global ver             %( echo @VERSION@ | sed 's/-.*//' )
445 %global subver          %( s=`echo @VERSION@ | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
446 %global fullver         @VERSION@
447
448
449 %{!?release_func:%global release_func() %1%{?dist}}
450
451 Summary:        Linux virtual server utilities
452 Name:           @PACKAGE@
453 Version:        %ver
454 Release:        %release_func 1%subver
455 License:        GPL
456 Group:          System Environment/Base
457 URL:            http://savannah.nongnu.org/projects/util-vserver/
458 Source0:        http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2
459 #Source1:       http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc
460 BuildRoot:      %_tmppath/%name-%version-%release-root
461 Requires:       init(%name)
462 Requires:       %name-core = %version-%release
463 Requires:       %name-lib  = %version-%release
464 Requires:       diffutils mktemp sed
465 Provides:       vserver = %version-%release
466 Obsoletes:      vserver < %version
467 BuildRequires:  mount vconfig gawk iproute iptables
468 BuildRequires:  gcc-c++ wget which diffutils
469 BuildRequires:  e2fsprogs-devel beecrypt-devel
470 BuildRequires:  e2fsprogs
471 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
472 Requires(post):         %name-core
473 Requires(pre):          %pkglibdir
474 Requires(postun):       %pkglibdir
475 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
476 %{?_with_xalan:BuildRequires:   xalan-j}
477
478 %package lib
479 Summary:                Dynamic libraries for util-vserver
480 Group:                  System Environment/Libraries
481
482 %package core
483 Summary:                The core-utilities for util-vserver
484 Group:                  Applications/System
485 Requires:               util-linux
486
487 %package build
488 Summary:                Tools which can be used to build vservers
489 Group:                  Applications/System
490 Requires:               rpm wget binutils tar
491 Requires:               %name = %version-%release
492 Requires(pre):          %confdir
493 Requires(postun):       %confdir
494 Requires(post):         %name-core
495
496 %package sysv
497 Summary:                SysV-initscripts for vserver
498 Group:                  System Environment/Base
499 Provides:               init(%name) = sysv
500 Requires:               make diffutils
501 Requires:               initscripts
502 Requires:               %name = %version-%release
503 Requires(post):         %chkconfig
504 Requires(preun):        %chkconfig
505 Requires(pre):          %_initrddir %pkglibdir
506 requires(postun):       %_initrddir %pkglibdir
507
508 %package legacy
509 Summary:                Legacy utilities for util-vserver
510 Group:                  Applications/System
511 Requires:               %name = %version-%release
512 Requires(post):         %chkconfig
513 Requires(preun):        %chkconfig
514 Requires(pre):          %_initrddir %pkglibdir
515 requires(postun):       %_initrddir %pkglibdir
516
517 %package devel
518 Summary:                Header-files and libraries needed to develop vserver based applications
519 Group:                  Development/Libraries
520 Requires:               pkgconfig
521 Requires:               %name-lib = %version-%release
522
523
524 %description
525 util-vserver provides the components and a framework to setup virtual
526 servers.  A virtual server runs inside a linux server. It is nevertheless
527 highly independent. As such, you can run various services with normal
528 configuration. The various vservers can't interact with each other and
529 can't interact with services in the main server.
530
531 This requires a special kernel supporting the new new_s_context and
532 set_ipv4root system call.
533
534 %description lib
535 util-vserver provides the components and a framework to setup virtual
536 servers.  A virtual server runs inside a linux server. It is nevertheless
537 highly independent. As such, you can run various services with normal
538 configuration. The various vservers can't interact with each other and
539 can't interact with services in the main server.
540
541 This package contains the shared libraries needed by all other
542 'util-vserver' subpackages.
543
544 %description core
545 util-vserver provides the components and a framework to setup virtual
546 servers.  A virtual server runs inside a linux server. It is nevertheless
547 highly independent. As such, you can run various services with normal
548 configuration. The various vservers can't interact with each other and
549 can't interact with services in the main server.
550
551 This package contains utilities which are required to communicate with
552 the Linux-Vserver enabled kernel.
553
554
555 %description build
556 util-vserver provides the components and a framework to setup virtual
557 servers.  A virtual server runs inside a linux server. It is nevertheless
558 highly independent. As such, you can run various services with normal
559 configuration. The various vservers can't interact with each other and
560 can't interact with services in the main server.
561
562 This package contains utilities which assist in building Vservers.
563
564 %description sysv
565 util-vserver provides the components and a framework to setup virtual
566 servers.  A virtual server runs inside a linux server. It is nevertheless
567 highly independent. As such, you can run various services with normal
568 configuration. The various vservers can't interact with each other and
569 can't interact with services in the main server.
570
571 This package contains the SysV initscripts which start and stop
572 VServers and related tools.
573
574
575 %description legacy
576 util-vserver provides the components and a framework to setup virtual
577 servers.  A virtual server runs inside a linux server. It is nevertheless
578 highly independent. As such, you can run various services with normal
579 configuration. The various vservers can't interact with each other and
580 can't interact with services in the main server.
581
582 This package contains the tools which are needed to work with VServers
583 having an old-style configuration.
584
585
586 %description devel
587 util-vserver provides the components and a framework to setup virtual
588 servers.  A virtual server runs inside a linux server. It is nevertheless
589 highly independent. As such, you can run various services with normal
590 configuration. The various vservers can't interact with each other and
591 can't interact with services in the main server.
592
593 This package contains header files and libraries which are needed to
594 develop VServer related applications.
595
596
597 %prep
598 %setup -q -n %name-%fullver
599
600
601 %build
602 %configure --with-initrddir=%_initrddir --enable-release \
603            %{?_without_dietlibc:--disable-dietlibc} \
604            %{?_with_legacy:--enable-apis=NOLEGACY} \
605            --with-initscripts=sysv
606
607 %__make %{?_smp_mflags} all
608 %{!?_without_doc:%__make %{?_smp_mflags} doc}
609
610
611 %install
612 rm -rf $RPM_BUILD_ROOT
613 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
614
615 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
616
617 MANIFEST_CONFIG='%config' \
618 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
619 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
620
621
622 %check || :
623 %__make check
624
625
626 %clean
627 rm -rf $RPM_BUILD_ROOT
628
629
630 %post
631 test -d /vservers      || mkdir -m0000 /vservers
632 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
633
634 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
635 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
636 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
637
638 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
639
640
641 %preun
642 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
643
644
645 %post   lib -p /sbin/ldconfig
646 %postun lib -p /sbin/ldconfig
647
648
649 %post sysv
650 %chkconfig --add vservers-default
651 %chkconfig --add vprocunhide
652 %chkconfig --add util-vserver
653
654
655
656 %preun sysv
657 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
658
659 test "$1" != 0 || %chkconfig --del vprocunhide
660 test "$1" != 0 || %chkconfig --del vservers-default
661 test "$1" != 0 || %chkconfig --del util-vserver
662
663
664 %postun sysv
665 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
666
667
668 %triggerin build -- fedora-release, centos-release
669 function copy()
670 {
671     base=$1
672     shift
673
674     for i; do
675         test -r "$i" || continue
676
677         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
678         cp -a "$i" "$target"
679     done
680 }
681 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
682 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
683 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
684
685
686 %post build
687 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
688
689 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
690         ln -s /vservers/.hash "$f"/00
691
692 %_sbindir/setattr --barrier /vservers/.hash || :
693
694
695 %preun build
696 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
697
698
699 ## Temporary workaround to remove old v_* files; it will conflict
700 ## somehow with the -legacy package but can be fixed by reinstalling
701 ## this package.
702 ## TODO: remove me in the final .spec file
703 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
704 %triggerun sysv -- util-vserver-sysv < 0.30.198
705 for i in %v_services; do
706         %chkconfig --del v_$i || :
707 done
708
709
710 %post legacy
711 %chkconfig --add rebootmgr
712 %chkconfig --add vservers-legacy
713
714 for i in %v_services; do
715         %chkconfig --add v_$i
716 done
717
718
719 %preun legacy
720 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
721
722 test "$1" != 0 || for i in %v_services; do
723         %chkconfig --del v_$i
724 done
725
726 test "$1" != 0 || %chkconfig --del rebootmgr
727 test "$1" != 0 || %chkconfig --del vservers-legacy
728
729 %postun legacy
730 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
731
732
733 %files -f %name-base.list
734 %defattr(-,root,root,-)
735 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
736 %doc doc/*.html doc/*.css
737 /sbin/vshelper
738 %dir %confdir
739 %dir %confdefaultdir
740 %dir %confdefaultdir/apps
741 %dir %confdefaultdir/files
742 %dir %pkglibdir/defaults
743 %ghost %confdefaultdir/cachebase
744 %ghost %confdefaultdir/vdirbase
745 %ghost %confdefaultdir/run.rev
746
747 %dir %_localstatedir/cache/vservers
748 %dir %_localstatedir/run/vservers
749 %dir %_localstatedir/run/vservers.rev
750 %dir %_localstatedir/run/vshelper
751
752
753 %files lib -f %name-lib.list
754 %files sysv -f %name-sysv.list
755
756
757 %files core -f %name-core.list
758 %defattr(-,root,root,-)
759 %dir %pkglibdir
760
761
762 %files build -f %name-build.list
763 %defattr(-,root,root,-)
764 %doc contrib/yum*.patch
765 %dir %confdir/.distributions
766 %dir %confdir/.distributions/*
767 %dir %confdir/.distributions/*/apt
768 %dir %confdir/.distributions/.common
769 %dir %confdir/.distributions/.common/pubkeys
770 %dir %confdefaultdir/apps/vunify
771 %dir %confdefaultdir/apps/vunify/hash
772
773
774 %files legacy -f %name-legacy.list
775 %defattr(-,root,root,-)
776 %dir %pkglibdir/legacy
777
778
779 %files devel -f %name-devel.list
780 %defattr(-,root,root,-)
781 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
782 %{!?_without_doc:%doc lib/apidoc/html}
783
784
785 %changelog
786 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
787 - updated URLs
788 - get rid of e2fsprogs requirement
789
790 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
791 - add --with legacy and --without doc switches
792 - add util-vserver initscript
793
794 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
795 - do not require 'xalan' anymore by default
796 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
797 - removed 'chattr' leftovers
798 - create the '/etc/vservers/.defaults/cachebase' symlink
799 - added /var/cache/vservers and the needed support
800 - set barrier attribute on /vservers/.pkg and /vservers/.hash
801 - added 'centos-release' to the list of packages in the copy-the-keys
802   trigger script
803 - create '/vservers/.hash' and add initial configuration for it
804
805 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
806 - version 0.30.209
807 - copy centos keys
808
809 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
810 - updated URLs
811
812 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
813 - version 0.30.208
814 - require the -lib subpackage by -devel
815 - copy GPG keys from /etc/pki/rpm-gpg/
816
817 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
818 - added patches to make yum work in chroot environments
819 - version 0.30.206
820
821 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
822 - added some %%descriptions
823 - copy GPG keys from the system into the confdir
824 - buildrequire dietlibc-0.25
825 - BuildRequire beecrypt-devel
826 - cleanups
827 - use %%global instead of %%define
828 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
829
830 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
831 - updated BuildRequires:
832 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
833 - moved the v_* initscripts to legacy
834 - do not ship the /vservers directory itself; as it is immutable, the
835   extraction will fail else
836
837 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
838 - documented switches for 'rpmbuild'
839
840 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
841 - (re)added the MANIFEST_* variables which were lost some time ago;
842   this will preserve %%config files...
843
844 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
845 - use file-list for sysv scripts also
846
847 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
848 - added vprocunhide-service support
849 - added doxygen support
850 - updated Requires:
851
852 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
853 - Initial build.
854 # $Id: util-vserver.spec.in 2626 2007-10-16 00:27:58Z dhozac $
855
856 ## This package understands the following switches:
857 ## --without dietlibc        ...   disable usage of dietlibc
858 ## --with xalan              ...   require/use the xalan xslt processor
859 ## --without doc             ...   disable doc generation
860 ## --with legacy             ...   enable the legacy APIs
861
862 %global confdir         %_sysconfdir/vservers
863 %global confdefaultdir  %confdir/.defaults
864 %global pkglibdir       %_libdir/%name
865 %global chkconfig       /sbin/chkconfig
866
867 %global _localstatedir  %_var
868
869 %global ver             %( echo @VERSION@ | sed 's/-.*//' )
870 %global subver          %( s=`echo @VERSION@ | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
871 %global fullver         @VERSION@
872
873
874 %{!?release_func:%global release_func() %1%{?dist}}
875
876 Summary:        Linux virtual server utilities
877 Name:           @PACKAGE@
878 Version:        %ver
879 Release:        %release_func 1%subver
880 License:        GPL
881 Group:          System Environment/Base
882 URL:            http://savannah.nongnu.org/projects/util-vserver/
883 Source0:        http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2
884 #Source1:       http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc
885 BuildRoot:      %_tmppath/%name-%version-%release-root
886 Requires:       init(%name)
887 Requires:       %name-core = %version-%release
888 Requires:       %name-lib  = %version-%release
889 Requires:       diffutils mktemp sed
890 Provides:       vserver = %version-%release
891 Obsoletes:      vserver < %version
892 BuildRequires:  mount vconfig gawk iproute iptables
893 BuildRequires:  gcc-c++ wget which diffutils
894 BuildRequires:  e2fsprogs-devel beecrypt-devel
895 BuildRequires:  e2fsprogs
896 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
897 Requires(post):         %name-core
898 Requires(pre):          %pkglibdir
899 Requires(postun):       %pkglibdir
900 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
901 %{?_with_xalan:BuildRequires:   xalan-j}
902
903 %package lib
904 Summary:                Dynamic libraries for util-vserver
905 Group:                  System Environment/Libraries
906
907 %package core
908 Summary:                The core-utilities for util-vserver
909 Group:                  Applications/System
910 Requires:               util-linux
911
912 %package build
913 Summary:                Tools which can be used to build vservers
914 Group:                  Applications/System
915 Requires:               rpm wget binutils tar
916 Requires:               %name = %version-%release
917 Requires(pre):          %confdir
918 Requires(postun):       %confdir
919 Requires(post):         %name-core
920
921 %package sysv
922 Summary:                SysV-initscripts for vserver
923 Group:                  System Environment/Base
924 Provides:               init(%name) = sysv
925 Requires:               make diffutils
926 Requires:               initscripts
927 Requires:               %name = %version-%release
928 Requires(post):         %chkconfig
929 Requires(preun):        %chkconfig
930 Requires(pre):          %_initrddir %pkglibdir
931 requires(postun):       %_initrddir %pkglibdir
932
933 %package legacy
934 Summary:                Legacy utilities for util-vserver
935 Group:                  Applications/System
936 Requires:               %name = %version-%release
937 Requires(post):         %chkconfig
938 Requires(preun):        %chkconfig
939 Requires(pre):          %_initrddir %pkglibdir
940 requires(postun):       %_initrddir %pkglibdir
941
942 %package devel
943 Summary:                Header-files and libraries needed to develop vserver based applications
944 Group:                  Development/Libraries
945 Requires:               pkgconfig
946 Requires:               %name-lib = %version-%release
947
948
949 %description
950 util-vserver provides the components and a framework to setup virtual
951 servers.  A virtual server runs inside a linux server. It is nevertheless
952 highly independent. As such, you can run various services with normal
953 configuration. The various vservers can't interact with each other and
954 can't interact with services in the main server.
955
956 This requires a special kernel supporting the new new_s_context and
957 set_ipv4root system call.
958
959 %description lib
960 util-vserver provides the components and a framework to setup virtual
961 servers.  A virtual server runs inside a linux server. It is nevertheless
962 highly independent. As such, you can run various services with normal
963 configuration. The various vservers can't interact with each other and
964 can't interact with services in the main server.
965
966 This package contains the shared libraries needed by all other
967 'util-vserver' subpackages.
968
969 %description core
970 util-vserver provides the components and a framework to setup virtual
971 servers.  A virtual server runs inside a linux server. It is nevertheless
972 highly independent. As such, you can run various services with normal
973 configuration. The various vservers can't interact with each other and
974 can't interact with services in the main server.
975
976 This package contains utilities which are required to communicate with
977 the Linux-Vserver enabled kernel.
978
979
980 %description build
981 util-vserver provides the components and a framework to setup virtual
982 servers.  A virtual server runs inside a linux server. It is nevertheless
983 highly independent. As such, you can run various services with normal
984 configuration. The various vservers can't interact with each other and
985 can't interact with services in the main server.
986
987 This package contains utilities which assist in building Vservers.
988
989 %description sysv
990 util-vserver provides the components and a framework to setup virtual
991 servers.  A virtual server runs inside a linux server. It is nevertheless
992 highly independent. As such, you can run various services with normal
993 configuration. The various vservers can't interact with each other and
994 can't interact with services in the main server.
995
996 This package contains the SysV initscripts which start and stop
997 VServers and related tools.
998
999
1000 %description legacy
1001 util-vserver provides the components and a framework to setup virtual
1002 servers.  A virtual server runs inside a linux server. It is nevertheless
1003 highly independent. As such, you can run various services with normal
1004 configuration. The various vservers can't interact with each other and
1005 can't interact with services in the main server.
1006
1007 This package contains the tools which are needed to work with VServers
1008 having an old-style configuration.
1009
1010
1011 %description devel
1012 util-vserver provides the components and a framework to setup virtual
1013 servers.  A virtual server runs inside a linux server. It is nevertheless
1014 highly independent. As such, you can run various services with normal
1015 configuration. The various vservers can't interact with each other and
1016 can't interact with services in the main server.
1017
1018 This package contains header files and libraries which are needed to
1019 develop VServer related applications.
1020
1021
1022 %prep
1023 %setup -q -n %name-%fullver
1024
1025
1026 %build
1027 %configure --with-initrddir=%_initrddir --enable-release \
1028            %{?_without_dietlibc:--disable-dietlibc} \
1029            %{?_with_legacy:--enable-apis=NOLEGACY} \
1030            --with-initscripts=sysv
1031
1032 %__make %{?_smp_mflags} all
1033 %{!?_without_doc:%__make %{?_smp_mflags} doc}
1034
1035
1036 %install
1037 rm -rf $RPM_BUILD_ROOT
1038 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
1039
1040 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
1041
1042 MANIFEST_CONFIG='%config' \
1043 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
1044 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
1045
1046
1047 %check || :
1048 %__make check
1049
1050
1051 %clean
1052 rm -rf $RPM_BUILD_ROOT
1053
1054
1055 %post
1056 test -d /vservers      || mkdir -m0000 /vservers
1057 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
1058
1059 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
1060 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
1061 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
1062
1063 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
1064
1065
1066 %preun
1067 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
1068
1069
1070 %post   lib -p /sbin/ldconfig
1071 %postun lib -p /sbin/ldconfig
1072
1073
1074 %post sysv
1075 %chkconfig --add vservers-default
1076 %chkconfig --add vprocunhide
1077 %chkconfig --add util-vserver
1078
1079
1080
1081 %preun sysv
1082 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
1083
1084 test "$1" != 0 || %chkconfig --del vprocunhide
1085 test "$1" != 0 || %chkconfig --del vservers-default
1086 test "$1" != 0 || %chkconfig --del util-vserver
1087
1088
1089 %postun sysv
1090 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
1091
1092
1093 %triggerin build -- fedora-release, centos-release
1094 function copy()
1095 {
1096     base=$1
1097     shift
1098
1099     for i; do
1100         test -r "$i" || continue
1101
1102         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
1103         cp -a "$i" "$target"
1104     done
1105 }
1106 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
1107 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
1108 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
1109
1110
1111 %post build
1112 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
1113
1114 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
1115         ln -s /vservers/.hash "$f"/00
1116
1117 %_sbindir/setattr --barrier /vservers/.hash || :
1118
1119
1120 %preun build
1121 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
1122
1123
1124 ## Temporary workaround to remove old v_* files; it will conflict
1125 ## somehow with the -legacy package but can be fixed by reinstalling
1126 ## this package.
1127 ## TODO: remove me in the final .spec file
1128 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
1129 %triggerun sysv -- util-vserver-sysv < 0.30.198
1130 for i in %v_services; do
1131         %chkconfig --del v_$i || :
1132 done
1133
1134
1135 %post legacy
1136 %chkconfig --add rebootmgr
1137 %chkconfig --add vservers-legacy
1138
1139 for i in %v_services; do
1140         %chkconfig --add v_$i
1141 done
1142
1143
1144 %preun legacy
1145 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
1146
1147 test "$1" != 0 || for i in %v_services; do
1148         %chkconfig --del v_$i
1149 done
1150
1151 test "$1" != 0 || %chkconfig --del rebootmgr
1152 test "$1" != 0 || %chkconfig --del vservers-legacy
1153
1154 %postun legacy
1155 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
1156
1157
1158 %files -f %name-base.list
1159 %defattr(-,root,root,-)
1160 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
1161 %doc doc/*.html doc/*.css
1162 /sbin/vshelper
1163 %dir %confdir
1164 %dir %confdefaultdir
1165 %dir %confdefaultdir/apps
1166 %dir %confdefaultdir/files
1167 %dir %pkglibdir/defaults
1168 %ghost %confdefaultdir/cachebase
1169 %ghost %confdefaultdir/vdirbase
1170 %ghost %confdefaultdir/run.rev
1171
1172 %dir %_localstatedir/cache/vservers
1173 %dir %_localstatedir/run/vservers
1174 %dir %_localstatedir/run/vservers.rev
1175 %dir %_localstatedir/run/vshelper
1176
1177
1178 %files lib -f %name-lib.list
1179 %files sysv -f %name-sysv.list
1180
1181
1182 %files core -f %name-core.list
1183 %defattr(-,root,root,-)
1184 %dir %pkglibdir
1185
1186
1187 %files build -f %name-build.list
1188 %defattr(-,root,root,-)
1189 %doc contrib/yum*.patch
1190 %dir %confdir/.distributions
1191 %dir %confdir/.distributions/*
1192 %dir %confdir/.distributions/*/apt
1193 %dir %confdir/.distributions/.common
1194 %dir %confdir/.distributions/.common/pubkeys
1195 %dir %confdefaultdir/apps/vunify
1196 %dir %confdefaultdir/apps/vunify/hash
1197
1198
1199 %files legacy -f %name-legacy.list
1200 %defattr(-,root,root,-)
1201 %dir %pkglibdir/legacy
1202
1203
1204 %files devel -f %name-devel.list
1205 %defattr(-,root,root,-)
1206 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
1207 %{!?_without_doc:%doc lib/apidoc/html}
1208
1209
1210 %changelog
1211 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
1212 - updated URLs
1213 - get rid of e2fsprogs requirement
1214
1215 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
1216 - add --with legacy and --without doc switches
1217 - add util-vserver initscript
1218
1219 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
1220 - do not require 'xalan' anymore by default
1221 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
1222 - removed 'chattr' leftovers
1223 - create the '/etc/vservers/.defaults/cachebase' symlink
1224 - added /var/cache/vservers and the needed support
1225 - set barrier attribute on /vservers/.pkg and /vservers/.hash
1226 - added 'centos-release' to the list of packages in the copy-the-keys
1227   trigger script
1228 - create '/vservers/.hash' and add initial configuration for it
1229
1230 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
1231 - version 0.30.209
1232 - copy centos keys
1233
1234 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
1235 - updated URLs
1236
1237 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
1238 - version 0.30.208
1239 - require the -lib subpackage by -devel
1240 - copy GPG keys from /etc/pki/rpm-gpg/
1241
1242 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
1243 - added patches to make yum work in chroot environments
1244 - version 0.30.206
1245
1246 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
1247 - added some %%descriptions
1248 - copy GPG keys from the system into the confdir
1249 - buildrequire dietlibc-0.25
1250 - BuildRequire beecrypt-devel
1251 - cleanups
1252 - use %%global instead of %%define
1253 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
1254
1255 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
1256 - updated BuildRequires:
1257 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
1258 - moved the v_* initscripts to legacy
1259 - do not ship the /vservers directory itself; as it is immutable, the
1260   extraction will fail else
1261
1262 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
1263 - documented switches for 'rpmbuild'
1264
1265 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
1266 - (re)added the MANIFEST_* variables which were lost some time ago;
1267   this will preserve %%config files...
1268
1269 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
1270 - use file-list for sysv scripts also
1271
1272 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
1273 - added vprocunhide-service support
1274 - added doxygen support
1275 - updated Requires:
1276
1277 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
1278 - Initial build.
1279 # $Id: util-vserver.spec.in 2626 2007-10-16 00:27:58Z dhozac $
1280
1281 ## This package understands the following switches:
1282 ## --without dietlibc        ...   disable usage of dietlibc
1283 ## --with xalan              ...   require/use the xalan xslt processor
1284 ## --without doc             ...   disable doc generation
1285 ## --with legacy             ...   enable the legacy APIs
1286
1287 %global confdir         %_sysconfdir/vservers
1288 %global confdefaultdir  %confdir/.defaults
1289 %global pkglibdir       %_libdir/%name
1290 %global chkconfig       /sbin/chkconfig
1291
1292 %global _localstatedir  %_var
1293
1294 %global ver             %( echo @VERSION@ | sed 's/-.*//' )
1295 %global subver          %( s=`echo @VERSION@ | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
1296 %global fullver         @VERSION@
1297
1298
1299 %{!?release_func:%global release_func() %1%{?dist}}
1300
1301 Summary:        Linux virtual server utilities
1302 Name:           @PACKAGE@
1303 Version:        %ver
1304 Release:        %release_func 1%subver
1305 License:        GPL
1306 Group:          System Environment/Base
1307 URL:            http://savannah.nongnu.org/projects/util-vserver/
1308 Source0:        http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2
1309 #Source1:       http://ftp.linux-vserver.org/pub/utils/util-vserver/%name-%fullver.tar.bz2.asc
1310 BuildRoot:      %_tmppath/%name-%version-%release-root
1311 Requires:       init(%name)
1312 Requires:       %name-core = %version-%release
1313 Requires:       %name-lib  = %version-%release
1314 Requires:       diffutils mktemp sed
1315 Provides:       vserver = %version-%release
1316 Obsoletes:      vserver < %version
1317 BuildRequires:  mount vconfig gawk iproute iptables
1318 BuildRequires:  gcc-c++ wget which diffutils
1319 BuildRequires:  e2fsprogs-devel beecrypt-devel
1320 BuildRequires:  e2fsprogs
1321 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
1322 Requires(post):         %name-core
1323 Requires(pre):          %pkglibdir
1324 Requires(postun):       %pkglibdir
1325 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
1326 %{?_with_xalan:BuildRequires:   xalan-j}
1327
1328 %package lib
1329 Summary:                Dynamic libraries for util-vserver
1330 Group:                  System Environment/Libraries
1331
1332 %package core
1333 Summary:                The core-utilities for util-vserver
1334 Group:                  Applications/System
1335 Requires:               util-linux
1336
1337 %package build
1338 Summary:                Tools which can be used to build vservers
1339 Group:                  Applications/System
1340 Requires:               rpm wget binutils tar
1341 Requires:               %name = %version-%release
1342 Requires(pre):          %confdir
1343 Requires(postun):       %confdir
1344 Requires(post):         %name-core
1345
1346 %package sysv
1347 Summary:                SysV-initscripts for vserver
1348 Group:                  System Environment/Base
1349 Provides:               init(%name) = sysv
1350 Requires:               make diffutils
1351 Requires:               initscripts
1352 Requires:               %name = %version-%release
1353 Requires(post):         %chkconfig
1354 Requires(preun):        %chkconfig
1355 Requires(pre):          %_initrddir %pkglibdir
1356 requires(postun):       %_initrddir %pkglibdir
1357
1358 %package legacy
1359 Summary:                Legacy utilities for util-vserver
1360 Group:                  Applications/System
1361 Requires:               %name = %version-%release
1362 Requires(post):         %chkconfig
1363 Requires(preun):        %chkconfig
1364 Requires(pre):          %_initrddir %pkglibdir
1365 requires(postun):       %_initrddir %pkglibdir
1366
1367 %package devel
1368 Summary:                Header-files and libraries needed to develop vserver based applications
1369 Group:                  Development/Libraries
1370 Requires:               pkgconfig
1371 Requires:               %name-lib = %version-%release
1372
1373
1374 %description
1375 util-vserver provides the components and a framework to setup virtual
1376 servers.  A virtual server runs inside a linux server. It is nevertheless
1377 highly independent. As such, you can run various services with normal
1378 configuration. The various vservers can't interact with each other and
1379 can't interact with services in the main server.
1380
1381 This requires a special kernel supporting the new new_s_context and
1382 set_ipv4root system call.
1383
1384 %description lib
1385 util-vserver provides the components and a framework to setup virtual
1386 servers.  A virtual server runs inside a linux server. It is nevertheless
1387 highly independent. As such, you can run various services with normal
1388 configuration. The various vservers can't interact with each other and
1389 can't interact with services in the main server.
1390
1391 This package contains the shared libraries needed by all other
1392 'util-vserver' subpackages.
1393
1394 %description core
1395 util-vserver provides the components and a framework to setup virtual
1396 servers.  A virtual server runs inside a linux server. It is nevertheless
1397 highly independent. As such, you can run various services with normal
1398 configuration. The various vservers can't interact with each other and
1399 can't interact with services in the main server.
1400
1401 This package contains utilities which are required to communicate with
1402 the Linux-Vserver enabled kernel.
1403
1404
1405 %description build
1406 util-vserver provides the components and a framework to setup virtual
1407 servers.  A virtual server runs inside a linux server. It is nevertheless
1408 highly independent. As such, you can run various services with normal
1409 configuration. The various vservers can't interact with each other and
1410 can't interact with services in the main server.
1411
1412 This package contains utilities which assist in building Vservers.
1413
1414 %description sysv
1415 util-vserver provides the components and a framework to setup virtual
1416 servers.  A virtual server runs inside a linux server. It is nevertheless
1417 highly independent. As such, you can run various services with normal
1418 configuration. The various vservers can't interact with each other and
1419 can't interact with services in the main server.
1420
1421 This package contains the SysV initscripts which start and stop
1422 VServers and related tools.
1423
1424
1425 %description legacy
1426 util-vserver provides the components and a framework to setup virtual
1427 servers.  A virtual server runs inside a linux server. It is nevertheless
1428 highly independent. As such, you can run various services with normal
1429 configuration. The various vservers can't interact with each other and
1430 can't interact with services in the main server.
1431
1432 This package contains the tools which are needed to work with VServers
1433 having an old-style configuration.
1434
1435
1436 %description devel
1437 util-vserver provides the components and a framework to setup virtual
1438 servers.  A virtual server runs inside a linux server. It is nevertheless
1439 highly independent. As such, you can run various services with normal
1440 configuration. The various vservers can't interact with each other and
1441 can't interact with services in the main server.
1442
1443 This package contains header files and libraries which are needed to
1444 develop VServer related applications.
1445
1446
1447 %prep
1448 %setup -q -n %name-%fullver
1449
1450
1451 %build
1452 %configure --with-initrddir=%_initrddir --enable-release \
1453            %{?_without_dietlibc:--disable-dietlibc} \
1454            %{?_with_legacy:--enable-apis=NOLEGACY} \
1455            --with-initscripts=sysv
1456
1457 %__make %{?_smp_mflags} all
1458 %{!?_without_doc:%__make %{?_smp_mflags} doc}
1459
1460
1461 %install
1462 rm -rf $RPM_BUILD_ROOT
1463 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
1464
1465 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
1466
1467 MANIFEST_CONFIG='%config' \
1468 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
1469 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
1470
1471
1472 %check || :
1473 %__make check
1474
1475
1476 %clean
1477 rm -rf $RPM_BUILD_ROOT
1478
1479
1480 %post
1481 test -d /vservers      || mkdir -m0000 /vservers
1482 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
1483
1484 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
1485 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
1486 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
1487
1488 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
1489
1490
1491 %preun
1492 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
1493
1494
1495 %post   lib -p /sbin/ldconfig
1496 %postun lib -p /sbin/ldconfig
1497
1498
1499 %post sysv
1500 %chkconfig --add vservers-default
1501 %chkconfig --add vprocunhide
1502 %chkconfig --add util-vserver
1503
1504
1505
1506 %preun sysv
1507 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
1508
1509 test "$1" != 0 || %chkconfig --del vprocunhide
1510 test "$1" != 0 || %chkconfig --del vservers-default
1511 test "$1" != 0 || %chkconfig --del util-vserver
1512
1513
1514 %postun sysv
1515 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
1516
1517
1518 %triggerin build -- fedora-release, centos-release
1519 function copy()
1520 {
1521     base=$1
1522     shift
1523
1524     for i; do
1525         test -r "$i" || continue
1526
1527         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
1528         cp -a "$i" "$target"
1529     done
1530 }
1531 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
1532 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
1533 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
1534
1535
1536 %post build
1537 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
1538
1539 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
1540         ln -s /vservers/.hash "$f"/00
1541
1542 %_sbindir/setattr --barrier /vservers/.hash || :
1543
1544
1545 %preun build
1546 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
1547
1548
1549 ## Temporary workaround to remove old v_* files; it will conflict
1550 ## somehow with the -legacy package but can be fixed by reinstalling
1551 ## this package.
1552 ## TODO: remove me in the final .spec file
1553 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
1554 %triggerun sysv -- util-vserver-sysv < 0.30.198
1555 for i in %v_services; do
1556         %chkconfig --del v_$i || :
1557 done
1558
1559
1560 %post legacy
1561 %chkconfig --add rebootmgr
1562 %chkconfig --add vservers-legacy
1563
1564 for i in %v_services; do
1565         %chkconfig --add v_$i
1566 done
1567
1568
1569 %preun legacy
1570 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
1571
1572 test "$1" != 0 || for i in %v_services; do
1573         %chkconfig --del v_$i
1574 done
1575
1576 test "$1" != 0 || %chkconfig --del rebootmgr
1577 test "$1" != 0 || %chkconfig --del vservers-legacy
1578
1579 %postun legacy
1580 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
1581
1582
1583 %files -f %name-base.list
1584 %defattr(-,root,root,-)
1585 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
1586 %doc doc/*.html doc/*.css
1587 /sbin/vshelper
1588 %dir %confdir
1589 %dir %confdefaultdir
1590 %dir %confdefaultdir/apps
1591 %dir %confdefaultdir/files
1592 %dir %pkglibdir/defaults
1593 %ghost %confdefaultdir/cachebase
1594 %ghost %confdefaultdir/vdirbase
1595 %ghost %confdefaultdir/run.rev
1596
1597 %dir %_localstatedir/cache/vservers
1598 %dir %_localstatedir/run/vservers
1599 %dir %_localstatedir/run/vservers.rev
1600 %dir %_localstatedir/run/vshelper
1601
1602
1603 %files lib -f %name-lib.list
1604 %files sysv -f %name-sysv.list
1605
1606
1607 %files core -f %name-core.list
1608 %defattr(-,root,root,-)
1609 %dir %pkglibdir
1610
1611
1612 %files build -f %name-build.list
1613 %defattr(-,root,root,-)
1614 %doc contrib/yum*.patch
1615 %dir %confdir/.distributions
1616 %dir %confdir/.distributions/*
1617 %dir %confdir/.distributions/*/apt
1618 %dir %confdir/.distributions/.common
1619 %dir %confdir/.distributions/.common/pubkeys
1620 %dir %confdefaultdir/apps/vunify
1621 %dir %confdefaultdir/apps/vunify/hash
1622
1623
1624 %files legacy -f %name-legacy.list
1625 %defattr(-,root,root,-)
1626 %dir %pkglibdir/legacy
1627
1628
1629 %files devel -f %name-devel.list
1630 %defattr(-,root,root,-)
1631 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
1632 %{!?_without_doc:%doc lib/apidoc/html}
1633
1634
1635 %changelog
1636 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
1637 - updated URLs
1638 - get rid of e2fsprogs requirement
1639
1640 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
1641 - add --with legacy and --without doc switches
1642 - add util-vserver initscript
1643
1644 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
1645 - do not require 'xalan' anymore by default
1646 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
1647 - removed 'chattr' leftovers
1648 - create the '/etc/vservers/.defaults/cachebase' symlink
1649 - added /var/cache/vservers and the needed support
1650 - set barrier attribute on /vservers/.pkg and /vservers/.hash
1651 - added 'centos-release' to the list of packages in the copy-the-keys
1652   trigger script
1653 - create '/vservers/.hash' and add initial configuration for it
1654
1655 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
1656 - version 0.30.209
1657 - copy centos keys
1658
1659 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
1660 - updated URLs
1661
1662 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
1663 - version 0.30.208
1664 - require the -lib subpackage by -devel
1665 - copy GPG keys from /etc/pki/rpm-gpg/
1666
1667 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
1668 - added patches to make yum work in chroot environments
1669 - version 0.30.206
1670
1671 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
1672 - added some %%descriptions
1673 - copy GPG keys from the system into the confdir
1674 - buildrequire dietlibc-0.25
1675 - BuildRequire beecrypt-devel
1676 - cleanups
1677 - use %%global instead of %%define
1678 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
1679
1680 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
1681 - updated BuildRequires:
1682 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
1683 - moved the v_* initscripts to legacy
1684 - do not ship the /vservers directory itself; as it is immutable, the
1685   extraction will fail else
1686
1687 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
1688 - documented switches for 'rpmbuild'
1689
1690 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
1691 - (re)added the MANIFEST_* variables which were lost some time ago;
1692   this will preserve %%config files...
1693
1694 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
1695 - use file-list for sysv scripts also
1696
1697 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
1698 - added vprocunhide-service support
1699 - added doxygen support
1700 - updated Requires:
1701
1702 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
1703 - Initial build.