- vcached no longer runs as a daemon
[util-vserver.git] / util-vserver.spec
1 %define name util-vserver
2 %define version 0.30
3 %define release 6.planetlab%{?date:.%{date}}
4
5 Vendor: PlanetLab
6 Packager: PlanetLab Central <support@planet-lab.org>
7 Distribution: PlanetLab 3.0
8 URL: http://cvs.planet-lab.org/cvs/util-vserver
9
10 %define __chattr        /usr/bin/chattr
11
12 Summary:        Linux virtual server utilities
13 Name:           %{name}
14 Version:        %{version}
15 Release:        %{release}
16 Epoch:          0
17 Copyright:      GPL
18 Group:          System Environment/Base
19 Source0:        http://savannah.nongnu.org/download/util-vserver/stable.pkg/%version/%name-%version.tar.bz2
20 Provides:       %name-devel = %epoch:%version-%release
21 BuildRoot:      %_tmppath/%name-%version-%release-root
22 Provides:       vserver = %epoch:%version-%release
23 Conflicts:      vserver < %epoch:%version-%release
24 Conflicts:      vserver > %epoch:%version-%release
25 BuildRequires:  e2fsprogs-devel
26 Requires(post): %__chattr
27
28 %package linuxconf
29 Summary:        Linuxconf administration modules for vservers
30 Group:          Applications/System
31 Requires:       %name = %epoch:%version-%release
32 Provides:       vserver-admin = %epoch:%version-%release
33 Conflicts:      vserver-admin < %epoch:%version-%release
34 Conflicts:      vserver-admin > %epoch:%version-%release
35
36 %description
37 This package provides the components and a framework to setup virtual
38 servers.  A virtual server runs inside a linux server. It is nevertheless
39 highly independent. As such, you can run various services with normal
40 configuration. The various vservers can't interact with each other and
41 can't interact with services in the main server.
42
43 This requires a special kernel supporting the new new_s_context and
44 set_ipv4root system call.
45
46
47 %description linuxconf
48 This package provides the components to setup virtual servers with
49 linuxconf.
50
51
52 %prep
53 %setup -q
54 aclocal -I m4
55 autoconf
56 automake --add-missing
57 # bootstrap to avoid BuildRequires of kernel-source
58 for linux in $RPM_BUILD_DIR/linux-* /lib/modules/`uname -r`/build ; do
59    [[ -d $linux/include ]] && %configure --with-kerneldir=$linux --enable-linuxconf && break
60 done
61
62
63 %build
64 make
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 %__make DESTDIR=$RPM_BUILD_ROOT install
69
70 mkdir -p $RPM_BUILD_ROOT/vservers
71 test "%_initrddir" = %_sysconfdir/init.d || {
72         mkdir -p ${RPM_BUILD_ROOT}%_initrddir
73         mv ${RPM_BUILD_ROOT}%_sysconfdir/init.d/* ${RPM_BUILD_ROOT}%_initrddir/
74 }
75
76 mkdir -p ${RPM_BUILD_ROOT}/bin
77 ln -f ${RPM_BUILD_ROOT}%_sbindir/vsh ${RPM_BUILD_ROOT}/bin/vsh
78
79 install -D -m 644 sysv/vcached.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/vcached
80
81 mkdir -p $RPM_BUILD_ROOT/etc/cron.d
82 . sysv/vcached.conf
83 echo "*/$(($period / 60)) * * * * root %_sbindir/vcached -s -f -l $logfile" > $RPM_BUILD_ROOT/etc/cron.d/vcached
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %pre
89 # 1 = install, 2 = upgrade/reinstall
90 if [ $1 -eq 2 ] ; then
91     # vcached no longer runs as a daemon
92     [ "`/sbin/runlevel`" = "unknown" ] || service vcached stop || :
93 fi
94
95 %post
96 # vcached no longer runs as a daemon
97 chkconfig vcached off
98 chkconfig --del vcached
99 if [ ! -f /etc/shells ] || ! grep -q '^/bin/vsh$' /etc/shells ; then
100     echo /bin/vsh >> /etc/shells
101 fi
102 # make sure immutable bit is set on /vservers for safety
103 %__chattr +t /vservers || :
104
105 %postun
106 # 0 = erase, 1 = upgrade
107 if [ "$1" = 0 ] ; then
108     perl -i -n -e 'next if /^\/bin\/vsh$/; print' /etc/shells
109 fi
110
111 %preun
112 # 0 = erase, 1 = upgrade
113 if [ $1 -eq 0 ] ; then
114     [ "`/sbin/runlevel`" = "unknown" ] || service vservers stop
115     chkconfig vservers off
116     chkconfig --del vservers
117 fi
118
119 %files
120 %defattr(-,root,root)
121 %doc AUTHORS COPYING ChangeLog NEWS README THANKS
122 %_sbindir/*
123 %_libdir/%name
124 %_includedir/vserver.h
125 %_libdir/libvserver.a
126 %_mandir/man8/*
127 %config %_initrddir/*
128 %config(noreplace) /etc/vservers.conf
129 %config(noreplace) /etc/vcached.conf
130 /etc/logrotate.d/vcached
131 /etc/cron.d/vcached
132 %dir /etc/vservers
133 %attr(0,root,root) %dir /vservers
134 %attr(4755,root,root) /usr/sbin/vsh
135 %attr(4755,root,root) /bin/vsh
136
137 %exclude %_sbindir/newvserver
138 %exclude %_mandir/man8/newvserver*
139
140 %files linuxconf
141 %defattr(-,root,root)
142 %config(noreplace) /etc/vservers/newvserver.defaults
143 %_sbindir/newvserver
144 %_mandir/man8/newvserver*
145
146 %changelog
147 * Fri Nov 19 2004 Mark Huang <mlhuang@cs.princeton.edu>
148 - vcached no longer runs as a daemon
149 - do not restart vservers when package is upgraded
150
151 * Wed Nov 17 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-6.planetlab
152 + planetlab-3_0-rc4
153 - PL2445
154 - Both vcached and vuseradd now print a warning message when vbuild
155   succeeds but the resulting new vserver image is smaller in size than
156   the vserver-reference image.
157 - vuseradd: clean up some more junk on failure
158
159 * Tue Nov 16 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-5.planetlab
160 + planetlab-3_0-rc3
161 - PL3026: This is the upgraded version of vdu that maintains an
162   internal hash table of files with a nlink count > 1.  Only if vdu
163   sees all hard links to a particular inode does it add its size and
164   block count to the total.
165
166 * Fri Nov 12 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-4.planetlab
167 - PL2445 Use -b option to du to avoid rounding errors.
168
169 * Sat Nov  6 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.30-3.planetlab
170 + planetlab-3_0-rc2
171 - don't create the symbolic link /home/slice/.ssh, this is not how
172   pl_sshd works
173
174 * Mon Oct 11 2004 Marc E. Fiuczynski <mef@cs.princeton.edu>
175 - added vsh
176
177 * Wed Aug 11 2004 Mark Huang <mlhuang@cs.princeton.edu> 0.29-1.planetlab
178 - initial PlanetLab 3.0 build.
179
180 * Thu Mar 18 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.29.3-0
181 - removed '%%doc doc/FAQ.txt' since file does not exist anymore
182
183 * Fri Sep 26 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0:0.23.4-1
184 - initial build.
185