2 Packager: PlanetLab Central <support@planet-lab.org>
3 Distribution: PlanetLab 4.0
4 URL: http://cvs.planet-lab.org/cvs/myplc
6 Summary: PlanetLab Central (PLC) Portable Installation
9 Release: 4%{?pldistro:.%{pldistro}}%{?date:.%{date}}
11 Group: Applications/Systems
12 Source0: %{name}-%{version}.tar.gz
13 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
14 Requires: bzip2 sendmail-cf tar less perl-GD openssl xmlsec1 gd expect php-pgsql curl httpd rsync mod_python mod_ssl bootmanager python-devel SOAPpy vixie-cron yum php-gd PLCWWW PLCAPI PyXML sendmail python createrepo postgresql-python cpio postgresql-server wget php xmlsec1-openssl postgresql openssh cvs dev bootcd dnsmasq diffutils gzip findutils
16 %define debug_package %{nil}
19 MyPLC is a complete PlanetLab Central (PLC) portable installation
20 contained within a chroot jail. The default installation consists of a
21 web server, an XML-RPC API server, a boot server, and a database
22 server: the core components of PLC. The installation may be customized
23 through a graphical interface. All PLC services are started up and
24 shut down through a single System V init script installed in the host
32 rm -rf $RPM_BUILD_ROOT
33 ./build-native.sh $RPM_BUILD_ROOT
39 rm -rf $RPM_BUILD_ROOT
42 if [ -n "$SUDO_USER" ] ; then
43 # Allow user to delete the build directory
44 chown -h -R $SUDO_USER .
45 # Some temporary cdroot files like /var/empty/sshd and
46 # /usr/bin/sudo get created with non-readable permissions.
47 find . -not -perm +0600 -exec chmod u+rw {} \;
48 # Allow user to delete the built RPM(s)
49 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
53 if [ -x %{_sysconfdir}/init.d/plc ] ; then
54 %{_sysconfdir}/init.d/plc stop
57 # Old versions of myplc used to ship with a bootstrapped database and
58 # /etc/planetlab directory. Including generated files in the manifest
59 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
60 # names from one RPM build to another, it would be rpmsaved and thus
61 # effectively deleted. Now we do not include these files in the
62 # manifest. However, to avoid deleting these files in the process of
63 # upgrading from one of these old versions of myplc, we must back up
64 # the database and /etc/planetlab and restore them after the old
65 # version has been uninstalled in %triggerpostun (also in %post, in
66 # case we are force upgrading to the same version).
68 # This code can be removed once all myplc-0.4-1 installations have
69 # been upgraded to at least myplc-0.4-2.
71 # 0 = install, 1 = upgrade
72 if [ $1 -gt 0 ] ; then
73 for dir in /var/lib/pgsql/data /etc/planetlab ; do
75 echo "Preserving $dir"
77 tar -C $dir -cpf - . | \
78 tar -C $dir.rpmsave -xpf -
80 # Except for the default configuration file and DTD, which
81 # really should be considered for upgrade.
82 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
88 if [ -x /sbin/chkconfig ] ; then
89 /sbin/chkconfig --add plc
90 /sbin/chkconfig plc on
93 %triggerpostun -- %{name}
94 # 0 = erase, 1 = upgrade
95 if [ $1 -gt 0 ] ; then
96 for dir in /var/lib/pgsql/data /etc/planetlab ; do
97 if [ -d $dir.rpmsave -a -d $dir ] ; then
99 if tar -C $dir.rpmsave -cpf - . | \
100 tar -C $dir -xpf - ; then
108 # 0 = erase, 1 = upgrade
109 if [ $1 -eq 0 ] ; then
110 %{_sysconfdir}/init.d/plc stop
111 if [ -x /sbin/chkconfig ] ; then
112 /sbin/chkconfig plc off
113 /sbin/chkconfig --del plc
118 %defattr(-,root,root,-)
119 # Host startup script and configuration file
122 /usr/bin/plc-config-tty
125 /usr/bin/gen-sites-xml.py*
126 /usr/bin/gen-slices-xml-05.py*
127 /usr/bin/gen-static-content.py*
130 /var/www/html/install-rpms/planetlab
133 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>