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