use the FQDN for PLC_WWW_HOST rather than localhost to get cron.php
[myplc.git] / myplc.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define name myplc
7 %define version 4.2
8 %define taglevel 20
9
10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
11
12 Summary: PlanetLab Central (PLC) Portable Installation
13 Name: %{name}
14 Version: %{version}
15 Release: %{release}
16 License: PlanetLab
17 Group: Applications/Systems
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
20
21 Vendor: PlanetLab
22 Packager: PlanetLab Central <support@planet-lab.org>
23 Distribution: PlanetLab %{plrelease}
24 URL: %(echo %{url} | cut -d ' ' -f 2)
25
26 Requires: tar
27
28 Provides: myplc
29
30 %define debug_package %{nil}
31
32 %description
33 MyPLC is a complete PlanetLab Central (PLC) portable installation
34 contained within a chroot jail. The default installation consists of a
35 web server, an XML-RPC API server, a boot server, and a database
36 server: the core components of PLC. All PLC services are started up and
37 shut down through a single System V init script installed in the host
38 system. The related Web Interface is now separately packaged
39 in the PLCWWW component. 
40
41 %prep
42 %setup -q
43
44 %build
45 pushd MyPLC
46 ./build.sh %{pldistro}
47 popd
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51
52 pushd MyPLC
53
54 #
55 # myplc
56 #
57
58 # Install host startup script and configuration file
59 install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
60 install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
61
62 # Create convenient symlink
63 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
64 ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
65
66 # Install root filesystem
67 install -d -m 755 $RPM_BUILD_ROOT/plc/root
68 install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
69
70 # Install data directory
71 find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
72
73 popd
74
75 %clean
76 rm -rf $RPM_BUILD_ROOT
77
78 # If run under sudo
79 if [ -n "$SUDO_USER" ] ; then
80     # Allow user to delete the build directory
81     chown -h -R $SUDO_USER .
82     # Some temporary cdroot files like /var/empty/sshd and
83     # /usr/bin/sudo get created with non-readable permissions.
84     find . -not -perm +0600 -exec chmod u+rw {} \;
85     # Allow user to delete the built RPM(s)
86     chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
87 fi
88
89 %pre
90 if [ -x %{_sysconfdir}/init.d/plc ] ; then
91     %{_sysconfdir}/init.d/plc safestop
92 fi
93
94 # Old versions of myplc used to ship with a bootstrapped database and
95 # /etc/planetlab directory. Including generated files in the manifest
96 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
97 # names from one RPM build to another, it would be rpmsaved and thus
98 # effectively deleted. Now we do not include these files in the
99 # manifest. However, to avoid deleting these files in the process of
100 # upgrading from one of these old versions of myplc, we must back up
101 # the database and /etc/planetlab and restore them after the old
102 # version has been uninstalled in %triggerpostun (also in %post, in
103 # case we are force upgrading to the same version).
104 #
105 # This code can be removed once all myplc-0.4-1 installations have
106 # been upgraded to at least myplc-0.4-2.
107
108 # 0 = install, 1 = upgrade
109 if [ $1 -gt 0 ] ; then
110     for dir in /var/lib/pgsql/data /etc/planetlab ; do
111         if [ -d /plc/data/$dir ] ; then
112             echo "Preserving /plc/data/$dir"
113             mkdir -p /plc/data/$dir.rpmsave
114             tar -C /plc/data/$dir -cpf - . | \
115                tar -C /plc/data/$dir.rpmsave -xpf -
116
117             # Except for the default configuration file and DTD, which
118             # really should be considered for upgrade.
119             rm -f /plc/data/$dir.rpmsave/{default_config.xml,plc_config.dtd}
120         fi
121     done
122 fi
123
124 %post
125 if [ -x /sbin/chkconfig ] ; then
126     /sbin/chkconfig --add plc
127     /sbin/chkconfig plc on
128 fi
129
130 %triggerpostun -- %{name}
131 # 0 = erase, 1 = upgrade
132 if [ $1 -gt 0 ] ; then
133     for dir in /var/lib/pgsql/data /etc/planetlab ; do
134         if [ -d /plc/data/$dir.rpmsave -a -d /plc/data/$dir ] ; then
135             echo "Merging /plc/data/$dir"
136             if tar -C /plc/data/$dir.rpmsave -cpf - . | \
137                tar -C /plc/data/$dir -xpf - ; then
138                 rm -rf /plc/data/$dir.rpmsave
139             fi
140         fi
141     done
142 fi    
143
144 %preun
145 # 0 = erase, 1 = upgrade
146 if [ $1 -eq 0 ] ; then
147     %{_sysconfdir}/init.d/plc safestop
148     if [ -x /sbin/chkconfig ] ; then
149         /sbin/chkconfig plc off
150         /sbin/chkconfig --del plc
151     fi
152 fi
153
154 %files
155 %defattr(-,root,root,-)
156 # Host startup script and configuration file
157 %{_sysconfdir}/init.d/plc
158 %{_sysconfdir}/sysconfig/plc
159
160 # Symlink to /etc/planetlab within data directory
161 %{_sysconfdir}/planetlab
162
163 # Root filesystem
164 /plc/root.img
165 /plc/root
166
167 # Data directory
168 %dir /plc/data
169 %config(noreplace) /plc/data/*
170
171 %changelog
172 * Fri Apr 10 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-20
173 - * Skip SSL generation for services that aren't enabled
174 - * added --full flag to crond for vacuumdb
175
176 * Tue Nov 18 2008 Daniel Hokka Zakrisson <daniel@hozac.com> - MyPLC-4.2-19
177 - Add common slice attributes.
178 - Clarified 'failed to authenticate' message.
179 - Make db-config extensible.
180
181 * Wed Sep 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-18
182 - onelab distro requires the dummynet_image package with myplc-native
183 - (onelab distro does not build chroot-myplc anymore)
184
185 * Fri Aug 01 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-17
186 - Remove iptables conf_file.  Now in iptables module.
187 - Arch specific download directory now in /data for chrooted myplc
188 - Vim now a dependency in myplc. :-)
189
190 * Fri Jul 04 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-16
191 - yum config on nodes improved -- see https://svn.planet-lab.org/ticket/342
192 - also does not create any repo under /var/www/html/install-rpms, to prevent conflicts with noderepo
193
194 * Tue May 20 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-15
195 - Removed proper ops from planetflow slice.
196
197 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-14
198 - myplc-native requires myplc-docs
199 - fixed doc build by locating locally installed DTDs at build-time
200
201 * Sun May 11 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-13
202 - turn myplc-docs off for now
203
204 * Sat May 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-12
205 - figures in doc package
206
207 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
208 - no more doc packaged outside of myplc-docs - doc/ cleaned up 
209 - chroot packaging does not have docs anymore
210 - 'cvs' and 'dev' not required from myplc-native anymore
211 - cosmetic change in kml output
212
213 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
214 - defaults for *_IP conf vars now void, expect more accurate /etc/hosts
215 - gethostbyname uses python rather than perl (hope this shrinks deps) 
216 - doc: reviewed myplc doc - deprecated everything related to myplc-devel
217 - doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
218 - make sync now works towards vserver-based myplc only 
219
220 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
221
222 - added vsys 'pfmount' script to the default netflow slice attributes.
223
224
225 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
226 - plc.d/bootcd step altered for handling legacy bootcd smooth migration
227 - to new bootcd packaging
228
229 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-7
230 - changes needed for bootcd 4.2 : new, possible multiple, installation locations, and new rpm name
231
232 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-6
233 - packaging of mplc-release in myplc-native
234 - sudoers.php is new to PlanetLabConf (needs nodeconfig-4.2-4)
235 - resolv file in /etc/resolv.conf, not plc_resolv.conf
236 - improved sirius script
237 - remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
238 - expires more properly set 
239
240 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
241
242
243 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
244 - renew_reminder script moved to support-scripts/
245 - gen-aliases script added in support-scripts/
246 - sirius initscript moved to plc_sliceinitscripts (formerly inlined in db-config)
247 - plc-map script : no javascript for googlemap anymore, see new plc-kml script instead
248 - nodefamily-aware (creates legacy symlink /var/www/html/install-rpms/planetlab)
249 - new native slice attributes 'capabilities', 'vsys' and 'codemux'
250 - new setting 'Mom list address' for sending emails to a separate destination
251 - starts rsyslogd/syslogd as appropriate
252 - expects nodeconfig package (former PlanetLabConf/ dir from PLCWWW)
253 - convenience generation of yum.conf in resulting image based on build/mirroring
254
255 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
256 - refresh-peer.py removed (duplicate with PLCAPI)
257 - plc.d/ scripts cleaned up
258 - sirius initscript updated
259 - slice auto renewal fixed
260
261 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-1 myplc-4.2-2
262 - knows how to checkpoint and restore
263 - packages step more robust, in particular with empty node repository
264 - miscell tweaks for native packaging
265
266 * Wed Jan 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.0-15 myplc-4.2-0
267 moving to 4.2 - no change
268
269 * Fri Jan 19 2007 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.5-3
270 - Split off myplc-devel into separate spec file, so that it can be
271   built standalone.
272
273 * Tue Aug 22 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-3, 0.5-3
274 - MyPLC 0.4 RC3.
275 - Fix upgrade path from RC1.
276 - Always regenerate plc_config.xml at first startup
277 - Upgrade kernel, iptables, vnet to 2.6.17-1.2142_FC4-3.planetlab
278 - Minor PlanetFlow fixes
279 - pl_mom/swapmon: Minor fixes
280 - bootcd: Added Supermicro IPMI support
281 - bootmanager: Cleanup, fixed check for new disks
282
283 * Wed Aug 09 2006 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
284 - introduces variable %{build_devel} to allow custom sites to skip building
285   the myplc-devel package.
286
287 * Thu Jul 13 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-2, 0.5-2
288 - MyPLC 0.4 RC2.
289 - Fix many spec files (License replaces Copyright).
290 - Fix kernel build under gcc32 (module verification bug).
291 - Fix vnet build under gcc32
292 - Fix PlanetFlow. MySQL RPM postinstall script no longer starts the
293   server. Also, get hostnames list from PLC_WWW_HOST, not
294   www.planet-lab.org.
295 - Fix pl_mom/bwmon to use cached values if NM is unresponsive
296 - Fix pl_mom/swapmon reset logic to avoid endless loops
297 - Remove ksymoops, add kernel-smp to standard PlanetLab package group
298 - Add kernel-smp boot support to bootmanager
299 - Add badblock search support to bootmanager
300 - Build development environment (myplc-devel). Add support for
301   building myplc itself inside myplc-devel.
302 - Move step-specific initialization to appropriate plc.d scripts
303 - Fix postgresql startup failure when bootstrapping
304 - Allow CA to be configured for each SSL certificate set. Stop doing
305   root CA stuff, this is outside the scope of MyPLC. MyPLC now only
306   generates self-signed certificates, but supports replacement of the
307   self-signed certificates with real certifcates signed by another CA,
308   as long as the CA is specified.
309 - Self-sign the MA/SA SSL certificate (and by extension, the MA/SA API
310   certificate).
311 - pl_mom: Workarounds for when NM queries time out.
312 - plc_api: Honor PLC_MAIL_ENABLED.
313
314 * Wed Jul  6 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-1, 0.5-1
315 - First stable release of MyPLC 0.4 RC1.
316
317 * Wed Apr  5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
318 - Basic functionality complete. Consolidate into a single package
319   installed in /plc.
320
321 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
322 - Initial build.
323