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