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