util-vserver 0.30.214
[util-vserver.git] / util-vserver.spec
1 # $Id: util-vserver.spec.in 2575 2007-08-05 18:35:40Z 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 0.30.214 | sed 's/-.*//' )
17 %global subver          %( s=`echo 0.30.214 | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
18 %global fullver         0.30.214
19
20
21 %{!?release_func:%global release_func() %1%{?dist}}
22
23 Summary:        Linux virtual server utilities
24 Name:           util-vserver
25 Version:        %ver
26 Release:        %release_func 0%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 %{!?_without_doc:BuildRequires: doxygen tetex-latex}
43 Requires(post):         %name-core
44 Requires(pre):          %pkglibdir
45 Requires(postun):       %pkglibdir
46 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
47 %{?_with_xalan:BuildRequires:   xalan-j}
48
49 %package lib
50 Summary:                Dynamic libraries for util-vserver
51 Group:                  System Environment/Libraries
52
53 %package core
54 Summary:                The core-utilities for util-vserver
55 Group:                  Applications/System
56 Requires:               util-linux
57
58 %package build
59 Summary:                Tools which can be used to build vservers
60 Group:                  Applications/System
61 Requires:               rpm wget binutils tar
62 Requires:               %name = %version-%release
63 Requires(pre):          %confdir
64 Requires(postun):       %confdir
65 Requires(post):         %name-core
66
67 %package sysv
68 Summary:                SysV-initscripts for vserver
69 Group:                  System Environment/Base
70 Provides:               init(%name) = sysv
71 Requires:               make diffutils
72 Requires:               initscripts
73 Requires:               %name = %version-%release
74 Requires(post):         %chkconfig
75 Requires(preun):        %chkconfig
76 Requires(pre):          %_initrddir %pkglibdir
77 requires(postun):       %_initrddir %pkglibdir
78
79 %package legacy
80 Summary:                Legacy utilities for util-vserver
81 Group:                  Applications/System
82 Requires:               %name = %version-%release
83 Requires(post):         %chkconfig
84 Requires(preun):        %chkconfig
85 Requires(pre):          %_initrddir %pkglibdir
86 requires(postun):       %_initrddir %pkglibdir
87
88 %package devel
89 Summary:                Header-files and libraries needed to develop vserver based applications
90 Group:                  Development/Libraries
91 Requires:               pkgconfig
92 Requires:               %name-lib = %version-%release
93
94
95 %description
96 util-vserver provides the components and a framework to setup virtual
97 servers.  A virtual server runs inside a linux server. It is nevertheless
98 highly independent. As such, you can run various services with normal
99 configuration. The various vservers can't interact with each other and
100 can't interact with services in the main server.
101
102 This requires a special kernel supporting the new new_s_context and
103 set_ipv4root system call.
104
105 %description lib
106 util-vserver provides the components and a framework to setup virtual
107 servers.  A virtual server runs inside a linux server. It is nevertheless
108 highly independent. As such, you can run various services with normal
109 configuration. The various vservers can't interact with each other and
110 can't interact with services in the main server.
111
112 This package contains the shared libraries needed by all other
113 'util-vserver' subpackages.
114
115 %description core
116 util-vserver provides the components and a framework to setup virtual
117 servers.  A virtual server runs inside a linux server. It is nevertheless
118 highly independent. As such, you can run various services with normal
119 configuration. The various vservers can't interact with each other and
120 can't interact with services in the main server.
121
122 This package contains utilities which are required to communicate with
123 the Linux-Vserver enabled kernel.
124
125
126 %description build
127 util-vserver provides the components and a framework to setup virtual
128 servers.  A virtual server runs inside a linux server. It is nevertheless
129 highly independent. As such, you can run various services with normal
130 configuration. The various vservers can't interact with each other and
131 can't interact with services in the main server.
132
133 This package contains utilities which assist in building Vservers.
134
135 %description sysv
136 util-vserver provides the components and a framework to setup virtual
137 servers.  A virtual server runs inside a linux server. It is nevertheless
138 highly independent. As such, you can run various services with normal
139 configuration. The various vservers can't interact with each other and
140 can't interact with services in the main server.
141
142 This package contains the SysV initscripts which start and stop
143 VServers and related tools.
144
145
146 %description legacy
147 util-vserver provides the components and a framework to setup virtual
148 servers.  A virtual server runs inside a linux server. It is nevertheless
149 highly independent. As such, you can run various services with normal
150 configuration. The various vservers can't interact with each other and
151 can't interact with services in the main server.
152
153 This package contains the tools which are needed to work with VServers
154 having an old-style configuration.
155
156
157 %description devel
158 util-vserver provides the components and a framework to setup virtual
159 servers.  A virtual server runs inside a linux server. It is nevertheless
160 highly independent. As such, you can run various services with normal
161 configuration. The various vservers can't interact with each other and
162 can't interact with services in the main server.
163
164 This package contains header files and libraries which are needed to
165 develop VServer related applications.
166
167
168 %prep
169 %setup -q -n %name-%fullver
170
171
172 %build
173 %configure --with-initrddir=%_initrddir --enable-release \
174            %{?_without_dietlibc:--disable-dietlibc} \
175            %{?_with_legacy:--enable-apis=NOLEGACY} \
176            --with-initscripts=sysv
177
178 %__make %{?_smp_mflags} all
179 %{!?_without_doc:%__make %{?_smp_mflags} doc}
180
181
182 %install
183 rm -rf $RPM_BUILD_ROOT
184 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
185
186 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
187
188 MANIFEST_CONFIG='%config' \
189 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
190 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
191
192
193 %check || :
194 %__make check
195
196
197 %clean
198 rm -rf $RPM_BUILD_ROOT
199
200
201 %post
202 test -d /vservers      || mkdir -m0000 /vservers
203 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
204
205 f="%confdefaultdir/vdirbase";  test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
206 f="%confdefaultdir/run.rev";   test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
207 f="%confdefaultdir/cachebase"; test -L "$f" -o -e "$f" || ln -s %_localstatedir/cache/vservers   "$f"
208
209 %_sbindir/setattr --barrier /vservers /vservers/.pkg || :
210
211
212 %preun
213 test "$1" != 0 || rm -rf %_localstatedir/cache/vservers/* 2>/dev/null || :
214
215
216 %post   lib -p /sbin/ldconfig
217 %postun lib -p /sbin/ldconfig
218
219
220 %post sysv
221 %chkconfig --add vservers-default
222 %chkconfig --add vprocunhide
223 %chkconfig --add util-vserver
224
225
226
227 %preun sysv
228 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
229
230 test "$1" != 0 || %chkconfig --del vprocunhide
231 test "$1" != 0 || %chkconfig --del vservers-default
232 test "$1" != 0 || %chkconfig --del util-vserver
233
234
235 %postun sysv
236 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
237
238
239 %triggerin build -- fedora-release, centos-release
240 function copy()
241 {
242     base=$1
243     shift
244
245     for i; do
246         test -r "$i" || continue
247
248         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
249         cp -a "$i" "$target"
250     done
251 }
252 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
253 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
254 copy centos /usr/share/doc/centos-*/RPM-GPG-KEY-*
255
256
257 %post build
258 test -d /vservers/.hash || mkdir -m0700 /vservers/.hash
259
260 f="%confdefaultdir/apps/vunify/hash"; test -e "$f"/method -o -e "$f"/00 || \
261         ln -s /vservers/.hash "$f"/00
262
263 %_sbindir/setattr --barrier /vservers/.hash || :
264
265
266 %preun build
267 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
268
269
270 ## Temporary workaround to remove old v_* files; it will conflict
271 ## somehow with the -legacy package but can be fixed by reinstalling
272 ## this package.
273 ## TODO: remove me in the final .spec file
274 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
275 %triggerun sysv -- util-vserver-sysv < 0.30.198
276 for i in %v_services; do
277         %chkconfig --del v_$i || :
278 done
279
280
281 %post legacy
282 %chkconfig --add rebootmgr
283 %chkconfig --add vservers-legacy
284
285 for i in %v_services; do
286         %chkconfig --add v_$i
287 done
288
289
290 %preun legacy
291 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
292
293 test "$1" != 0 || for i in %v_services; do
294         %chkconfig --del v_$i
295 done
296
297 test "$1" != 0 || %chkconfig --del rebootmgr
298 test "$1" != 0 || %chkconfig --del vservers-legacy
299
300 %postun legacy
301 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
302
303
304 %files -f %name-base.list
305 %defattr(-,root,root,-)
306 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
307 %doc doc/*.html doc/*.css
308 /sbin/vshelper
309 %dir %confdir
310 %dir %confdefaultdir
311 %dir %confdefaultdir/apps
312 %dir %confdefaultdir/files
313 %dir %pkglibdir/defaults
314 %ghost %confdefaultdir/cachebase
315 %ghost %confdefaultdir/vdirbase
316 %ghost %confdefaultdir/run.rev
317
318 %dir %_localstatedir/cache/vservers
319 %dir %_localstatedir/run/vservers
320 %dir %_localstatedir/run/vservers.rev
321 %dir %_localstatedir/run/vshelper
322
323
324 %files lib -f %name-lib.list
325 %files sysv -f %name-sysv.list
326
327
328 %files core -f %name-core.list
329 %defattr(-,root,root,-)
330 %dir %pkglibdir
331
332
333 %files build -f %name-build.list
334 %defattr(-,root,root,-)
335 %doc contrib/yum*.patch
336 %dir %confdir/.distributions
337 %dir %confdir/.distributions/*
338 %dir %confdir/.distributions/*/apt
339 %dir %confdir/.distributions/.common
340 %dir %confdir/.distributions/.common/pubkeys
341 %dir %confdefaultdir/apps/vunify
342 %dir %confdefaultdir/apps/vunify/hash
343
344
345 %files legacy -f %name-legacy.list
346 %defattr(-,root,root,-)
347 %dir %pkglibdir/legacy
348
349
350 %files devel -f %name-devel.list
351 %defattr(-,root,root,-)
352 %{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
353 %{!?_without_doc:%doc lib/apidoc/html}
354
355
356 %changelog
357 * Mon Jun 25 2007 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.214-0
358 - updated URLs
359 - get rid of e2fsprogs requirement
360
361 * Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
362 - add --with legacy and --without doc switches
363 - add util-vserver initscript
364
365 * Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
366 - do not require 'xalan' anymore by default
367 - removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
368 - removed 'chattr' leftovers
369 - create the '/etc/vservers/.defaults/cachebase' symlink
370 - added /var/cache/vservers and the needed support
371 - set barrier attribute on /vservers/.pkg and /vservers/.hash
372 - added 'centos-release' to the list of packages in the copy-the-keys
373   trigger script
374 - create '/vservers/.hash' and add initial configuration for it
375
376 * Sun Oct 30 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.209-0
377 - version 0.30.209
378 - copy centos keys
379
380 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
381 - updated URLs
382
383 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
384 - version 0.30.208
385 - require the -lib subpackage by -devel
386 - copy GPG keys from /etc/pki/rpm-gpg/
387
388 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
389 - added patches to make yum work in chroot environments
390 - version 0.30.206
391
392 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
393 - added some %%descriptions
394 - copy GPG keys from the system into the confdir
395 - buildrequire dietlibc-0.25
396 - BuildRequire beecrypt-devel
397 - cleanups
398 - use %%global instead of %%define
399 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
400
401 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
402 - updated BuildRequires:
403 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
404 - moved the v_* initscripts to legacy
405 - do not ship the /vservers directory itself; as it is immutable, the
406   extraction will fail else
407
408 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
409 - documented switches for 'rpmbuild'
410
411 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
412 - (re)added the MANIFEST_* variables which were lost some time ago;
413   this will preserve %%config files...
414
415 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
416 - use file-list for sysv scripts also
417
418 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
419 - added vprocunhide-service support
420 - added doxygen support
421 - updated Requires:
422
423 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
424 - Initial build.