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