merge to HEAD as of 2006-08-21
[bootcd.git] / bootcd.spec
1 %define name bootcd
2 %define version 3.3
3 %define release 2%{?pldistro:.%{pldistro}}%{?date:.%{date}}
4
5 Vendor: PlanetLab
6 Packager: PlanetLab Central <support@planet-lab.org>
7 Distribution: PlanetLab 3.3
8 URL: http://cvs.planet-lab.org/cvs/bootcd
9
10 Summary: Boot CD
11 Name: bootcd
12 Version: %{version}
13 Release: %{release}
14 License: BSD
15 Group: System Environment/Base
16 Source0: %{name}-%{version}.tar.gz
17 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
18
19 Requires: dosfstools, mkisofs, gzip
20
21 AutoReqProv: no
22 %define debug_package %{nil}
23
24 %description
25 The Boot CD securely boots PlanetLab nodes into an immutable
26 environment.
27
28 %package planetlab
29 Summary: PlanetLab Boot CD
30 Group: System Environment/Base
31
32 %description planetlab
33 The default PlanetLab Boot CD, customized to boot from PlanetLab
34 Central servers.
35
36 %prep
37 %setup -q
38
39 %build
40 pushd bootcd
41
42 # Build the reference image
43 ./prep.sh
44
45 # Build the default configuration (PlanetLab)
46 ./build.sh
47
48 md5sum PlanetLab-BootCD-%{version}.{iso,usb} \
49     >PlanetLab-BootCD-%{version}.md5
50
51 popd
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55
56 pushd bootcd
57
58 # Install the reference image and build scripts
59 install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}
60 install -m 755 build.sh $RPM_BUILD_ROOT/%{_datadir}/%{name}/
61 tar cpf - \
62     build/isofs/bootcd.img \
63     build/isofs/isolinux.bin \
64     build/isofs/kernel \
65     build/passwd \
66     build/version.txt \
67     configurations \
68     syslinux/unix/syslinux | \
69     tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -xpf -
70
71 # Install the default images in the download/ directory
72 install -d -m 755 $RPM_BUILD_ROOT/var/www/html/download
73 install -m 644 PlanetLab-BootCD-%{version}.* \
74     $RPM_BUILD_ROOT/var/www/html/download/
75
76 popd
77     
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 # If run under sudo
82 if [ -n "$SUDO_USER" ] ; then
83     # Allow user to delete the build directory
84     chown -R $SUDO_USER .
85     # Some temporary cdroot files like /var/empty/sshd and
86     # /usr/bin/sudo get created with non-readable permissions.
87     find . -not -perm +0600 -exec chmod u+rw {} \;
88     # Allow user to delete the built RPM(s)
89     chown -R $SUDO_USER %{_rpmdir}/%{_arch}
90 fi
91
92 %post planetlab
93 cat <<EOF
94 Remember to GPG sign
95 /var/www/html/download/PlanetLab-BootCD-%{version}.{iso,usb} with
96 the PlanetLab private key.
97 EOF
98
99 %files
100 %defattr(-,root,root,-)
101 %{_datadir}/%{name}
102
103 %files planetlab
104 %defattr(-,root,root,-)
105 /var/www/html/download
106
107 %changelog
108 * Mon Jan 29 2006 Marc E. Fiuczynski <mef@cs.princeton.edu> - 
109 - added biginitrd usb image
110
111 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
112 - Initial build.
113