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
26 Requires: python-pycurl
32 Requires: python-devel
41 Requires: python >= 2.4
43 Requires: postgresql-python
45 Requires: postgresql-server
48 Requires: xmlsec1-openssl
59 %define debug_package %{nil}
62 MyPLC is a complete PlanetLab Central (PLC) portable installation
63 contained within a chroot jail. The default installation consists of a
64 web server, an XML-RPC API server, a boot server, and a database
65 server: the core components of PLC. The installation may be customized
66 through a graphical interface. All PLC services are started up and
67 shut down through a single System V init script installed in the host
75 rm -rf $RPM_BUILD_ROOT
76 ./build-native.sh $RPM_BUILD_ROOT
82 rm -rf $RPM_BUILD_ROOT
85 if [ -n "$SUDO_USER" ] ; then
86 # Allow user to delete the build directory
87 chown -h -R $SUDO_USER .
88 # Some temporary cdroot files like /var/empty/sshd and
89 # /usr/bin/sudo get created with non-readable permissions.
90 find . -not -perm +0600 -exec chmod u+rw {} \;
91 # Allow user to delete the built RPM(s)
92 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
96 if [ -x %{_sysconfdir}/init.d/plc ] ; then
97 %{_sysconfdir}/init.d/plc stop
100 # Old versions of myplc used to ship with a bootstrapped database and
101 # /etc/planetlab directory. Including generated files in the manifest
102 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
103 # names from one RPM build to another, it would be rpmsaved and thus
104 # effectively deleted. Now we do not include these files in the
105 # manifest. However, to avoid deleting these files in the process of
106 # upgrading from one of these old versions of myplc, we must back up
107 # the database and /etc/planetlab and restore them after the old
108 # version has been uninstalled in %triggerpostun (also in %post, in
109 # case we are force upgrading to the same version).
111 # This code can be removed once all myplc-0.4-1 installations have
112 # been upgraded to at least myplc-0.4-2.
114 # 0 = install, 1 = upgrade
115 if [ $1 -gt 0 ] ; then
116 for dir in /var/lib/pgsql/data /etc/planetlab ; do
117 if [ -d $dir ] ; then
118 echo "Preserving $dir"
119 mkdir -p $dir.rpmsave
120 tar -C $dir -cpf - . | \
121 tar -C $dir.rpmsave -xpf -
123 # Except for the default configuration file and DTD, which
124 # really should be considered for upgrade.
125 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
131 if [ -x /sbin/chkconfig ] ; then
132 /sbin/chkconfig --add plc
133 /sbin/chkconfig plc on
136 %triggerpostun -- %{name}
137 # 0 = erase, 1 = upgrade
138 if [ $1 -gt 0 ] ; then
139 for dir in /var/lib/pgsql/data /etc/planetlab ; do
140 if [ -d $dir.rpmsave -a -d $dir ] ; then
142 if tar -C $dir.rpmsave -cpf - . | \
143 tar -C $dir -xpf - ; then
151 # 0 = erase, 1 = upgrade
152 if [ $1 -eq 0 ] ; then
153 %{_sysconfdir}/init.d/plc stop
154 if [ -x /sbin/chkconfig ] ; then
155 /sbin/chkconfig plc off
156 /sbin/chkconfig --del plc
161 %defattr(-,root,root,-)
162 # Host startup script and configuration file
165 /usr/bin/plc-config-tty
168 /usr/bin/gen-sites-xml.py*
169 /usr/bin/gen-slices-xml-05.py*
170 /usr/bin/gen-static-content.py*
173 /var/www/html/install-rpms/planetlab
176 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>