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