- run createrepo with the correct -g option
[bootcd.git] / bootcd.spec
1 %define name bootcd
2 %define version 3.3
3 %define release 1%{?pldistro:.%{pldistro}}%{?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 rm -f $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
38 bzip2 -c PlanetLab-BootCD-%{version}.iso > \
39     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
40 md5sum $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2 >> \
41         $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
42
43 bzip2 -c PlanetLab-BootCD-%{version}.usb > \
44     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
45 md5sum $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2 >> \
46         $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
47
48 bzip2 -c PlanetLab-BootCD-%{version}-biginitrd.usb > \
49     $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}-biginitrd.usb.bz2
50 md5sum $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}-biginitrd.usb.bz2 >> \
51         $RPM_BUILD_ROOT/var/www/html/download/PlanetLab-BootCD-%{version}.md5
52 popd
53     
54 # If run under sudo, allow user to delete the build directory
55 if [ -n "$SUDO_USER" ] ; then
56     chown -R $SUDO_USER .
57     # Some temporary cdroot files like /var/empty/sshd and
58     # /usr/bin/sudo get created with non-readable permissions.
59     find . -not -perm +0600 -exec chmod u+rw {} \;
60 fi
61
62 %clean
63 rm -rf $RPM_BUILD_ROOT
64
65 # If run under sudo, allow user to delete the built RPM
66 if [ -n "$SUDO_USER" ] ; then
67     chown $SUDO_USER %{_rpmdir}/%{_arch}/%{name}-%{version}-%{release}.%{_arch}.rpm
68 fi
69
70 %post
71 cat <<EOF
72 Remember to GPG sign
73 /var/www/html/download/PlanetLab-BootCD-%{version}.{iso,usb}.bz2 with
74 the PlanetLab private key.
75 EOF
76
77 %files
78 %defattr(-,root,root,-)
79 /var/www/html/download/PlanetLab-BootCD-%{version}.iso.bz2
80 /var/www/html/download/PlanetLab-BootCD-%{version}.usb.bz2
81 /var/www/html/download/PlanetLab-BootCD-%{version}-biginitrd.usb.bz2
82 /var/www/html/download/PlanetLab-BootCD-%{version}.md5
83
84 %changelog
85 * Mon Jan 29 2006 Marc E. Fiuczynski <mef@cs.princeton.edu> - 
86 - added biginitrd usb image
87
88 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
89 - Initial build.
90