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