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