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