add bootcd_v3 to automated build
[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 fi
52
53 %clean
54 rm -rf $RPM_BUILD_ROOT
55
56 # If run under sudo, allow user to delete the built RPM
57 if [ -n "$SUDO_USER" ] ; then
58     chown $SUDO_USER %{_rpmdir}/%{_arch}/%{name}-%{version}-%{release}.%{_arch}.rpm
59 fi
60
61 %post
62 cat <<EOF
63 Remember to GPG sign
64 /var/www/html/download/PlanetLab-BootCD-%{version}.{iso,usb}.bz2 with
65 the PlanetLab private key.
66 EOF
67
68 %files
69 %defattr(-,root,root,-)
70 /var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
71 /var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
72 /var/www/html/download/PlanetLab-BootCD-%{version}.md5
73
74 %changelog
75 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
76 - Initial build.
77