- restore build of python modules
[util-vserver.git] / util-vserver.spec
1 # $Id: util-vserver.spec.in,v 1.49 2005/07/15 19:06:58 ensc Exp $
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 %global confdir         %_sysconfdir/vservers
8 %global confdefaultdir  %confdir/.defaults
9 %global pkglibdir       %_libdir/%name
10 %global __chattr        /usr/bin/chattr
11 %global chkconfig       /sbin/chkconfig
12
13 %global _localstatedir  %_var
14
15
16 %{!?release_func:%global release_func() %1%{?dist}}
17
18 %define name util-vserver
19 %define version 0.30.208
20 %define release 1.planetlab%{?date:.%{date}}
21
22 %define _without_dietlibc 1
23 %define _without_xalan 1
24
25 Vendor: PlanetLab
26 Packager: PlanetLab Central <support@planet-lab.org>
27 Distribution: PlanetLab 3.0
28 URL: http://cvs.planet-lab.org/cvs/util-vserver
29
30 Summary:        Linux virtual server utilities
31 Name:           util-vserver
32 Version:        0.30.208
33 Release:        %{release}
34 License:        GPL
35 Group:          System Environment/Base
36 #URL:           http://savannah.nongnu.org/projects/util-vserver/
37 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
38 BuildRoot:      %_tmppath/%name-%version-%release-root
39 Requires:       init(%name)
40 Requires:       %name-core = %version-%release
41 Requires:       %name-lib  = %version-%release
42 Requires:       diffutils mktemp sed
43 Provides:       vserver = %version-%release
44 Obsoletes:      vserver < %version
45 BuildRequires:  mount vconfig gawk iproute iptables
46 BuildRequires:  gcc-c++ wget which diffutils
47 BuildRequires:  e2fsprogs-devel beecrypt-devel
48 BuildRequires:  doxygen tetex-latex
49 Requires(pre):          %pkglibdir
50 Requires(postun):       %pkglibdir
51 %{!?_without_dietlibc:BuildRequires:    dietlibc >= 0:0.25}
52 %{!?_without_xalan:BuildRequires:       xalan-j}
53
54 %package lib
55 Summary:                Dynamic libraries for util-vserver
56 Group:                  System Environment/Libraries
57
58 %package core
59 Summary:                The core-utilities for util-vserver
60 Group:                  Applications/System
61 Requires:               util-linux
62
63 %package build
64 Summary:                Tools which can be used to build vservers
65 Group:                  Applications/System
66 Requires:               rpm wget binutils tar e2fsprogs
67 Requires:               %name = %version-%release
68 Requires(pre):          %confdir
69 Requires(postun):       %confdir
70
71 %ifarch %ix86
72 Requires:               apt
73 %endif
74
75 %package sysv
76 Summary:                SysV-initscripts for vserver
77 Group:                  System Environment/Base
78 Provides:               init(%name) = sysv
79 Requires:               make diffutils
80 Requires:               initscripts
81 Requires:               %name = %version-%release
82 Requires(post):         %chkconfig
83 Requires(preun):        %chkconfig
84 Requires(pre):          %_initrddir %pkglibdir
85 requires(postun):       %_initrddir %pkglibdir
86
87 %package legacy
88 Summary:                Legacy utilities for util-vserver
89 Group:                  Applications/System
90 Requires:               %name = %version-%release
91 Requires(post):         %chkconfig
92 Requires(preun):        %chkconfig
93 Requires(pre):          %_initrddir %pkglibdir
94 requires(postun):       %_initrddir %pkglibdir
95
96 %package devel
97 Summary:                Header-files and libraries needed to develop vserver based applications
98 Group:                  Development/Libraries
99 Requires:               pkgconfig
100 Requires:               %name-lib = %version-%release
101
102 %package python
103 Summary:                Python modules for manipulating vservers
104 Group:                  Applications/System
105 Requires:               python util-python
106 # Backward compatibility
107 Provides:               util-vserver-py23
108
109
110 %description
111 util-vserver provides the components and a framework to setup virtual
112 servers.  A virtual server runs inside a linux server. It is nevertheless
113 highly independent. As such, you can run various services with normal
114 configuration. The various vservers can't interact with each other and
115 can't interact with services in the main server.
116
117 This requires a special kernel supporting the new new_s_context and
118 set_ipv4root system call.
119
120 %description lib
121 util-vserver provides the components and a framework to setup virtual
122 servers.  A virtual server runs inside a linux server. It is nevertheless
123 highly independent. As such, you can run various services with normal
124 configuration. The various vservers can't interact with each other and
125 can't interact with services in the main server.
126
127 This package contains the shared libraries needed by all other
128 'util-vserver' subpackages.
129
130 %description core
131 util-vserver provides the components and a framework to setup virtual
132 servers.  A virtual server runs inside a linux server. It is nevertheless
133 highly independent. As such, you can run various services with normal
134 configuration. The various vservers can't interact with each other and
135 can't interact with services in the main server.
136
137 This package contains utilities which are required to communicate with
138 the Linux-Vserver enabled kernel.
139
140
141 %description build
142 util-vserver provides the components and a framework to setup virtual
143 servers.  A virtual server runs inside a linux server. It is nevertheless
144 highly independent. As such, you can run various services with normal
145 configuration. The various vservers can't interact with each other and
146 can't interact with services in the main server.
147
148 This package contains utilities which assist in building Vservers.
149
150 %description sysv
151 util-vserver provides the components and a framework to setup virtual
152 servers.  A virtual server runs inside a linux server. It is nevertheless
153 highly independent. As such, you can run various services with normal
154 configuration. The various vservers can't interact with each other and
155 can't interact with services in the main server.
156
157 This package contains the SysV initscripts which start and stop
158 VServers and related tools.
159
160
161 %description legacy
162 util-vserver provides the components and a framework to setup virtual
163 servers.  A virtual server runs inside a linux server. It is nevertheless
164 highly independent. As such, you can run various services with normal
165 configuration. The various vservers can't interact with each other and
166 can't interact with services in the main server.
167
168 This package contains the tools which are needed to work with VServers
169 having an old-style configuration.
170
171
172 %description devel
173 util-vserver provides the components and a framework to setup virtual
174 servers.  A virtual server runs inside a linux server. It is nevertheless
175 highly independent. As such, you can run various services with normal
176 configuration. The various vservers can't interact with each other and
177 can't interact with services in the main server.
178
179 This package contains header files and libraries which are needed to
180 develop VServer related applications.
181
182
183 %description python
184 Python modules for manipulating vservers.  Provides a superset of the
185 functionality of the vserver script (at least will do in the future),
186 but more readily accessible from Python code.
187
188
189 %prep
190 %setup -q
191
192 aclocal -I m4
193 autoconf
194 automake --add-missing
195
196 %build
197 %configure --with-initrddir=%_initrddir --enable-release \
198            %{?_without_dietlibc:--disable-dietlibc}
199
200 %__make %{?_smp_mflags} all
201 %__make %{?_smp_mflags} doc
202
203 %__make -C python
204
205 %install
206 rm -rf $RPM_BUILD_ROOT
207 %__make DESTDIR="$RPM_BUILD_ROOT" install install-distribution
208
209 rm -f $RPM_BUILD_ROOT/%_libdir/*.la
210
211 MANIFEST_CONFIG='%config' \
212 MANIFEST_CONFIG_NOREPLACE='%config(noreplace)' \
213 contrib/make-manifest %name $RPM_BUILD_ROOT contrib/manifest.dat
214
215 # install python bindings
216 %__make -C python DESTDIR="$RPM_BUILD_ROOT" install
217
218
219 %check || :
220 #%__make check
221
222
223 %clean
224 rm -rf $RPM_BUILD_ROOT
225
226
227 %post
228 test -d /vservers      || mkdir -m0000 /vservers
229 test -d /vservers/.pkg || mkdir -m0755 /vservers/.pkg
230
231 f="%confdefaultdir/vdirbase"; test -L "$f" -o -e "$f" || ln -s /vservers                        "$f"
232 f="%confdefaultdir/run.rev";  test -L "$f" -o -e "$f" || ln -s %_localstatedir/run/vservers.rev "$f"
233
234 %_sbindir/setattr --barrier /vservers || :
235
236 # add /bin/vsh to list of secure shells
237 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
238     echo /bin/vsh >> /etc/shells
239 fi
240
241
242 %postun
243 # 0 = erase, 1 = upgrade
244 if [ "$1" = 0 ] ; then
245     perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
246 fi
247
248
249 %post   lib -p /sbin/ldconfig
250 %postun lib -p /sbin/ldconfig
251
252
253 %post sysv
254 #%chkconfig --add vservers-default
255 #%chkconfig --add vprocunhide
256 # PlanetLab Node Manager takes care of starting and stopping VServers
257 %chkconfig --del vservers-default
258 # PlanetLab does not require /proc security
259 %chkconfig --del vprocunhide
260
261 %preun sysv
262 #test "$1" != 0 || %_initrddir/vprocunhide stop &>/dev/null || :
263
264 #test "$1" != 0 || %chkconfig --del vprocunhide
265 #test "$1" != 0 || %chkconfig --del vservers-default
266
267
268 %postun sysv
269 #test "$1" = 0  || %_initrddir/vprocunhide condrestart >/dev/null || :
270
271
272 %triggerin build -- fedora-release
273 function copy()
274 {
275     base=$1
276     shift
277
278     for i; do
279         test -r "$i" || continue
280
281         target=%confdir/.distributions/.common/pubkeys/$base-$(basename "$i")
282         cp -a "$i" "$target"
283     done
284 }
285 copy fedora /usr/share/doc/fedora-release-*/RPM-GPG-*
286 copy fedora /etc/pki/rpm-gpg/RPM-GPG-*
287
288
289 %preun build
290 test "$1" != 0 || rm -f %confdir/.distributions/.common/pubkeys/fedora-*
291
292
293 ## Temporary workaround to remove old v_* files; it will conflict
294 ## somehow with the -legacy package but can be fixed by reinstalling
295 ## this package.
296 ## TODO: remove me in the final .spec file
297 %define v_services      httpd named portmap sendmail smb sshd xinetd gated
298 %triggerun sysv -- util-vserver-sysv < 0.30.198
299 for i in %v_services; do
300         %chkconfig --del v_$i || :
301 done
302
303
304 %post legacy
305 # PlanetLab Node Manager takes care of starting and stopping VServers
306 #%chkconfig --add rebootmgr
307 #%chkconfig --add vservers-legacy
308
309 # PlanetLab does not require these legacy services
310 #for i in %v_services; do
311 #       %chkconfig --add v_$i
312 #done
313
314
315 %preun legacy
316 #test "$1" != 0 || %_initrddir/rebootmgr   stop &>/dev/null || :
317
318 #test "$1" != 0 || for i in %v_services; do
319 #       %chkconfig --del v_$i
320 #done
321
322 #test "$1" != 0 || %chkconfig --del rebootmgr
323 #test "$1" != 0 || %chkconfig --del vservers-legacy
324
325 %postun legacy
326 #test "$1" = 0  || %_initrddir/rebootmgr   condrestart >/dev/null || :
327
328
329 %files -f %name-base.list
330 %defattr(-,root,root,-)
331 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
332 %doc doc/*.html doc/*.css
333 /sbin/vshelper
334 %dir %confdir
335 %dir %confdefaultdir
336 %dir %confdefaultdir/apps
337 %dir %confdefaultdir/files
338 %dir %pkglibdir/defaults
339 %ghost %confdefaultdir/vdirbase
340 %ghost %confdefaultdir/run.rev
341
342 %dir %_localstatedir/run/vservers
343 %dir %_localstatedir/run/vservers.rev
344 %dir %_localstatedir/run/vshelper
345
346
347 %files lib -f %name-lib.list
348 %files sysv -f %name-sysv.list
349
350
351 %files core -f %name-core.list
352 %defattr(-,root,root,-)
353 %dir %pkglibdir
354
355
356 %files build -f %name-build.list
357 %defattr(-,root,root,-)
358 %doc contrib/yum*.patch
359 %dir %confdir/.distributions
360 %dir %confdir/.distributions/*
361 %dir %confdir/.distributions/*/apt
362 %dir %confdir/.distributions/.common
363 %dir %confdir/.distributions/.common/pubkeys
364 %dir %confdefaultdir/apps/vunify
365 %dir %confdefaultdir/apps/vunify/hash
366
367
368 %files legacy -f %name-legacy.list
369 %defattr(-,root,root,-)
370 %dir %pkglibdir/legacy
371
372
373 %files devel -f %name-devel.list
374 %defattr(-,root,root,-)
375 %doc lib/apidoc/latex/refman.pdf
376 %doc lib/apidoc/html
377
378
379 %files python
380 %defattr(0644,root,root)
381 %_libdir/python2.3/site-packages/*
382
383
384 %changelog
385 * Thu Aug 21 2005 Mark Huang <mlhuang@cs.princeton.edu>
386 - restore build of python modules
387
388 * Sat Aug 20 2005 Mark Huang <mlhuang@cs.princeton.edu>
389 - upgrade to util-vserver-0.30.208
390 - forward-port vbuild and legacy support until we can find a suitable
391   replacement
392 - make vsh use new vc_create_context() call
393
394 * Thu Jul 28 2005 Steve Muir <smuir@cs.princeton.edu>
395 - add support for static vserver IDs to vuseradd and vuserdel
396
397 * Thu Jul 21 2005 Steve Muir <smuir@cs.princeton.edu>
398 - add bwlimit and cpulimit modules
399
400 * Fri Jul 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.208-1
401 - require the -lib subpackage by -devel
402 - copy GPG keys from /etc/pki/rpm-gpg/
403
404 * Mon Jun 20 2005 Steve Muir <smuir@cs.princeton.edu>
405 - import Marc's vdu implementation
406
407 * Wed Jun 15 2005 Steve Muir <smuir@cs.princeton.edu>
408 - 'vserver-init start' functionality subsumed by Node Manager
409
410 * Thu Jun 02 2005 Marc E. Fiuczynski <mef@cs.princeton.edu>
411 - Fixed vlimit command
412
413 * Wed May 25 2005 Steve Muir <smuir@cs.princeton.edu>
414 - add Python modules for manipulating vservers
415
416 * Fri Apr 15 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.206-1
417 - added patches to make yum work in chroot environments
418 - version 0.30.206
419
420 * Thu Apr  7 2005 Steve Muir <smuir@cs.princeton.edu>
421 - vuserdel changes: don't shutdown vserver, just kill all processes;
422   unmount all mountpoints in vserver before deleting
423
424 * Thu Mar 24 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.205-0
425 - added some %%descriptions
426 - copy GPG keys from the system into the confdir
427 - buildrequire dietlibc-0.25
428 - BuildRequire beecrypt-devel
429 - cleanups
430 - use %%global instead of %%define
431 - removed 'run.rev' as a vserver-local variable and made it a system-wide setting
432
433 * Wed Jan 26 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.198-0.3
434 - updated BuildRequires:
435 - use 'setattr --barrier' instead of 'chattr +t' in the %%post scriptlet
436 - moved the v_* initscripts to legacy
437 - do not ship the /vservers directory itself; as it is immutable, the
438   extraction will fail else
439
440 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
441 - vcached no longer runs as a daemon
442 - do not restart vservers when package is upgraded
443
444 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
445 + planetlab-3_0-rc4
446 - PL2445
447 - Both vcached and vuseradd now print a warning message when vbuild
448   succeeds but the resulting new vserver image is smaller in size than
449   the vserver-reference image.
450 - vuseradd: clean up some more junk on failure
451
452 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
453 + planetlab-3_0-rc3
454 - PL3026: This is the upgraded version of vdu that maintains an
455   internal hash table of files with a nlink count > 1.  Only if vdu
456   sees all hard links to a particular inode does it add its size and
457   block count to the total.
458
459 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
460 - PL2445 Use -b option to du to avoid rounding errors.
461
462 * Sat Nov  6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
463 + planetlab-3_0-rc2
464 - don't create the symbolic link /home/slice/.ssh, this is not how
465   pl_sshd works
466
467 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
468 - added vsh
469
470 * Thu Sep  9 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.30.194-0
471 - documented switches for 'rpmbuild'
472
473 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
474 - initial PlanetLab 3.0 build.
475
476 * Wed May 26 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.215-0
477 - (re)added the MANIFEST_* variables which were lost some time ago;
478   this will preserve %%config files...
479
480 * Mon Mar 15 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.202-0
481 - use file-list for sysv scripts also
482
483 * Sat Mar  6 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.198-0
484 - added vprocunhide-service support
485 - added doxygen support
486 - updated Requires:
487
488 * Wed Oct  1 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.5-0
489 - Initial build.