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