+ added to branch.
[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 -r $([ -f "/etc/fedora-release" ] && awk ' { print $4 } ' /etc/fedora-release || echo 4)
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         bootcustom.sh \
68     configurations \
69     syslinux/unix/syslinux | \
70     tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -xpf -
71
72 # Install the default images in the download/ directory
73 install -d -m 755 $RPM_BUILD_ROOT/var/www/html/download
74 install -m 644 PlanetLab-BootCD-%{version}.* \
75     $RPM_BUILD_ROOT/var/www/html/download/
76
77 popd
78     
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 # If run under sudo
83 if [ -n "$SUDO_USER" ] ; then
84     # Allow user to delete the build directory
85     chown -h -R $SUDO_USER .
86     # Some temporary cdroot files like /var/empty/sshd and
87     # /usr/bin/sudo get created with non-readable permissions.
88     find . -not -perm +0600 -exec chmod u+rw {} \;
89     # Allow user to delete the built RPM(s)
90     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
91 fi
92
93 %post planetlab
94 cat <<EOF
95 Remember to GPG sign
96 /var/www/html/download/PlanetLab-BootCD-%{version}.{iso,usb} with
97 the PlanetLab private key.
98 EOF
99
100 %files
101 %defattr(-,root,root,-)
102 %{_datadir}/%{name}
103
104 %files planetlab
105 %defattr(-,root,root,-)
106 /var/www/html/download
107
108 %changelog
109 * Mon Jan 29 2006 Marc E. Fiuczynski <mef@cs.princeton.edu> - 
110 - added biginitrd usb image
111
112 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
113 - Initial build.
114