Tagging module MyPLC - MyPLC-5.0-1
[myplc.git] / myplc.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 %define name myplc
7 %define version 5.0
8 %define taglevel 1
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 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-5.0-1
173 - First iteration of new data model
174 - Bunch of various fixes
175
176 * Tue May 20 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - MyPLC-4.2-15
177 - Removed proper ops from planetflow slice.
178
179 * Wed May 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-14
180 - myplc-native requires myplc-docs
181 - fixed doc build by locating locally installed DTDs at build-time
182
183 * Sun May 11 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-13
184 - turn myplc-docs off for now
185
186 * Sat May 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-12
187 - figures in doc package
188
189 * Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
190 - no more doc packaged outside of myplc-docs - doc/ cleaned up 
191 - chroot packaging does not have docs anymore
192 - 'cvs' and 'dev' not required from myplc-native anymore
193 - cosmetic change in kml output
194
195 * Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
196 - defaults for *_IP conf vars now void, expect more accurate /etc/hosts
197 - gethostbyname uses python rather than perl (hope this shrinks deps) 
198 - doc: reviewed myplc doc - deprecated everything related to myplc-devel
199 - doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
200 - make sync now works towards vserver-based myplc only 
201
202 * Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
203
204 - added vsys 'pfmount' script to the default netflow slice attributes.
205
206
207 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
208 - plc.d/bootcd step altered for handling legacy bootcd smooth migration
209 - to new bootcd packaging
210
211 * Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-7
212 - changes needed for bootcd 4.2 : new, possible multiple, installation locations, and new rpm name
213
214 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-6
215 - packaging of mplc-release in myplc-native
216 - sudoers.php is new to PlanetLabConf (needs nodeconfig-4.2-4)
217 - resolv file in /etc/resolv.conf, not plc_resolv.conf
218 - improved sirius script
219 - remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
220 - expires more properly set 
221
222 * Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
223
224
225 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
226 - renew_reminder script moved to support-scripts/
227 - gen-aliases script added in support-scripts/
228 - sirius initscript moved to plc_sliceinitscripts (formerly inlined in db-config)
229 - plc-map script : no javascript for googlemap anymore, see new plc-kml script instead
230 - nodefamily-aware (creates legacy symlink /var/www/html/install-rpms/planetlab)
231 - new native slice attributes 'capabilities', 'vsys' and 'codemux'
232 - new setting 'Mom list address' for sending emails to a separate destination
233 - starts rsyslogd/syslogd as appropriate
234 - expects nodeconfig package (former PlanetLabConf/ dir from PLCWWW)
235 - convenience generation of yum.conf in resulting image based on build/mirroring
236
237 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
238 - refresh-peer.py removed (duplicate with PLCAPI)
239 - plc.d/ scripts cleaned up
240 - sirius initscript updated
241 - slice auto renewal fixed
242
243 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-1 myplc-4.2-2
244 - knows how to checkpoint and restore
245 - packages step more robust, in particular with empty node repository
246 - miscell tweaks for native packaging
247
248 * Wed Jan 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.0-15 myplc-4.2-0
249 moving to 4.2 - no change
250
251 * Fri Jan 19 2007 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.5-3
252 - Split off myplc-devel into separate spec file, so that it can be
253   built standalone.
254
255 * Tue Aug 22 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-3, 0.5-3
256 - MyPLC 0.4 RC3.
257 - Fix upgrade path from RC1.
258 - Always regenerate plc_config.xml at first startup
259 - Upgrade kernel, iptables, vnet to 2.6.17-1.2142_FC4-3.planetlab
260 - Minor PlanetFlow fixes
261 - pl_mom/swapmon: Minor fixes
262 - bootcd: Added Supermicro IPMI support
263 - bootmanager: Cleanup, fixed check for new disks
264
265 * Wed Aug 09 2006 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
266 - introduces variable %{build_devel} to allow custom sites to skip building
267   the myplc-devel package.
268
269 * Thu Jul 13 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-2, 0.5-2
270 - MyPLC 0.4 RC2.
271 - Fix many spec files (License replaces Copyright).
272 - Fix kernel build under gcc32 (module verification bug).
273 - Fix vnet build under gcc32
274 - Fix PlanetFlow. MySQL RPM postinstall script no longer starts the
275   server. Also, get hostnames list from PLC_WWW_HOST, not
276   www.planet-lab.org.
277 - Fix pl_mom/bwmon to use cached values if NM is unresponsive
278 - Fix pl_mom/swapmon reset logic to avoid endless loops
279 - Remove ksymoops, add kernel-smp to standard PlanetLab package group
280 - Add kernel-smp boot support to bootmanager
281 - Add badblock search support to bootmanager
282 - Build development environment (myplc-devel). Add support for
283   building myplc itself inside myplc-devel.
284 - Move step-specific initialization to appropriate plc.d scripts
285 - Fix postgresql startup failure when bootstrapping
286 - Allow CA to be configured for each SSL certificate set. Stop doing
287   root CA stuff, this is outside the scope of MyPLC. MyPLC now only
288   generates self-signed certificates, but supports replacement of the
289   self-signed certificates with real certifcates signed by another CA,
290   as long as the CA is specified.
291 - Self-sign the MA/SA SSL certificate (and by extension, the MA/SA API
292   certificate).
293 - pl_mom: Workarounds for when NM queries time out.
294 - plc_api: Honor PLC_MAIL_ENABLED.
295
296 * Wed Jul  6 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-1, 0.5-1
297 - First stable release of MyPLC 0.4 RC1.
298
299 * Wed Apr  5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
300 - Basic functionality complete. Consolidate into a single package
301   installed in /plc.
302
303 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
304 - Initial build.
305
306
307 %define module_current_branch 4.2