#
%define url $URL$
-%define name myplc-native
+%define name myplc-chroot
%define version 5.0
%define taglevel 1
Group: Applications/Systems
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildArch: noarch
Vendor: PlanetLab
Packager: PlanetLab Central <support@planet-lab.org>
Distribution: PlanetLab %{plrelease}
URL: %(echo %{url} | cut -d ' ' -f 2)
-Requires: bzip2
-Requires: sendmail-cf
-Requires: tar
-Requires: less
-Requires: perl-GD
-Requires: openssl
-Requires: xmlsec1
-Requires: gd
-Requires: expect
-Requires: php-pgsql
-Requires: curl
-Requires: python-pycurl
-Requires: python-psycopg2
-Requires: httpd
-Requires: rsync
-Requires: mod_python
-Requires: mod_ssl
-Requires: bootmanager
-Requires: python-devel
-Requires: SOAPpy
-Requires: vixie-cron
-Requires: yum
-Requires: php-gd
-Requires: PyXML
-Requires: sendmail
-Requires: python >= 2.4
-Requires: createrepo
-Requires: postgresql-python
-Requires: cpio
-Requires: postgresql-server
-Requires: wget
-Requires: php
-Requires: xmlsec1-openssl
-Requires: postgresql
-Requires: openssh
-Requires: bootcd-%{pldistro}-%{_arch}
-Requires: dnsmasq
-Requires: diffutils
-Requires: gzip
-Requires: vim-minimal
-Requires: findutils
-# planetlab stuff
-Requires: PLCWWW
-Requires: nodeconfig
-Requires: PLCAPI
-Requires: bootstrapfs-%{pldistro}-%{_arch}
-Requires: myplc-docs
-Requires: myplc-release
-
-# argh - ugly - we might wish to use something from build/config.%{pldistro} instead
-%if "%{pldistro}" == "onelab"
-Requires: dummynet_image
-%endif
-
-Provides: myplc = %version-%release
+Requires: tar
+
+Provides: myplc
%define debug_package %{nil}
MyPLC is a complete PlanetLab Central (PLC) portable installation
contained within a chroot jail. The default installation consists of a
web server, an XML-RPC API server, a boot server, and a database
-server: the core components of PLC. The installation may be customized
-through a graphical interface. All PLC services are started up and
+server: the core components of PLC. All PLC services are started up and
shut down through a single System V init script installed in the host
-system.
+system. The related Web Interface is now separately packaged
+in the PLCWWW component.
%prep
%setup -q
%build
+pushd MyPLC
+./build-chroot.sh %{pldistro}
+popd
%install
-pushd MyPLC
rm -rf $RPM_BUILD_ROOT
-./build-native.sh %{pldistro} $RPM_BUILD_ROOT
+
+pushd MyPLC
+
+#
+# myplc
+#
+
+# Install host startup script and configuration file
+install -D -m 755 host.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/plc
+install -D -m 644 plc.sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/plc
+
+# Create convenient symlink
+install -d -m 755 $RPM_BUILD_ROOT/%{_sysconfdir}
+ln -sf /plc/data/etc/planetlab $RPM_BUILD_ROOT/%{_sysconfdir}/planetlab
+
+# Install root filesystem
+install -d -m 755 $RPM_BUILD_ROOT/plc/root
+install -D -m 644 root.img $RPM_BUILD_ROOT/plc/root.img
+
+# Install data directory
+find data | cpio -p -d -u $RPM_BUILD_ROOT/plc/
+
popd
%clean
# /usr/bin/sudo get created with non-readable permissions.
find . -not -perm +0600 -exec chmod u+rw {} \;
# Allow user to delete the built RPM(s)
- [ -d %{_rpmdir}/noarch ] && chown -h -R $SUDO_USER %{_rpmdir}/noarch
+ chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
fi
%pre
if [ -x %{_sysconfdir}/init.d/plc ] ; then
- %{_sysconfdir}/init.d/plc stop
+ %{_sysconfdir}/init.d/plc safestop
fi
# Old versions of myplc used to ship with a bootstrapped database and
# 0 = install, 1 = upgrade
if [ $1 -gt 0 ] ; then
for dir in /var/lib/pgsql/data /etc/planetlab ; do
- if [ -d $dir ] ; then
- echo "Preserving $dir"
- mkdir -p $dir.rpmsave
- tar -C $dir -cpf - . | \
- tar -C $dir.rpmsave -xpf -
+ if [ -d /plc/data/$dir ] ; then
+ echo "Preserving /plc/data/$dir"
+ mkdir -p /plc/data/$dir.rpmsave
+ tar -C /plc/data/$dir -cpf - . | \
+ tar -C /plc/data/$dir.rpmsave -xpf -
# Except for the default configuration file and DTD, which
# really should be considered for upgrade.
- rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
+ rm -f /plc/data/$dir.rpmsave/{default_config.xml,plc_config.dtd}
fi
done
fi
/sbin/chkconfig --add plc
/sbin/chkconfig plc on
fi
-pushd /usr/share/myplc &> /dev/null
-python plc_config.py build
-python plc_config.py install
-popd &> /dev/null
%triggerpostun -- %{name}
# 0 = erase, 1 = upgrade
if [ $1 -gt 0 ] ; then
for dir in /var/lib/pgsql/data /etc/planetlab ; do
- if [ -d $dir.rpmsave -a -d $dir ] ; then
- echo "Merging $dir"
- if tar -C $dir.rpmsave -cpf - . | \
- tar -C $dir -xpf - ; then
- rm -rf $dir.rpmsave
+ if [ -d /plc/data/$dir.rpmsave -a -d /plc/data/$dir ] ; then
+ echo "Merging /plc/data/$dir"
+ if tar -C /plc/data/$dir.rpmsave -cpf - . | \
+ tar -C /plc/data/$dir -xpf - ; then
+ rm -rf /plc/data/$dir.rpmsave
fi
fi
done
%preun
# 0 = erase, 1 = upgrade
if [ $1 -eq 0 ] ; then
- %{_sysconfdir}/init.d/plc stop
+ %{_sysconfdir}/init.d/plc safestop
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig plc off
/sbin/chkconfig --del plc
%files
%defattr(-,root,root,-)
# Host startup script and configuration file
-/etc/init.d/plc
-/etc/plc.d
-/etc/planetlab
-/etc/plc_sliceinitscripts/sirius
-/etc/support-scripts/gen_aliases.py*
-/etc/support-scripts/renew_reminder.py*
-/etc/support-scripts/renew_reminder_logrotate
-/usr/bin/plc-config
-/usr/bin/plc-config-tty
-/usr/bin/db-config
-/usr/bin/dns-config
-/usr/bin/plc-map.py*
-/usr/bin/plc-kml.py*
-/usr/bin/refresh-peer.py*
-/usr/bin/clean-empty-dirs.py*
-/usr/bin/mtail.py*
-/usr/bin/check-ssl-peering.py*
-/usr/share/myplc
+%{_sysconfdir}/init.d/plc
+%{_sysconfdir}/sysconfig/plc
+
+# Symlink to /etc/planetlab within data directory
+%{_sysconfdir}/planetlab
+
+# Root filesystem
+/plc/root.img
+/plc/root
+
+# Data directory
+%dir /plc/data
+%config(noreplace) /plc/data/*
%changelog
* Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-5.0-1
- sirius initscript updated
- slice auto renewal fixed
-* Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>
-- initial build.
+* Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-1 myplc-4.2-2
+- knows how to checkpoint and restore
+- packages step more robust, in particular with empty node repository
+- miscell tweaks for native packaging
+
+* Wed Jan 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.0-15 myplc-4.2-0
+moving to 4.2 - no change
+
+* Fri Jan 19 2007 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.5-3
+- Split off myplc-devel into separate spec file, so that it can be
+ built standalone.
+
+* Tue Aug 22 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-3, 0.5-3
+- MyPLC 0.4 RC3.
+- Fix upgrade path from RC1.
+- Always regenerate plc_config.xml at first startup
+- Upgrade kernel, iptables, vnet to 2.6.17-1.2142_FC4-3.planetlab
+- Minor PlanetFlow fixes
+- pl_mom/swapmon: Minor fixes
+- bootcd: Added Supermicro IPMI support
+- bootmanager: Cleanup, fixed check for new disks
+
+* Wed Aug 09 2006 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
+- introduces variable %{build_devel} to allow custom sites to skip building
+ the myplc-devel package.
+
+* Thu Jul 13 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-2, 0.5-2
+- MyPLC 0.4 RC2.
+- Fix many spec files (License replaces Copyright).
+- Fix kernel build under gcc32 (module verification bug).
+- Fix vnet build under gcc32
+- Fix PlanetFlow. MySQL RPM postinstall script no longer starts the
+ server. Also, get hostnames list from PLC_WWW_HOST, not
+ www.planet-lab.org.
+- Fix pl_mom/bwmon to use cached values if NM is unresponsive
+- Fix pl_mom/swapmon reset logic to avoid endless loops
+- Remove ksymoops, add kernel-smp to standard PlanetLab package group
+- Add kernel-smp boot support to bootmanager
+- Add badblock search support to bootmanager
+- Build development environment (myplc-devel). Add support for
+ building myplc itself inside myplc-devel.
+- Move step-specific initialization to appropriate plc.d scripts
+- Fix postgresql startup failure when bootstrapping
+- Allow CA to be configured for each SSL certificate set. Stop doing
+ root CA stuff, this is outside the scope of MyPLC. MyPLC now only
+ generates self-signed certificates, but supports replacement of the
+ self-signed certificates with real certifcates signed by another CA,
+ as long as the CA is specified.
+- Self-sign the MA/SA SSL certificate (and by extension, the MA/SA API
+ certificate).
+- pl_mom: Workarounds for when NM queries time out.
+- plc_api: Honor PLC_MAIL_ENABLED.
+
+* Wed Jul 6 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.4-1, 0.5-1
+- First stable release of MyPLC 0.4 RC1.
+
+* Wed Apr 5 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.2-1
+- Basic functionality complete. Consolidate into a single package
+ installed in /plc.
+
+* Fri Mar 17 2006 Mark Huang <mlhuang@CS.Princeton.EDU> - 0.1-1
+- Initial build.
+
%define module_current_branch 4.2