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