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
83 rm -rf $RPM_BUILD_ROOT
86 if [ -n "$SUDO_USER" ] ; then
87 # Allow user to delete the build directory
88 chown -h -R $SUDO_USER .
89 # Some temporary cdroot files like /var/empty/sshd and
90 # /usr/bin/sudo get created with non-readable permissions.
91 find . -not -perm +0600 -exec chmod u+rw {} \;
92 # Allow user to delete the built RPM(s)
93 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
97 if [ -x %{_sysconfdir}/init.d/plc ] ; then
98 %{_sysconfdir}/init.d/plc stop
101 # Old versions of myplc used to ship with a bootstrapped database and
102 # /etc/planetlab directory. Including generated files in the manifest
103 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
104 # names from one RPM build to another, it would be rpmsaved and thus
105 # effectively deleted. Now we do not include these files in the
106 # manifest. However, to avoid deleting these files in the process of
107 # upgrading from one of these old versions of myplc, we must back up
108 # the database and /etc/planetlab and restore them after the old
109 # version has been uninstalled in %triggerpostun (also in %post, in
110 # case we are force upgrading to the same version).
112 # This code can be removed once all myplc-0.4-1 installations have
113 # been upgraded to at least myplc-0.4-2.
115 # 0 = install, 1 = upgrade
116 if [ $1 -gt 0 ] ; then
117 for dir in /var/lib/pgsql/data /etc/planetlab ; do
118 if [ -d $dir ] ; then
119 echo "Preserving $dir"
120 mkdir -p $dir.rpmsave
121 tar -C $dir -cpf - . | \
122 tar -C $dir.rpmsave -xpf -
124 # Except for the default configuration file and DTD, which
125 # really should be considered for upgrade.
126 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
132 if [ -x /sbin/chkconfig ] ; then
133 /sbin/chkconfig --add plc
134 /sbin/chkconfig plc on
136 pushd /usr/share/myplc &> /dev/null
137 python plc_config.py build
138 python plc_config.py install
141 %triggerpostun -- %{name}
142 # 0 = erase, 1 = upgrade
143 if [ $1 -gt 0 ] ; then
144 for dir in /var/lib/pgsql/data /etc/planetlab ; do
145 if [ -d $dir.rpmsave -a -d $dir ] ; then
147 if tar -C $dir.rpmsave -cpf - . | \
148 tar -C $dir -xpf - ; then
156 # 0 = erase, 1 = upgrade
157 if [ $1 -eq 0 ] ; then
158 %{_sysconfdir}/init.d/plc stop
159 if [ -x /sbin/chkconfig ] ; then
160 /sbin/chkconfig plc off
161 /sbin/chkconfig --del plc
166 %defattr(-,root,root,-)
167 # Host startup script and configuration file
171 /var/www/html/install-rpms/planetlab
173 /usr/bin/plc-config-tty
177 /usr/bin/clean-empty-dirs.py*
179 /usr/bin/check-ssl-peering.py*
180 /usr/share/myplc/plc_config.py*
183 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>