0aa4f253cf188e088751386f8d92eff520155ed7
[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 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
242 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
243
244
245 %preun build
246 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
247
248
249 ## Temporary workaround to remove old v_* files; it will conflict
250 ## somehow with the -legacy package but can be fixed by reinstalling
251 ## this package.
252 ## TODO: remove me in the final .spec file
253 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
254 %triggerun sysv -- util-vserver-sysv < 0.30.198
255 for i in %v_services; do
256         %chkconfig --del v_$i || :
257 done
258
259
260 %post legacy
261 %chkconfig --add rebootmgr
262 %chkconfig --add vservers-legacy
263
264 for i in %v_services; do
265         %chkconfig --add v_$i
266 done
267
268
269 %preun legacy
270 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
271
272 test "$1" != 0 || for i in %v_services; do
273         %chkconfig --del v_$i
274 done
275
276 test "$1" != 0 || %chkconfig --del rebootmgr
277 test "$1" != 0 || %chkconfig --del vservers-legacy
278
279 %postun legacy
280 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
281
282
283 %files -f %name-base.list
284 %defattr(-,root,root,-)
285 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
286 %doc doc/*.html doc/*.css
287 /sbin/vshelper
288 %dir %confdir
289 %dir %confdefaultdir
290 %dir %confdefaultdir/apps
291 %dir %confdefaultdir/files
292 %dir %pkglibdir/defaults
293 %ghost %confdefaultdir/vdirbase
294 %ghost %confdefaultdir/run.rev
295
296 %dir %_localstatedir/run/vservers
297 %dir %_localstatedir/run/vservers.rev
298 %dir %_localstatedir/run/vshelper
299
300
301 %files lib -f %name-lib.list
302 %files sysv -f %name-sysv.list
303
304
305 %files core -f %name-core.list
306 %defattr(-,root,root,-)
307 %dir %pkglibdir
308
309
310 %files build -f %name-build.list
311 %defattr(-,root,root,-)
312 %doc contrib/yum*.patch
313 %dir %confdir/.distributions
314 %dir %confdir/.distributions/*
315 %dir %confdir/.distributions/*/apt
316 %dir %confdir/.distributions/.common
317 %dir %confdir/.distributions/.common/pubkeys
318 %dir %confdefaultdir/apps/vunify
319 %dir %confdefaultdir/apps/vunify/hash
320
321
322 %files legacy -f %name-legacy.list
323 %defattr(-,root,root,-)
324 %dir %pkglibdir/legacy
325
326
327 %files devel -f %name-devel.list
328 %defattr(-,root,root,-)
329 %doc lib/apidoc/latex/refman.pdf
330 %doc lib/apidoc/html
331
332
333 %changelog
334 * Sat Jul 16 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-2
335 - updated URLs
336
337 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
338 - version 0.30.208
339 - require the -lib subpackage by -devel
340 - copy GPG keys from /etc/pki/rpm-gpg/
341
342 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
343 - added patches to make yum work in chroot environments
344 - version 0.30.206
345
346 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
347 - added some %%descriptions
348 - copy GPG keys from the system into the confdir
349 - buildrequire dietlibc-0.25
350 - BuildRequire beecrypt-devel
351 - cleanups
352 - use %%global instead of %%define
353 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
354
355 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
356 - updated BuildRequires:
357 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
358 - moved the v_* initscripts to legacy
359 - do not ship the /vservers directory itself; as it is immutable, the
360   extraction will fail else
361
362 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
363 - documented switches for 'rpmbuild'
364
365 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
366 - (re)added the MANIFEST_* variables which were lost some time ago;
367   this will preserve %%config files...
368
369 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
370 - use file-list for sysv scripts also
371
372 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
373 - added vprocunhide-service support
374 - added doxygen support
375 - updated Requires:
376
377 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
378 - Initial build.