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