6 %define name myplc-native
10 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12 Summary: PlanetLab Central (PLC) Portable Installation
17 Group: Applications/Systems
18 Source0: %{name}-%{version}.tar.gz
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
22 Packager: PlanetLab Central <support@planet-lab.org>
23 Distribution: PlanetLab %{plrelease}
24 URL: %(echo %{url} | cut -d ' ' -f 2)
37 Requires: python-pycurl
38 Requires: python-psycopg2
44 Requires: python-devel
51 Requires: python >= 2.4
53 Requires: postgresql-python
55 Requires: postgresql-server
58 Requires: xmlsec1-openssl
73 %define debug_package %{nil}
76 MyPLC is a complete PlanetLab Central (PLC) portable installation
77 contained within a chroot jail. The default installation consists of a
78 web server, an XML-RPC API server, a boot server, and a database
79 server: the core components of PLC. The installation may be customized
80 through a graphical interface. All PLC services are started up and
81 shut down through a single System V init script installed in the host
89 rm -rf $RPM_BUILD_ROOT
90 ./build-native.sh $RPM_BUILD_ROOT
97 rm -rf $RPM_BUILD_ROOT
100 if [ -n "$SUDO_USER" ] ; then
101 # Allow user to delete the build directory
102 chown -h -R $SUDO_USER .
103 # Some temporary cdroot files like /var/empty/sshd and
104 # /usr/bin/sudo get created with non-readable permissions.
105 find . -not -perm +0600 -exec chmod u+rw {} \;
106 # Allow user to delete the built RPM(s)
107 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
111 if [ -x %{_sysconfdir}/init.d/plc ] ; then
112 %{_sysconfdir}/init.d/plc stop
115 # Old versions of myplc used to ship with a bootstrapped database and
116 # /etc/planetlab directory. Including generated files in the manifest
117 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
118 # names from one RPM build to another, it would be rpmsaved and thus
119 # effectively deleted. Now we do not include these files in the
120 # manifest. However, to avoid deleting these files in the process of
121 # upgrading from one of these old versions of myplc, we must back up
122 # the database and /etc/planetlab and restore them after the old
123 # version has been uninstalled in %triggerpostun (also in %post, in
124 # case we are force upgrading to the same version).
126 # This code can be removed once all myplc-0.4-1 installations have
127 # been upgraded to at least myplc-0.4-2.
129 # 0 = install, 1 = upgrade
130 if [ $1 -gt 0 ] ; then
131 for dir in /var/lib/pgsql/data /etc/planetlab ; do
132 if [ -d $dir ] ; then
133 echo "Preserving $dir"
134 mkdir -p $dir.rpmsave
135 tar -C $dir -cpf - . | \
136 tar -C $dir.rpmsave -xpf -
138 # Except for the default configuration file and DTD, which
139 # really should be considered for upgrade.
140 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
146 if [ -x /sbin/chkconfig ] ; then
147 /sbin/chkconfig --add plc
148 /sbin/chkconfig plc on
150 pushd /usr/share/myplc &> /dev/null
151 python plc_config.py build
152 python plc_config.py install
155 %triggerpostun -- %{name}
156 # 0 = erase, 1 = upgrade
157 if [ $1 -gt 0 ] ; then
158 for dir in /var/lib/pgsql/data /etc/planetlab ; do
159 if [ -d $dir.rpmsave -a -d $dir ] ; then
161 if tar -C $dir.rpmsave -cpf - . | \
162 tar -C $dir -xpf - ; then
170 # 0 = erase, 1 = upgrade
171 if [ $1 -eq 0 ] ; then
172 %{_sysconfdir}/init.d/plc stop
173 if [ -x /sbin/chkconfig ] ; then
174 /sbin/chkconfig plc off
175 /sbin/chkconfig --del plc
180 %defattr(-,root,root,-)
181 # Host startup script and configuration file
185 /var/www/html/install-rpms/planetlab
187 /usr/bin/plc-config-tty
191 /usr/bin/clean-empty-dirs.py*
193 /usr/bin/check-ssl-peering.py*
194 /usr/share/myplc/plc_config.py*
197 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
198 - refresh-peer.py removed (duplicate with PLCAPI)
199 - plc.d/ scripts cleaned up
200 - sirius initscript updated
201 - slice auto renewal fixed
203 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>