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