naming .lst files after pldistro - including the <pldistro>-filesystems directory
[bootstrapfs.git] / bootstrapfs.spec
1 %define name bootstrapfs
2 %define version 0.1
3 %define release 0%{?pldistro:.%{pldistro}}%{?date:.%{date}}
4
5 Vendor: PlanetLab
6 Packager: PlanetLab Central <support@planet-lab.org>
7 Distribution: PlanetLab 4.2
8 URL: http://svn.planet-lab.org/svn/BootStrapFS/
9
10 Summary: The PlanetLab Bootstrap Filesystems
11 Name: %{name}
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: tar, gnupg, sharutils, bzip2
20
21 AutoReqProv: no
22 %define debug_package %{nil}
23
24 %description
25
26 The PlanetLab Bootstrap Filesystem(s) are downloaded by the
27 BootManager to instantiate a node with a new filesystem.
28
29 %prep
30 %setup -q
31
32 %build
33 pushd BootstrapFS
34 ./build.sh %{pldistro}
35 popd BootstrapFS
36
37 %install
38 rm -rf $RPM_BUILD_ROOT
39
40 pushd BootstrapFS
41
42 install -D -m 644 PlanetLab-Bootstrap.tar.bz2 \
43         $RPM_BUILD_ROOT/var/www/html/boot/PlanetLab-Bootstrap.tar.bz2
44
45 for bootstrapfs in $(ls bootstrap-filesystems/*.lst) ; do 
46         NAME=$(basename $bootstrapfs .lst)
47         install -D -m 644 %{pldistro}-filesystems/PlanetLab-Bootstrap-${NAME}.tar.bz2 \
48                 $RPM_BUILD_ROOT/var/www/html/boot/PlanetLab-Bootstrap-${NAME}.tar.bz2
49 done
50
51 popd
52
53 %clean
54 rm -rf $RPM_BUILD_ROOT
55
56 # If run under sudo
57 if [ -n "$SUDO_USER" ] ; then
58     # Allow user to delete the build directory
59     chown -h -R $SUDO_USER .
60     # Some temporary cdroot files like /var/empty/sshd and
61     # /usr/bin/sudo get created with non-readable permissions.
62     find . -not -perm +0600 -exec chmod u+rw {} \;
63     # Allow user to delete the built RPM(s)
64     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
65 fi
66
67 %post
68
69
70 %files
71 %defattr(-,root,root,-)
72 /var/www/html/boot/PlanetLab-Bootstrap*.tar.bz2
73
74 %changelog
75 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
76 - Initial build.