2 oPackager: 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
15 %define debug_package %{nil}
18 MyPLC is a complete PlanetLab Central (PLC) portable installation
19 contained within a chroot jail. The default installation consists of a
20 web server, an XML-RPC API server, a boot server, and a database
21 server: the core components of PLC. The installation may be customized
22 through a graphical interface. All PLC services are started up and
23 shut down through a single System V init script installed in the host
31 rm -rf $RPM_BUILD_ROOT
32 ./build-native.sh $RPM_BUILD_ROOT
38 rm -rf $RPM_BUILD_ROOT
41 if [ -n "$SUDO_USER" ] ; then
42 # Allow user to delete the build directory
43 chown -h -R $SUDO_USER .
44 # Some temporary cdroot files like /var/empty/sshd and
45 # /usr/bin/sudo get created with non-readable permissions.
46 find . -not -perm +0600 -exec chmod u+rw {} \;
47 # Allow user to delete the built RPM(s)
48 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
52 if [ -x %{_sysconfdir}/init.d/plc ] ; then
53 %{_sysconfdir}/init.d/plc stop
56 # Old versions of myplc used to ship with a bootstrapped database and
57 # /etc/planetlab directory. Including generated files in the manifest
58 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
59 # names from one RPM build to another, it would be rpmsaved and thus
60 # effectively deleted. Now we do not include these files in the
61 # manifest. However, to avoid deleting these files in the process of
62 # upgrading from one of these old versions of myplc, we must back up
63 # the database and /etc/planetlab and restore them after the old
64 # version has been uninstalled in %triggerpostun (also in %post, in
65 # case we are force upgrading to the same version).
67 # This code can be removed once all myplc-0.4-1 installations have
68 # been upgraded to at least myplc-0.4-2.
70 # 0 = install, 1 = upgrade
71 if [ $1 -gt 0 ] ; then
72 for dir in /var/lib/pgsql/data /etc/planetlab ; do
74 echo "Preserving $dir"
76 tar -C $dir -cpf - . | \
77 tar -C $dir.rpmsave -xpf -
79 # Except for the default configuration file and DTD, which
80 # really should be considered for upgrade.
81 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
87 if [ -x /sbin/chkconfig ] ; then
88 /sbin/chkconfig --add plc
89 /sbin/chkconfig plc on
92 %triggerpostun -- %{name}
93 # 0 = erase, 1 = upgrade
94 if [ $1 -gt 0 ] ; then
95 for dir in /var/lib/pgsql/data /etc/planetlab ; do
96 if [ -d $dir.rpmsave -a -d $dir ] ; then
98 if tar -C $dir.rpmsave -cpf - . | \
99 tar -C $dir -xpf - ; then
107 # 0 = erase, 1 = upgrade
108 if [ $1 -eq 0 ] ; then
109 %{_sysconfdir}/init.d/plc stop
110 if [ -x /sbin/chkconfig ] ; then
111 /sbin/chkconfig plc off
112 /sbin/chkconfig --del plc
117 %defattr(-,root,root,-)
118 # Host startup script and configuration file
119 %{_sysconfdir}/init.d/plc
120 %{_sysconfdir}/sysconfig/plc
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
128 /etc/httpd/conf.d/drupal.conf
130 %dir %{_sysconfdir}/plc.d
131 %dir %{_sysconfdir}/planetlab
135 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>