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