ready for tagging
[bootcd.git] / bootcd.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define name bootcd
7 %define version 3.4
8 %define taglevel 2
9
10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
11
12 Vendor: PlanetLab
13 Packager: PlanetLab Central <support@planet-lab.org>
14 Distribution: PlanetLab %{plrelease}
15 URL: %(echo %{url} | cut -d ' ' -f 2)
16
17 Summary: Boot CD
18 Name: %{name}
19 Version: %{version}
20 Release: %{release}
21 License: BSD
22 Group: System Environment/Base
23 Source0: %{name}-%{version}.tar.gz
24 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
25
26 Requires: dosfstools, mkisofs, gzip, mtools, syslinux
27
28 AutoReqProv: no
29 %define debug_package %{nil}
30
31 %description
32 The Boot CD securely boots PlanetLab nodes into an immutable
33 environment.
34
35 %prep
36 %setup -q
37
38 %build
39 pushd BootCD
40
41 # Build the reference image
42 ./prep.sh %{pldistro}
43
44 popd
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48
49 pushd  BootCD
50
51 # Install the reference image and build scripts
52 install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}
53 install -m 755 build.sh $RPM_BUILD_ROOT/%{_datadir}/%{name}/
54 tar cpf - \
55     build/isofs/bootcd.img \
56     build/isofs/kernel \
57     build/passwd \
58     build/version.txt \
59         bootcustom.sh \
60     configurations | \
61     tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -xpf -
62
63 popd
64     
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 # If run under sudo
69 if [ -n "$SUDO_USER" ] ; then
70     # Allow user to delete the build directory
71     chown -h -R $SUDO_USER .
72     # Some temporary cdroot files like /var/empty/sshd and
73     # /usr/bin/sudo get created with non-readable permissions.
74     find . -not -perm +0600 -exec chmod u+rw {} \;
75     # Allow user to delete the built RPM(s)
76     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
77 fi
78
79 %files
80 %defattr(-,root,root,-)
81 %{_datadir}/%{name}
82
83 %changelog
84 * Mon Jan 29 2006 Marc E. Fiuczynski <mef@cs.princeton.edu> - 
85 - added biginitrd usb image
86
87 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
88 - Initial build.
89