fixed and moved the server-side yum scripts, from nodeconfig/yum to BootstrapFS/nodec...
[bootstrapfs.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 0
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 # need the apache user at install-time
60 Requires: httpd 
61
62 %prep
63 %setup -q
64
65 %build
66 pushd BootstrapFS
67 ./build.sh %{pldistro} 
68 popd BootstrapFS
69
70 # xxx in a multi-flavour myplc, we should ship for all fcdistros
71 # and let the php scripts do the right thing
72
73 pushd BootstrapFS/nodeconfig/yum
74
75 # expand list of kexcludes
76
77 # scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
78
79 for fcdistro in $(ls); do
80     [ -d $fcdistro ] || continue
81     KEXCLUDE="exclude=$(../../../build/getkexcludes.sh -f $fcdistro)"
82     pushd $fcdistro/yum.myplc.d
83     echo "* Handling KEXCLUDE in yum repo for $fcdistro ($KEXCLUDE)"
84     for filein in $(find . -name '*.in') ; do
85         file=$(echo $filein | sed -e "s,\.in$,,")
86         sed -e "s,@KEXCLUDE@,$KEXCLUDE,g" $filein > $file
87     done
88     rm -f stock.repo
89     cat *.repo > stock.repo
90     popd
91 done
92
93 popd
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97
98 pushd BootstrapFS
99 #arch=$(uname -i)
100
101 install -D -m 644 bootstrapfs-%{nodefamily}.tar.bz2 \
102         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar.bz2
103 install -D -m 644 bootstrapfs-%{nodefamily}.tar \
104         $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-%{nodefamily}.tar
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     install -D -m 644 %{pldistro}-filesystems/bootstrapfs-${NAME}-%{extensionfamily}.tar \
111                 $RPM_BUILD_ROOT/var/www/html/boot/bootstrapfs-${NAME}-%{extensionfamily}.tar 
112 done
113 popd
114
115 pushd BootstrapFS/nodeconfig/yum
116 echo "* Installing MyPLC-side yum stuff"
117 # expose (fixed) myplc.repo.php as                                          https://<plc>/yum/myplc.repo.php
118 install -D -m 644 ./yum/myplc.repo.php                       $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php
119 # expose the fcdistro-dependant yum.conf as                                 https://<plc>/yum/yum.conf
120 install -D -m 644 ./yum/%{distroname}/yum.conf               $RPM_BUILD_ROOT/var/www/html/yum/yum.conf
121 # expose the (fcdistro-dependant) stock.repo as                             https://<plc>/yum/stock.repo
122 install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo
123 popd
124
125 %clean
126 rm -rf $RPM_BUILD_ROOT
127
128 %post -n nodeyum
129 # the boot manager upload area
130 mkdir -p /var/log/bm
131 chown apache:apache /var/log/bm
132 chmod 700 /var/log/bm
133
134
135 %files
136 %defattr(-,root,root,-)
137 /var/www/html/boot/bootstrapfs*.tar.bz2
138
139 %files plain
140 %defattr(-,root,root,-)
141 /var/www/html/boot/bootstrapfs*.tar
142
143 %files -n nodeyum
144 %defattr(-,root,root,-)
145 /var/www/html/yum
146
147 %changelog
148 * Mon Jan 04 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-11
149 - for building on fedora12
150
151 * Thu Oct 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-10
152 - cosmetic change in message at build-time
153
154 * Fri Oct 09 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-9
155 - can use groups in the pkgs file with +++ for space
156
157 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-8
158 - bugfix for when a .post script is not needed
159
160 * Tue Apr 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-7
161 - search post-install scripts (.post) in path (distro, then planetlab)
162 - mostly useful for externally-defined pldistros
163
164 * Thu Jan 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-6
165 - fix build bug when dealing with extensions
166
167 * Thu Dec 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-5
168 - optional package bootstrapfs-<pldiftr>-<arch>-plain comes with uncompressed images for faster tests
169
170 * Fri Nov 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-4
171 - cosmetic changes in build: displays duration, and shows up in summary
172
173 * Mon Sep 01 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-3
174 - Do not overwrite yumgroups.xml upon updates of noderepo
175
176 * Thu Jul 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-2
177 - uses the right yum.conf when building images
178
179 * Mon May 05 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-1.0-1
180 - rpm release tag does not need pldistro as it is already part of the rpm name
181
182 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootstrapFS-0.1-2 BootstrapFS-1.0-0
183 - naming scheme changed, tarball name now contains ''nodefamily'' as <pldistro>-<arch>
184 - new package named 'noderepo' allows to ship the full set of node rpms to another (arch) myplc
185
186 * Fri Jan 18 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootstrapfs-0.1-1 bootstrapfs-0.1-2
187 - search more carefully for alternate pkgs files
188 - handling of sysconfig/crontab and creation of site_admin reviewed
189 - (this tag is set with module-tag.py)
190
191 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
192 - Initial build.
193
194 %define module_current_branch 1.0