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