and again
[bootstrapfs.git] / nodeimage.spec
1 %define nodefamily %{pldistro}-%{distroname}-%{_arch}
2 %define extensionfamily %{distroname}-%{_arch}
3
4 %define name nodeimage-%{nodefamily}
5 %define version 5.2
6 %define taglevel 9
7
8 # pldistro already in the rpm name
9 #%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
10 %define release %{taglevel}%{?date:.%{date}}
11
12 # we don't really need the standard postinstall process from rpm that
13 # strips files and byte-compiles python files. all files in this
14 # package are comming from other rpm files and they've already went
15 # through this post install processing. - baris
16 %define __os_install_post %{nil}
17
18 Vendor: PlanetLab
19 Packager: PlanetLab Central <support@planet-lab.org>
20 Distribution: PlanetLab %{plrelease}
21 URL: %{SCMURL}
22
23 Summary: The PlanetLab nodeimage filesystems for %{nodefamily}
24 Name: %{name}
25 Version: %{version}
26 Release: %{release}
27 License: BSD
28 Group: System Environment/Base
29 Source0: %{name}-%{version}.tar.gz
30 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
31 # other archs must be able to install this
32 BuildArch: noarch
33
34 Requires: tar, sharutils, bzip2
35 # see myplc/plc.d/gpg for more details on the gnupg / gpg topic
36 %if "%{distro}" == "Fedora" && %{distrorelease} >= 31
37 Requires: gnupg1
38 %else
39 Requires: gnupg
40 %endif
41
42 # this is for plc.d/packages that uses ed for hacking yumgroups.xml
43 Requires: ed
44
45 # 5.1 now uses new name nodeimage
46 Obsoletes: bootstrapfs-%{nodefamily}
47 # 5.0 now has 3-fold nodefamily
48 %define obsolete_nodefamily %{pldistro}-%{_arch}
49 Obsoletes: bootstrapfs-%{obsolete_nodefamily}
50
51 AutoReqProv: no
52 %define debug_package %{nil}
53
54 %description
55
56 The PlanetLab nodeimage filesystem is downloaded by the
57 BootManager to reinstall a node with a new filesystem.
58
59 %package plain
60 Summary: The (uncompressed) PlanetLab nodeimage filesystem for %{nodefamily}
61 Group: System Environment/Base
62 %description plain
63 This package provides the same functions as %{name} but with uncompressed tarball for faster tests.
64
65 %package -n nodeyum
66 Summary: the MyPLC-side utilities for tweaking nodes yum configs
67 Group: System Environment/Base
68 %description -n nodeyum 
69 Utility scripts for configuring node updates. This package is designed
70 for the MyPLC side.
71
72 %prep
73 %setup -q
74
75 %build
76
77 ############################## node-side
78 pushd nodeimage
79 ./build.sh %{pldistro} 
80 for tar in *.tar *.tar.bz2; do 
81     start=$(date +%H-%M-%S)
82     sha1sum $tar > $tar.sha1sum
83     chmod 444 $tar.sha1sum
84     end=$(date +%H-%M-%S)
85     echo "* Computed SHA1 checksum for $tar ($start .. $end) "
86 done
87 popd
88
89 ############################## server-side
90 # ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
91 pushd nodeimage/nodeconfig/yum
92 # scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
93 for fcdistro in $(ls); do
94     [ -d $fcdistro ] || continue
95     # get packages to exclude on nodes for that fcdistro/pldistro
96     NODEYUMEXCLUDE="exclude=$(../../../build/nodeyumexclude.sh $fcdistro %{pldistro})"
97     pushd $fcdistro/yum.myplc.d
98     echo "* Handling NODEYUMEXCLUDE in yum repo for $fcdistro/$pldistro ($NODEYUMEXCLUDE)"
99     for filein in $(find . -name '*.in') ; do
100         file=$(echo $filein | sed -e "s,\.in$,,")
101         sed -e "s,@NODEYUMEXCLUDE@,$NODEYUMEXCLUDE,g" $filein > $file
102     done
103     rm -f stock.repo
104     cat *.repo > stock.repo
105     popd
106 done
107 popd
108
109 echo "* nodeconfig/yum done $(date +%H-%M-%S)"
110
111 %install
112 rm -rf $RPM_BUILD_ROOT
113
114 ############################## node-side
115 pushd nodeimage
116 for out in *.tar *.tar.bz2 ; do
117     echo "* Installing $out"
118     install -D -m 644 $out $RPM_BUILD_ROOT/var/www/html/boot/$out
119 done
120 for out in *.sha1sum; do
121     echo "* Installing $out"
122     install -D -m 444 $out $RPM_BUILD_ROOT/var/www/html/boot/$out
123 done
124 popd
125
126 ############################## server-side
127 # ship all fcdistros for multi-fcdistros myplc, and let the php scripts do the right thing
128 pushd nodeimage
129 echo "* Installing MyPLC-side nodes yum config utilities (support for multi-fcdistro)"
130 mkdir -p $RPM_BUILD_ROOT/var/www/html/yum/
131 rsync -av ./nodeconfig/yum/     $RPM_BUILD_ROOT/var/www/html/yum/
132
133 # Install initscripts
134 echo "* Installing plc.d initscripts"
135 find plc.d | cpio -p -d -u ${RPM_BUILD_ROOT}/etc/
136 chmod 755 ${RPM_BUILD_ROOT}/etc/plc.d/*
137
138 echo "* Installing db-config.d files"
139 mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
140 cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
141 chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
142 popd
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147
148 %files
149 %defattr(-,root,root,-)
150 /var/www/html/boot/bootstrapfs*.tar.bz2
151 /var/www/html/boot/bootstrapfs*.tar.bz2.sha1sum
152
153 %files plain
154 %defattr(-,root,root,-)
155 /var/www/html/boot/bootstrapfs*.tar
156 /var/www/html/boot/bootstrapfs*.tar.sha1sum
157
158 %files -n nodeyum
159 %defattr(-,root,root,-)
160 /var/www/html/yum
161 /etc/planetlab/db-config.d
162 /etc/plc.d
163
164 %changelog
165 * Mon Jan 07 2019 Thierry <Parmentelat> - nodeimage-5.2-9
166 - ok for f27 and f29
167 - cleanup old distros
168
169 * Sun Jul 16 2017 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-8
170 - fix the fedora and fedora-updates repo definitions for f25
171 - add /etc/plc.d/packages index
172
173 * Sun Jul 10 2016 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-7
174 - yum config ; deprecates old fedora releases, add support for f23/f24
175
176 * Fri Nov 13 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-6
177 - fix for f22 and dnf.conf
178
179 * Fri Jun 26 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-5
180 - the yum config for nodes on f21 and f22
181 - define a new config_file for /etc/dnf/dnf.conf so that /etc/yum.myplc.d
182 - is taken into account on f22
183
184 * Wed Feb 18 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-4
185 - minor change; start plc packages only at run-time, not build-time
186 - only available on systems that have systemctl
187
188 * Fri Mar 21 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-3
189 - template for f20 yum config
190
191 * Sun Jul 14 2013 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-2
192 - more timestamps during build
193
194 * Thu Mar 07 2013 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-5.2-1
195 - add support for f18 yum config
196
197 * Mon Feb 11 2013 Stephen Soltesz <soltesz@opentechinstitute.org> - nodeimage-2.1-4
198
199 * Mon Nov 26 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-2.1-3
200 - fix /etc/plc.d/packages for empty install dirs
201
202 * Fri Sep 28 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-2.1-2
203 - exclude slice repos when running plc.d/packages start
204
205 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeimage-2.1-1
206 - renamed as nodeimage - works on both mainline and lxc
207
208 * Thu Feb 16 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-14
209 - changes needed for build with yumexcludes defined in a separate pkgs file
210
211 * Wed Aug 31 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-13
212 - plc.d/packages: rewrote comments about some corner cases where it fails
213 - plc.d/packages: marginally more robust
214
215 * Fri Jun 10 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-12
216 - minor tweak in plc.d/packages
217
218 * Mon Jun 06 2011 Baris Metin <bmetin@verivue.com> - bootstrapfs-2.0-11
219 - sl6 templates
220
221 * Thu Feb 17 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-10
222 - bugfix for multi-flavour deployments
223
224 * Fri Feb 04 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-9
225 - for multi-flavours : 'packages' step in plc.d now handles vserver links and related hacks in yumgroups
226
227 * Thu Jan 27 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-8
228 - no semantic change - attempt to speed up build
229
230 * Sun Jan 23 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-2.0-7
231 - yum repo template for f14 nodes
232 - tweaks the way /etc/plc.d/packages works
233
234 * Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-6
235 - add sha1sum
236 - module name changes
237
238 * Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootstrapFS-2.0-5
239 - support different flavours of vservers on nodes
240
241 * Mon Apr 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-4
242 - fix unmatched $ in URL svn keywords
243
244 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-3
245 - choice between various pldistros is not made at build time, but at run time
246 - relies on GetNodeFlavour to expose the node's fcdistro - requires PLCAPI-5.0-5
247 - in addition, the baseurl for the myplc repo is http:// and not https:// anymore
248 - the https method does not work on fedora 12, and GPG is used below anyway
249
250 * Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-2
251 - new slicerepo package for exposing stuff to slivers
252
253 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-2.0-1
254 - first working version of 5.0:
255 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
256 - nodefailiy is 3-fold with pldistro-fcdistro-arch
257 - new module nodeyum; first draft has the php scripts and conf_files for tweaking nodes yum config
258
259 * Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
260 - for building on fedora12
261
262 * Thu Oct 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-10
263 - cosmetic change in message at build-time
264
265 * Fri Oct 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-9
266 - can use groups in the pkgs file with +++ for space
267
268 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-8
269 - bugfix for when a .post script is not needed
270
271 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-7
272 - search post-install scripts (.post) in path (distro, then planetlab)
273 - mostly useful for externally-defined pldistros
274
275 * Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-6
276 - fix build bug when dealing with extensions
277
278 * Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-5
279 - optional package bootstrapfs-<pldiftr>-<arch>-plain comes with uncompressed images for faster tests
280
281 * Fri Nov 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-4
282 - cosmetic changes in build: displays duration, and shows up in summary
283
284 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-3
285 - Do not overwrite yumgroups.xml upon updates of noderepo
286
287 * Thu Jul 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-2
288 - uses the right yum.conf when building images
289
290 * Mon May 05 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-1
291 - rpm release tag does not need pldistro as it is already part of the rpm name
292
293 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-0.1-2 BootstrapFS-1.0-0
294 - naming scheme changed, tarball name now contains ''nodefamily'' as <pldistro>-<arch>
295 - new package named 'noderepo' allows to ship the full set of node rpms to another (arch) myplc
296
297 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
298 - search more carefully for alternate pkgs files
299 - handling of sysconfig/crontab and creation of site_admin reviewed
300 - (this tag is set with module-tag.py)
301
302 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
303 - Initial build.
304
305 %define module_current_branch 1.0