Second step towards multiarch myplc https://svn.planet-lab.org/ticket/214
[bootstrapfs.git] / bootstrapfs.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define name bootstrapfs
7 %define version 0.1
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: The PlanetLab Bootstrap Filesystems
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 # other archs must be able to install this
26 BuildArch: noarch
27
28 Requires: tar, gnupg, sharutils, bzip2
29
30 AutoReqProv: no
31 %define debug_package %{nil}
32
33 %description
34
35 The PlanetLab Bootstrap Filesystem(s) are downloaded by the
36 BootManager to instantiate a node with a new filesystem.
37
38 %prep
39 %setup -q
40
41 %build
42 pushd BootstrapFS
43 ./build.sh %{pldistro} 
44 popd BootstrapFS
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48
49 pushd BootstrapFS
50 arch=$(uname -i)
51
52 install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar.bz2 \
53         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar.bz2
54
55 for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do 
56     NAME=$(basename $pkgs .pkgs | sed -e s,bootstrapfs-,,)
57     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar.bz2 \
58                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar.bz2 
59 done
60
61 popd
62
63 %clean
64 rm -rf $RPM_BUILD_ROOT
65
66 # If run under sudo
67 if [ -n "$SUDO_USER" ] ; then
68     # Allow user to delete the build directory
69     chown -h -R $SUDO_USER .
70     # Some temporary cdroot files like /var/empty/sshd and
71     # /usr/bin/sudo get created with non-readable permissions.
72     find . -not -perm +0600 -exec chmod u+rw {} \;
73     # Allow user to delete the built RPM(s)
74     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
75 fi
76
77 %post
78
79 %files
80 %defattr(-,root,root,-)
81 /var/www/html/boot/bootstrapfs*.tar.bz2
82
83 %changelog
84 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
85 - search more carefully for alternate pkgs files
86 - handling of sysconfig/crontab and creation of site_admin reviewed
87 - (this tag is set with module-tag.py)
88
89 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
90 - Initial build.