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