- merge revision 1.2
[bootcd.git] / bootcd.spec
1 %define name bootcd
2 %define version 3.2
3 %define release 1.planetlab%{?date:.%{date}}
4 # XXX Get this from /etc/planetlab
5 %define configuration default
6
7 Vendor: PlanetLab
8 Packager: PlanetLab Central <support@planet-lab.org>
9 Distribution: PlanetLab 3.2
10 URL: http://cvs.planet-lab.org/cvs/bootcd_v3
11
12 Summary: The PlanetLab Boot CD
13 Name: bootcd
14 Version: %{version}
15 Release: %{release}
16 License: BSD
17 Group: System Environment/Base
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
20
21 AutoReqProv: no
22 %define debug_package %{nil}
23
24 %description
25 The PlanetLab Boot CD securely boots PlanetLab nodes into an immutable
26 environment.
27
28 %prep
29 %setup -q
30
31 %build
32 ./build.sh build %{configuration}
33
34 %install
35 install -d $RPM_BUILD_ROOT/var/www/html/download
36 pushd build/%{configuration}
37 bzip2 -c PlanetLab-BootCD-%{version}.iso > \
38     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
39 bzip2 -c PlanetLab-BootCD-%{version}.usb > \
40     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
41 md5sum PlanetLab-BootCD-%{version}.{iso,usb} >> \
42     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
43 cd $RPM_BUILD_ROOT/var/www/html/download/
44 md5sum PlanetLab-BootCD-%{version}.{iso,usb}.bz2 >> \
45     PlanetLab-BootCD-%{version}.md5
46 popd
47     
48 # If run under sudo, allow user to delete the build directory
49 if [ -n "$SUDO_USER" ] ; then
50     chown -R $SUDO_USER .
51     # Some temporary cdroot files like /var/empty/sshd and
52     # /usr/bin/sudo get created with non-readable permissions.
53     find . -not -perm +0600 -exec chmod u+rw {} \;
54 fi
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 # If run under sudo, allow user to delete the built RPM
60 if [ -n "$SUDO_USER" ] ; then
61     chown $SUDO_USER %{_rpmdir}/%{_arch}/%{name}-%{version}-%{release}.%{_arch}.rpm
62 fi
63
64 %post
65 cat <<EOF
66 Remember to GPG sign
67 /var/www/html/download/PlanetLab-BootCD-%{version}.{iso,usb}.bz2 with
68 the PlanetLab private key.
69 EOF
70
71 %files
72 %defattr(-,root,root,-)
73 /var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
74 /var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
75 /var/www/html/download/PlanetLab-BootCD-%{version}.md5
76
77 %changelog
78 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
79 - Initial build.
80