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