root/trunk/util-vserver.spec.in

Revision 2841, 14.6 KB (checked in by dhozac, 9 months ago)

Make the specfile work on Mandriva 2009.1.

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