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