create sha1 checksum files
[nodeimage.git] / bootstrapfs.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define nodefamily %{pldistro}-%{distroname}-%{_arch}
7 %define extensionfamily %{distroname}-%{_arch}
8
9 %define name bootstrapfs-%{nodefamily}
10 %define version 2.0
11 %define taglevel 5
12
13 # pldistro already in the rpm name
14 #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
15 %define release %{taglevel}%{?date:.%{date}}
16
17 Vendor: PlanetLab
18 Packager: PlanetLab Central <support@planet-lab.org>
19 Distribution: PlanetLab %{plrelease}
20 URL: %(echo %{url} | cut -d ' ' -f 2)
21
22 Summary: The PlanetLab Bootstrap Filesystems for %{nodefamily}
23 Name: %{name}
24 Version: %{version}
25 Release: %{release}
26 License: BSD
27 Group: System Environment/Base
28 Source0: %{name}-%{version}.tar.gz
29 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
30 # other archs must be able to install this
31 BuildArch: noarch
32
33 Requires: tar, gnupg, sharutils, bzip2
34
35 # 5.0 now has 3-fold nodefamily
36 %define obsolete_nodefamily %{pldistro}-%{_arch}
37 Obsoletes: bootstrapfs-%{obsolete_nodefamily}
38
39 AutoReqProv: no
40 %define debug_package %{nil}
41
42 %description
43
44 The PlanetLab Bootstrap Filesystem(s) are downloaded by the
45 BootManager to instantiate a node with a new filesystem.
46
47 %package plain
48 Summary: The (uncompressed) PlanetLab Bootstrap Filesystems for %{nodefamily}
49 Group: System Environment/Base
50 %description plain
51 This package provides the same functions as %{name} but with uncompressed tarball for faster tests.
52
53 %package -n nodeyum
54 Summary: the MyPLC-side utilities for tweaking nodes yum configs
55 Group: System Environment/Base
56 %description -n nodeyum 
57 Utility scripts for configuring node updates. This package is designed
58 for the MyPLC side.
59
60 %prep
61 %setup -q
62
63 %build
64
65 ############################## node-side
66 pushd BootstrapFS
67 ./build.sh %{pldistro} 
68 popd
69
70 ############################## server-side
71 # ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
72 pushd BootstrapFS/nodeconfig/yum
73 # scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
74 for fcdistro in $(ls); do
75     [ -d $fcdistro ] || continue
76     # get kexcludes for that distro
77     KEXCLUDE="exclude=$(../../../build/getkexcludes.sh -f $fcdistro)"
78     pushd $fcdistro/yum.myplc.d
79     echo "* Handling KEXCLUDE in yum repo for $fcdistro ($KEXCLUDE)"
80     for filein in $(find . -name '*.in') ; do
81         file=$(echo $filein | sed -e "s,\.in$,,")
82         sed -e "s,@KEXCLUDE@,$KEXCLUDE,g" $filein > $file
83     done
84     rm -f stock.repo
85     cat *.repo > stock.repo
86     popd
87 done
88 popd
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92
93 ############################## node-side
94 pushd BootstrapFS
95
96 install -D -m 644 bootstrapfs-%{nodefamily}.tar.bz2 \
97         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2
98 sha1sum $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2 > \
99         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2.sha1sum
100
101 install -D -m 644 bootstrapfs-%{nodefamily}.tar \
102         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar
103 sha1sum $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar > \
104         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.sha1sum
105
106 for pkgs in $(ls ../build/config.%{pldistro}/bootstrapfs-*.pkgs) ; do 
107     NAME=$(basename $pkgs .pkgs | sed -e s,bootstrapfs-,,)
108     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar.bz2 \
109                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar.bz2 
110     sha1sum $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{nodefamily}.tar.bz2 > \
111         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{nodefamily}.tar.bz2.sha1sum
112
113     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar \
114                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar
115     sha1sum $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar > \
116         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar.sha1sum
117 done
118 popd
119
120 ############################## server-side
121 # ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
122 pushd BootstrapFS
123 echo "* Installing MyPLC-side nodes yum config utilities (support for multi-fcdistro)"
124 mkdir -p $RPM_BUILD_ROOT/var/www/html/yum/
125 rsync -av ./nodeconfig/yum/     $RPM_BUILD_ROOT/var/www/html/yum/
126
127 # Install initscripts
128 echo "* Installing plc.d initscripts"
129 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
130 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
131
132 echo "* Installing db-config.d files"
133 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
134 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
135 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
136 popd
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141
142 %files
143 %defattr(-,root,root,-)
144 /var/www/html/boot/bootstrapfs*.tar.bz2
145 /var/www/html/boot/bootstrapfs*.tar.bz2.sha1sum
146
147 %files plain
148 %defattr(-,root,root,-)
149 /var/www/html/boot/bootstrapfs*.tar
150 /var/www/html/boot/bootstrapfs*.tar.sha1sum
151
152 %files -n nodeyum
153 %defattr(-,root,root,-)
154 /var/www/html/yum
155 /etc/planetlab/db-config.d
156 /etc/plc.d
157
158 %changelog
159 * Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-5
160 - support different flavours of vservers on nodes
161
162 * Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-4
163 - fix unmatched $ in URL svn keywords
164
165 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-3
166 - choice between various pldistros is not made at build time, but at run time
167 - relies on GetNodeFlavour to expose the node's fcdistro - requires PLCAPI-5.0-5
168 - in addition, the baseurl for the myplc repo is http:// and not https:// anymore
169 - the https method does not work on fedora 12, and GPG is used below anyway
170
171 * Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-2
172 - new slicerepo package for exposing stuff to slivers
173
174 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-1
175 - first working version of 5.0:
176 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
177 - nodefailiy is 3-fold with pldistro-fcdistro-arch
178 - new module nodeyum; first draft has the php scripts and conf_files for tweaking nodes yum config
179
180 * Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
181 - for building on fedora12
182
183 * Thu Oct 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-10
184 - cosmetic change in message at build-time
185
186 * Fri Oct 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-9
187 - can use groups in the pkgs file with +++ for space
188
189 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-8
190 - bugfix for when a .post script is not needed
191
192 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-7
193 - search post-install scripts (.post) in path (distro, then planetlab)
194 - mostly useful for externally-defined pldistros
195
196 * Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-6
197 - fix build bug when dealing with extensions
198
199 * Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-5
200 - optional package bootstrapfs-<pldiftr>-<arch>-plain comes with uncompressed images for faster tests
201
202 * Fri Nov 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-4
203 - cosmetic changes in build: displays duration, and shows up in summary
204
205 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-3
206 - Do not overwrite yumgroups.xml upon updates of noderepo
207
208 * Thu Jul 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-2
209 - uses the right yum.conf when building images
210
211 * Mon May 05 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-1
212 - rpm release tag does not need pldistro as it is already part of the rpm name
213
214 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-0.1-2 BootstrapFS-1.0-0
215 - naming scheme changed, tarball name now contains ''nodefamily'' as <pldistro>-<arch>
216 - new package named 'noderepo' allows to ship the full set of node rpms to another (arch) myplc
217
218 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
219 - search more carefully for alternate pkgs files
220 - handling of sysconfig/crontab and creation of site_admin reviewed
221 - (this tag is set with module-tag.py)
222
223 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
224 - Initial build.
225
226 %define module_current_branch 1.0