yet another fix
[nodeimage.git] / bootstrapfs.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define nodefamily %{pldistro}-%{_arch}
7
8 %define name bootstrapfs-%{nodefamily}
9 %define version 0.1
10 %define taglevel 2
11
12 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
13
14 Vendor: PlanetLab
15 Packager: PlanetLab Central <support@planet-lab.org>
16 Distribution: PlanetLab %{plrelease}
17 URL: %(echo %{url} | cut -d ' ' -f 2)
18
19 Summary: The PlanetLab Bootstrap Filesystems
20 Name: %{name}
21 Version: %{version}
22 Release: %{release}
23 License: BSD
24 Group: System Environment/Base
25 Source0: %{name}-%{version}.tar.gz
26 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
27 # other archs must be able to install this
28 BuildArch: noarch
29
30 Requires: tar, gnupg, sharutils, bzip2
31
32 AutoReqProv: no
33 %define debug_package %{nil}
34
35 %description
36
37 The PlanetLab Bootstrap Filesystem(s) are downloaded by the
38 BootManager to instantiate a node with a new filesystem.
39
40 %prep
41 %setup -q
42
43 %build
44 pushd BootstrapFS
45 ./build.sh %{pldistro} 
46 popd BootstrapFS
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50
51 pushd BootstrapFS
52 arch=$(uname -i)
53
54 install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar.bz2 \
55         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar.bz2
56
57 for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do 
58     NAME=$(basename $pkgs .pkgs | sed -e s,bootstrapfs-,,)
59     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar.bz2 \
60                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar.bz2 
61 done
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 %post
80
81 %files
82 %defattr(-,root,root,-)
83 /var/www/html/boot/bootstrapfs*.tar.bz2
84
85 %changelog
86 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
87 - search more carefully for alternate pkgs files
88 - handling of sysconfig/crontab and creation of site_admin reviewed
89 - (this tag is set with module-tag.py)
90
91 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
92 - Initial build.