handle name changes
[bootstrapfs.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 1.0
10 %define taglevel 12
11
12 # pldistro already in the rpm name
13 #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
14 %define release %{taglevel}%{?date:.%{date}}
15
16 Vendor: PlanetLab
17 Packager: PlanetLab Central <support@planet-lab.org>
18 Distribution: PlanetLab %{plrelease}
19 URL: %(echo %{url} | cut -d ' ' -f 2)
20
21 Summary: The PlanetLab Bootstrap Filesystems for %{nodefamily}
22 Name: %{name}
23 Version: %{version}
24 Release: %{release}
25 License: BSD
26 Group: System Environment/Base
27 Source0: %{name}-%{version}.tar.gz
28 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
29 # other archs must be able to install this
30 BuildArch: noarch
31
32 Requires: tar, gnupg, sharutils, bzip2
33
34 AutoReqProv: no
35 %define debug_package %{nil}
36
37 %description
38
39 The PlanetLab Bootstrap Filesystem(s) are downloaded by the
40 BootManager to instantiate a node with a new filesystem.
41
42 %package plain
43 Summary: The (uncompressed) PlanetLab Bootstrap Filesystems for %{nodefamily}
44 Group: System Environment/Base
45 %description plain
46 This package provides the same functions as %{name} but with uncompressed tarball for faster tests.
47
48 %prep
49 %setup -q
50
51 %build
52 [ -d BootstrapFS ] || ln -s bootstrapfs BootstrapFS 
53 pushd BootstrapFS
54 ./build.sh %{pldistro} 
55 popd BootstrapFS
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59
60 pushd BootstrapFS
61 arch=$(uname -i)
62
63 install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar.bz2 \
64         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar.bz2
65 install -D -m 644 bootstrapfs-%{pldistro}-${arch}.tar \
66         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{pldistro}-${arch}.tar
67
68 for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do 
69     NAME=$(basename $pkgs .pkgs | sed -e s,bootstrapfs-,,)
70     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar.bz2 \
71                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar.bz2 
72     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-${arch}.tar \
73                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-${arch}.tar 
74 done
75
76 popd
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 # If run under sudo
82 if [ -n "$SUDO_USER" ] ; then
83     # Allow user to delete the build directory
84     chown -h -R $SUDO_USER .
85     # Some temporary cdroot files like /var/empty/sshd and
86     # /usr/bin/sudo get created with non-readable permissions.
87     find . -not -perm +0600 -exec chmod u+rw {} \;
88     # Allow user to delete the built RPM(s)
89     chown -h -R $SUDO_USER %{_rpmdir}/*
90 fi
91
92 %post
93
94 %files
95 %defattr(-,root,root,-)
96 /var/www/html/boot/bootstrapfs*.tar.bz2
97
98 %files plain
99 %defattr(-,root,root,-)
100 /var/www/html/boot/bootstrapfs*.tar
101
102 %changelog
103 +* Thu Jan 06 2011 S.Çağlar Onur <caglar@cs.princeton.edu> - BootstrapFS-1.0-12
104 +- handle directory name changes for myplc-docs package as well
105
106 * Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
107 - for building on fedora12
108
109 * Thu Oct 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-10
110 - cosmetic change in message at build-time
111
112 * Fri Oct 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-9
113 - can use groups in the pkgs file with +++ for space
114
115 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-8
116 - bugfix for when a .post script is not needed
117
118 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-7
119 - search post-install scripts (.post) in path (distro, then planetlab)
120 - mostly useful for externally-defined pldistros
121
122 * Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-6
123 - fix build bug when dealing with extensions
124
125 * Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-5
126 - optional package bootstrapfs-<pldiftr>-<arch>-plain comes with uncompressed images for faster tests
127
128 * Fri Nov 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-4
129 - cosmetic changes in build: displays duration, and shows up in summary
130
131 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-3
132 - Do not overwrite yumgroups.xml upon updates of noderepo
133
134 * Thu Jul 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-2
135 - uses the right yum.conf when building images
136
137 * Mon May 05 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-1
138 - rpm release tag does not need pldistro as it is already part of the rpm name
139
140 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-0.1-2 BootstrapFS-1.0-0
141 - naming scheme changed, tarball name now contains ''nodefamily'' as <pldistro>-<arch>
142 - new package named 'noderepo' allows to ship the full set of node rpms to another (arch) myplc
143
144 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
145 - search more carefully for alternate pkgs files
146 - handling of sysconfig/crontab and creation of site_admin reviewed
147 - (this tag is set with module-tag.py)
148
149 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
150 - Initial build.