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