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