10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12 Summary: PlanetLab Central (PLC) Portable Installation
17 Group: Applications/Systems
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
22 Packager: PlanetLab Central <support@planet-lab.org>
23 Distribution: PlanetLab %{plrelease}
24 URL: %(echo %{url} | cut -d ' ' -f 2)
28 %define debug_package %{nil}
31 MyPLC is a complete PlanetLab Central (PLC) portable installation
32 contained within a chroot jail. The default installation consists of a
33 web server, an XML-RPC API server, a boot server, and a database
34 server: the core components of PLC. All PLC services are started up and
35 shut down through a single System V init script installed in the host
36 system. The related Web Interface is now separately packaged
37 in the PLCWWW component.
44 ./build.sh %{pldistro}
48 rm -rf $RPM_BUILD_ROOT
56 # Install host startup script and configuration file
57 install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
58 install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
60 # Create convenient symlink
61 install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
62 ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
64 # Install root filesystem
65 install -d -m 755 $RPM_BUILD_ROOT/plc/root
66 install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
68 # Install data directory
69 find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
74 rm -rf $RPM_BUILD_ROOT
77 if [ -n "$SUDO_USER" ] ; then
78 # Allow user to delete the build directory
79 chown -h -R $SUDO_USER .
80 # Some temporary cdroot files like /var/empty/sshd and
81 # /usr/bin/sudo get created with non-readable permissions.
82 find . -not -perm +0600 -exec chmod u+rw {} \;
83 # Allow user to delete the built RPM(s)
84 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
88 if [ -x %{_sysconfdir}/init.d/plc ] ; then
89 %{_sysconfdir}/init.d/plc safestop
92 # Old versions of myplc used to ship with a bootstrapped database and
93 # /etc/planetlab directory. Including generated files in the manifest
94 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
95 # names from one RPM build to another, it would be rpmsaved and thus
96 # effectively deleted. Now we do not include these files in the
97 # manifest. However, to avoid deleting these files in the process of
98 # upgrading from one of these old versions of myplc, we must back up
99 # the database and /etc/planetlab and restore them after the old
100 # version has been uninstalled in %triggerpostun (also in %post, in
101 # case we are force upgrading to the same version).
103 # This code can be removed once all myplc-0.4-1 installations have
104 # been upgraded to at least myplc-0.4-2.
106 # 0 = install, 1 = upgrade
107 if [ $1 -gt 0 ] ; then
108 for dir in /var/lib/pgsql/data /etc/planetlab ; do
109 if [ -d /plc/data/$dir ] ; then
110 echo "Preserving /plc/data/$dir"
111 mkdir -p /plc/data/$dir.rpmsave
112 tar -C /plc/data/$dir -cpf - . | \
113 tar -C /plc/data/$dir.rpmsave -xpf -
115 # Except for the default configuration file and DTD, which
116 # really should be considered for upgrade.
117 rm -f /plc/data/$dir.rpmsave/{default_config.xml,plc_config.dtd}
123 if [ -x /sbin/chkconfig ] ; then
124 /sbin/chkconfig --add plc
125 /sbin/chkconfig plc on
128 %triggerpostun -- %{name}
129 # 0 = erase, 1 = upgrade
130 if [ $1 -gt 0 ] ; then
131 for dir in /var/lib/pgsql/data /etc/planetlab ; do
132 if [ -d /plc/data/$dir.rpmsave -a -d /plc/data/$dir ] ; then
133 echo "Merging /plc/data/$dir"
134 if tar -C /plc/data/$dir.rpmsave -cpf - . | \
135 tar -C /plc/data/$dir -xpf - ; then
136 rm -rf /plc/data/$dir.rpmsave
143 # 0 = erase, 1 = upgrade
144 if [ $1 -eq 0 ] ; then
145 %{_sysconfdir}/init.d/plc safestop
146 if [ -x /sbin/chkconfig ] ; then
147 /sbin/chkconfig plc off
148 /sbin/chkconfig --del plc
153 %defattr(-,root,root,-)
154 # Host startup script and configuration file
155 %{_sysconfdir}/init.d/plc
156 %{_sysconfdir}/sysconfig/plc
158 # Symlink to /etc/planetlab within data directory
159 %{_sysconfdir}/planetlab
167 %config(noreplace) /plc/data/*
170 * Wed Jan 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.0-15 myplc-4.2-0
171 moving to 4.2 - no change
173 * Fri Jan 19 2007 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.5-3
174 - Split off myplc-devel into separate spec file, so that it can be
177 * Tue Aug 22 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-3, 0.5-3
179 - Fix upgrade path from RC1.
180 - Always regenerate plc_config.xml at first startup
181 - Upgrade kernel, iptables, vnet to 2.6.17-1.2142_FC4-3.planetlab
182 - Minor PlanetFlow fixes
183 - pl_mom/swapmon: Minor fixes
184 - bootcd: Added Supermicro IPMI support
185 - bootmanager: Cleanup, fixed check for new disks
187 * Wed Aug 09 2006 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
188 - introduces variable %{build_devel} to allow custom sites to skip building
189 the myplc-devel package.
191 * Thu Jul 13 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-2, 0.5-2
193 - Fix many spec files (License replaces Copyright).
194 - Fix kernel build under gcc32 (module verification bug).
195 - Fix vnet build under gcc32
196 - Fix PlanetFlow. MySQL RPM postinstall script no longer starts the
197 server. Also, get hostnames list from PLC_WWW_HOST, not
199 - Fix pl_mom/bwmon to use cached values if NM is unresponsive
200 - Fix pl_mom/swapmon reset logic to avoid endless loops
201 - Remove ksymoops, add kernel-smp to standard PlanetLab package group
202 - Add kernel-smp boot support to bootmanager
203 - Add badblock search support to bootmanager
204 - Build development environment (myplc-devel). Add support for
205 building myplc itself inside myplc-devel.
206 - Move step-specific initialization to appropriate plc.d scripts
207 - Fix postgresql startup failure when bootstrapping
208 - Allow CA to be configured for each SSL certificate set. Stop doing
209 root CA stuff, this is outside the scope of MyPLC. MyPLC now only
210 generates self-signed certificates, but supports replacement of the
211 self-signed certificates with real certifcates signed by another CA,
212 as long as the CA is specified.
213 - Self-sign the MA/SA SSL certificate (and by extension, the MA/SA API
215 - pl_mom: Workarounds for when NM queries time out.
216 - plc_api: Honor PLC_MAIL_ENABLED.
218 * Wed Jul 6 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-1, 0.5-1
219 - First stable release of MyPLC 0.4 RC1.
221 * Wed Apr 5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
222 - Basic functionality complete. Consolidate into a single package
225 * Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1