Support old BootCDs which do not have pypcilib.
[bootmanager.git] / bootmanager.spec
1 #
2 # $Id: bootmanager.spec 856 2007-09-21 13:54:58Z thierry $
3 #
4 %define name bootmanager
5 %define version 3.2
6 %define subversion 1
7
8 %define release %{subversion}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
9
10 Vendor: PlanetLab
11 Packager: PlanetLab Central <support@planet-lab.org>
12 Distribution: PlanetLab 4.2
13 URL: http://cvs.planet-lab.org/cvs/bootmanager
14
15 Summary: The PlanetLab Boot Manager
16 Name: %{name}
17 Version: %{version}
18 Release: %{release}
19 License: BSD
20 Group: System Environment/Base
21 Source0: %{name}-%{version}.tar.gz
22 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
23
24 Requires: tar, gnupg, sharutils, bzip2, pypcilib
25
26 AutoReqProv: no
27 %define debug_package %{nil}
28
29 %description
30 The PlanetLab Boot Manager securely authenticates and boots PlanetLab
31 nodes.
32
33 %prep
34 %setup -q
35
36 %build
37 pushd BootManager
38 ./build.sh
39 popd
40
41 %install
42 rm -rf $RPM_BUILD_ROOT
43
44 pushd BootManager
45
46 # Install source so that it can be rebuilt
47 find build.sh source | cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/
48
49 install -D -m 755 bootmanager.sh $RPM_BUILD_ROOT/var/www/html/boot/bootmanager.sh
50
51 # This is only required for 2.x bootcds.
52 install -D -m 644 support-files/uudecode.gz $RPM_BUILD_ROOT/var/www/html/boot/uudecode.gz
53
54 popd
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 # If run under sudo
60 if [ -n "$SUDO_USER" ] ; then
61     # Allow user to delete the build directory
62     chown -h -R $SUDO_USER .
63     # Some temporary cdroot files like /var/empty/sshd and
64     # /usr/bin/sudo get created with non-readable permissions.
65     find . -not -perm +0600 -exec chmod u+rw {} \;
66     # Allow user to delete the built RPM(s)
67     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
68 fi
69
70 %post
71 cat <<EOF
72 Remember to GPG sign /var/www/html/boot/bootmanager.sh with the
73 PlanetLab private key.
74 EOF
75
76 %files
77 %defattr(-,root,root,-)
78 %{_datadir}/%{name}
79 /var/www/html/boot/*
80
81 %changelog
82 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
83 - Initial build.