Support old BootCDs which do not have pypcilib.
[bootmanager.git] / bootmanager.spec
index 35006a7..9098895 100644 (file)
@@ -1,14 +1,19 @@
+#
+# $Id: bootmanager.spec 856 2007-09-21 13:54:58Z thierry $
+#
 %define name bootmanager
-%define version 3.1
-%define release 3.planetlab%{?date:.%{date}}
+%define version 3.2
+%define subversion 1
+
+%define release %{subversion}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 
 Vendor: PlanetLab
 Packager: PlanetLab Central <support@planet-lab.org>
-Distribution: PlanetLab 3.0
+Distribution: PlanetLab 4.2
 URL: http://cvs.planet-lab.org/cvs/bootmanager
 
 Summary: The PlanetLab Boot Manager
-Name: bootmanager
+Name: %{name}
 Version: %{version}
 Release: %{release}
 License: BSD
@@ -16,6 +21,8 @@ Group: System Environment/Base
 Source0: %{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
+Requires: tar, gnupg, sharutils, bzip2, pypcilib
+
 AutoReqProv: no
 %define debug_package %{nil}
 
@@ -27,30 +34,37 @@ nodes.
 %setup -q
 
 %build
+pushd BootManager
 ./build.sh
-make -C support-files
+popd
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+pushd BootManager
+
+# Install source so that it can be rebuilt
+find build.sh source | cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/
+
 install -D -m 755 bootmanager.sh $RPM_BUILD_ROOT/var/www/html/boot/bootmanager.sh
-for tarball in \
-    alpina-BootLVM.tar.gz \
-    alpina-PartDisks.tar.gz \
-    PlanetLab-Bootstrap.tar.bz2 ; do
-  install -D -m 644 support-files/$tarball $RPM_BUILD_ROOT/var/www/html/boot/$tarball
-done
-
-# If run under sudo, allow user to delete the build directory
-if [ -n "$SUDO_USER" ] ; then
-    chown -R $SUDO_USER .
-fi
+
+# This is only required for 2.x bootcds.
+install -D -m 644 support-files/uudecode.gz $RPM_BUILD_ROOT/var/www/html/boot/uudecode.gz
+
+popd
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-# If run under sudo, allow user to delete the built RPM
+# If run under sudo
 if [ -n "$SUDO_USER" ] ; then
-    chown $SUDO_USER %{_rpmdir}/%{_arch}/%{name}-%{version}-%{release}.%{_arch}.rpm
+    # Allow user to delete the build directory
+    chown -h -R $SUDO_USER .
+    # Some temporary cdroot files like /var/empty/sshd and
+    # /usr/bin/sudo get created with non-readable permissions.
+    find . -not -perm +0600 -exec chmod u+rw {} \;
+    # Allow user to delete the built RPM(s)
+    chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
 fi
 
 %post
@@ -61,9 +75,9 @@ EOF
 
 %files
 %defattr(-,root,root,-)
+%{_datadir}/%{name}
 /var/www/html/boot/*
 
 %changelog
 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
 - Initial build.
-