minor optimizations
[util-vserver.git] / util-vserver / util-vserver.spec.in
1 # $Id$
2
3 %define confdir         %_sysconfdir/vservers
4 %define confdefaultdir  %confdir/.defaults
5 %define pkglibdir       %_libdir/%name
6 %define __chattr        /usr/bin/chattr
7 %define chkconfig       /sbin/chkconfig
8
9 Summary:        Linux virtual server utilities
10 Name:           @PACKAGE@
11 Version:        @VERSION@
12 Release:        0
13 Epoch:          0
14 License:        GPL
15 Group:          System Environment/Base
16 URL:            http://savannah.nongnu.org/projects/util-vserver/
17 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
18 BuildRoot:      %_tmppath/%name-%version-%release-root
19 Requires:       init(%name)
20 Requires:       %name-core = %epoch:%version-%release
21 Requires:       %name-lib  = %epoch:%version-%release
22 Requires:       diffutils mktemp sed
23 Provides:       vserver = %epoch:%version-%release
24 Obsoletes:      vserver < %epoch:%version
25 BuildRequires:  mount vconfig gawk iproute
26 BuildRequires:  gcc-c++ wget
27 BuildRequires:  e2fsprogs-devel
28 BuildRequires:  doxygen tetex-latex
29 Requires(post):         %__chattr
30 Requires(pre):          %pkglibdir
31 Requires(postun):       %pkglibdir
32 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.24}
33 %{!?_without_xalan:BuildRequires:       xalan-j}
34
35 %package lib
36 Summary:                Dynamic libraries for util-vserver
37 Group:                  System Environment/Libraries
38
39 %package core
40 Summary:                The core-utilities for util-vserver
41 Group:                  Applications/System
42 Requires:               util-linux
43
44 %package build
45 Summary:                Tools which can be used to build vservers
46 Group:                  Applications/System
47 Requires:               rpm apt wget binutils tar e2fsprogs
48 Requires:               %name = %epoch:%version-%release
49 Requires(pre):          %confdir
50 Requires(postun):       %confdir
51
52 %package sysv
53 Summary:                SysV-initscripts for vserver
54 Group:                  System Environment/Base
55 Provides:               init(%name) = sysv
56 Requires:               make diffutils
57 Requires:               initscripts
58 Requires:               %name = %epoch:%version-%release
59 Requires(post):         %chkconfig
60 Requires(preun):        %chkconfig
61 Requires(pre):          %_initrddir %pkglibdir
62 requires(postun):       %_initrddir %pkglibdir
63
64 %package legacy
65 Summary:                Legacy utilities for util-vserver
66 Group:                  Applications/System
67 Requires:               %name = %epoch:%version-%release
68 Requires(post):         %chkconfig
69 Requires(preun):        %chkconfig
70 Requires(pre):          %_initrddir %pkglibdir
71 requires(postun):       %_initrddir %pkglibdir
72
73 %package devel
74 Summary:                Header-files and libraries which are needed to develop vserver based applications
75 Group:                  Development/Libraries
76 Requires:               pkgconfig
77
78
79 %description
80 This package provides the components and a framework to setup virtual
81 servers.  A virtual server runs inside a linux server. It is nevertheless
82 highly independent. As such, you can run various services with normal
83 configuration. The various vservers can't interact with each other and
84 can't interact with services in the main server.
85
86 This requires a special kernel supporting the new new_s_context and
87 set_ipv4root system call.
88
89 %description lib
90 %description core
91 %description build
92 %description sysv
93 %description legacy
94 %description devel
95
96
97 %prep
98 %setup -q
99
100
101 %build
102 %configure --with-initrddir=%_initrddir --enable-release \
103            %{?_without_dietlibc:--disable-dietlibc}
104
105 %__make %{?_smp_mflags} all
106 %__make %{?_smp_mflags} doc
107
108
109 %install
110 rm -rf $RPM_BUILD_ROOT
111 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
112
113 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
114
115 MANIFEST_CONFIG='%config' \
116 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
117 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
118
119
120 %check || :
121 %__make check
122
123
124 %clean
125 rm -rf $RPM_BUILD_ROOT
126
127
128 %post
129 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers             "$f"
130 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s /var/run/vservers.rev "$f"
131
132 %__chattr +t /vservers || :
133
134
135 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
136 %post sysv
137 %chkconfig --add vservers-default
138 %chkconfig --add vprocunhide
139
140 for i in %v_services; do
141         %chkconfig --add v_$i
142 done
143
144
145 %preun sysv
146 test "$1" != 0 || for i in %v_services; do
147         %chkconfig --del v_$i
148 done
149
150 test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
151
152 test "$1" != 0 || %chkconfig --del vprocunhide
153 test "$1" != 0 || %chkconfig --del vservers-default
154
155
156 %postun sysv
157 test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
158
159
160 %post   lib -p /sbin/ldconfig
161 %postun lib -p /sbin/ldconfig
162
163
164 %post legacy
165 %chkconfig --add rebootmgr
166 %chkconfig --add vservers-legacy
167
168 %preun legacy
169 test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
170
171 test "$1" != 0 || %chkconfig --del rebootmgr
172 test "$1" != 0 || %chkconfig --del vservers-legacy
173
174 %postun legacy
175 test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
176
177
178 %files -f %name-base.list
179 %defattr(-,root,root,-)
180 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
181 %doc doc/*.html doc/*.css
182 /sbin/vshelper
183 %dir %confdir
184 %dir %confdefaultdir
185 %dir %confdefaultdir/apps
186 %dir %confdefaultdir/files
187 %dir %pkglibdir/defaults
188 %ghost %confdefaultdir/vdirbase
189 %ghost %confdefaultdir/run.rev
190
191 %attr(000,root,root) %dir /vservers/.pkg
192 %attr(000,root,root) %dir /vservers
193
194 %dir /var/run/vservers
195 %dir /var/run/vservers.rev
196 %dir /var/run/vshelper
197
198
199 %files lib -f %name-lib.list
200 %files sysv -f %name-sysv.list
201
202
203 %files core -f %name-core.list
204 %defattr(-,root,root,-)
205 %dir %pkglibdir
206
207
208 %files build -f %name-build.list
209 %defattr(-,root,root,-)
210 %dir %confdir/.distributions
211 %dir %confdir/.distributions/*
212 %dir %confdir/.distributions/*/apt
213
214
215 %files legacy -f %name-legacy.list
216 %defattr(-,root,root,-)
217 %dir %pkglibdir/legacy
218
219
220 %files devel -f %name-devel.list
221 %defattr(-,root,root,-)
222 %doc lib/apidoc/latex/refman.pdf
223 %doc lib/apidoc/html
224
225
226 %changelog
227 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
228 - (re)added the MANIFEST_* variables which were lost some time ago;
229   this will preserve %%config files...
230
231 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
232 - use file-list for sysv scripts also
233
234 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
235 - added vprocunhide-service support
236 - added doxygen support
237 - updated Requires:
238
239 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
240 - Initial build.