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
27 Requires: python-psycopg2
33 Requires: python-devel
42 Requires: python >= 2.4
44 Requires: postgresql-python
46 Requires: postgresql-server
49 Requires: xmlsec1-openssl
60 %define debug_package %{nil}
63 MyPLC is a complete PlanetLab Central (PLC) portable installation
64 contained within a chroot jail. The default installation consists of a
65 web server, an XML-RPC API server, a boot server, and a database
66 server: the core components of PLC. The installation may be customized
67 through a graphical interface. All PLC services are started up and
68 shut down through a single System V init script installed in the host
76 rm -rf $RPM_BUILD_ROOT
77 ./build-native.sh $RPM_BUILD_ROOT
84 rm -rf $RPM_BUILD_ROOT
87 if [ -n "$SUDO_USER" ] ; then
88 # Allow user to delete the build directory
89 chown -h -R $SUDO_USER .
90 # Some temporary cdroot files like /var/empty/sshd and
91 # /usr/bin/sudo get created with non-readable permissions.
92 find . -not -perm +0600 -exec chmod u+rw {} \;
93 # Allow user to delete the built RPM(s)
94 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
98 if [ -x %{_sysconfdir}/init.d/plc ] ; then
99 %{_sysconfdir}/init.d/plc stop
102 # Old versions of myplc used to ship with a bootstrapped database and
103 # /etc/planetlab directory. Including generated files in the manifest
104 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
105 # names from one RPM build to another, it would be rpmsaved and thus
106 # effectively deleted. Now we do not include these files in the
107 # manifest. However, to avoid deleting these files in the process of
108 # upgrading from one of these old versions of myplc, we must back up
109 # the database and /etc/planetlab and restore them after the old
110 # version has been uninstalled in %triggerpostun (also in %post, in
111 # case we are force upgrading to the same version).
113 # This code can be removed once all myplc-0.4-1 installations have
114 # been upgraded to at least myplc-0.4-2.
116 # 0 = install, 1 = upgrade
117 if [ $1 -gt 0 ] ; then
118 for dir in /var/lib/pgsql/data /etc/planetlab ; do
119 if [ -d $dir ] ; then
120 echo "Preserving $dir"
121 mkdir -p $dir.rpmsave
122 tar -C $dir -cpf - . | \
123 tar -C $dir.rpmsave -xpf -
125 # Except for the default configuration file and DTD, which
126 # really should be considered for upgrade.
127 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
133 if [ -x /sbin/chkconfig ] ; then
134 /sbin/chkconfig --add plc
135 /sbin/chkconfig plc on
137 pushd /usr/share/myplc &> /dev/null
138 python plc_config.py build
139 python plc_config.py install
142 %triggerpostun -- %{name}
143 # 0 = erase, 1 = upgrade
144 if [ $1 -gt 0 ] ; then
145 for dir in /var/lib/pgsql/data /etc/planetlab ; do
146 if [ -d $dir.rpmsave -a -d $dir ] ; then
148 if tar -C $dir.rpmsave -cpf - . | \
149 tar -C $dir -xpf - ; then
157 # 0 = erase, 1 = upgrade
158 if [ $1 -eq 0 ] ; then
159 %{_sysconfdir}/init.d/plc stop
160 if [ -x /sbin/chkconfig ] ; then
161 /sbin/chkconfig plc off
162 /sbin/chkconfig --del plc
167 %defattr(-,root,root,-)
168 # Host startup script and configuration file
172 /var/www/html/install-rpms/planetlab
174 /usr/bin/plc-config-tty
178 /usr/bin/clean-empty-dirs.py*
180 /usr/bin/check-ssl-peering.py*
181 /usr/share/myplc/plc_config.py*
184 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>