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
74 %define debug_package %{nil}
77 MyPLC is a complete PlanetLab Central (PLC) portable installation
78 contained within a chroot jail. The default installation consists of a
79 web server, an XML-RPC API server, a boot server, and a database
80 server: the core components of PLC. The installation may be customized
81 through a graphical interface. All PLC services are started up and
82 shut down through a single System V init script installed in the host
90 rm -rf $RPM_BUILD_ROOT
91 ./build-native.sh $RPM_BUILD_ROOT
98 rm -rf $RPM_BUILD_ROOT
101 if [ -n "$SUDO_USER" ] ; then
102 # Allow user to delete the build directory
103 chown -h -R $SUDO_USER .
104 # Some temporary cdroot files like /var/empty/sshd and
105 # /usr/bin/sudo get created with non-readable permissions.
106 find . -not -perm +0600 -exec chmod u+rw {} \;
107 # Allow user to delete the built RPM(s)
108 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
112 if [ -x %{_sysconfdir}/init.d/plc ] ; then
113 %{_sysconfdir}/init.d/plc stop
116 # Old versions of myplc used to ship with a bootstrapped database and
117 # /etc/planetlab directory. Including generated files in the manifest
118 # was dangerous; if /plc/data/var/lib/pgsql/data/base/1/16676 changed
119 # names from one RPM build to another, it would be rpmsaved and thus
120 # effectively deleted. Now we do not include these files in the
121 # manifest. However, to avoid deleting these files in the process of
122 # upgrading from one of these old versions of myplc, we must back up
123 # the database and /etc/planetlab and restore them after the old
124 # version has been uninstalled in %triggerpostun (also in %post, in
125 # case we are force upgrading to the same version).
127 # This code can be removed once all myplc-0.4-1 installations have
128 # been upgraded to at least myplc-0.4-2.
130 # 0 = install, 1 = upgrade
131 if [ $1 -gt 0 ] ; then
132 for dir in /var/lib/pgsql/data /etc/planetlab ; do
133 if [ -d $dir ] ; then
134 echo "Preserving $dir"
135 mkdir -p $dir.rpmsave
136 tar -C $dir -cpf - . | \
137 tar -C $dir.rpmsave -xpf -
139 # Except for the default configuration file and DTD, which
140 # really should be considered for upgrade.
141 rm -f $dir.rpmsave/{default_config.xml,plc_config.dtd}
147 if [ -x /sbin/chkconfig ] ; then
148 /sbin/chkconfig --add plc
149 /sbin/chkconfig plc on
151 pushd /usr/share/myplc &> /dev/null
152 python plc_config.py build
153 python plc_config.py install
156 %triggerpostun -- %{name}
157 # 0 = erase, 1 = upgrade
158 if [ $1 -gt 0 ] ; then
159 for dir in /var/lib/pgsql/data /etc/planetlab ; do
160 if [ -d $dir.rpmsave -a -d $dir ] ; then
162 if tar -C $dir.rpmsave -cpf - . | \
163 tar -C $dir -xpf - ; then
171 # 0 = erase, 1 = upgrade
172 if [ $1 -eq 0 ] ; then
173 %{_sysconfdir}/init.d/plc stop
174 if [ -x /sbin/chkconfig ] ; then
175 /sbin/chkconfig plc off
176 /sbin/chkconfig --del plc
181 %defattr(-,root,root,-)
182 # Host startup script and configuration file
186 /var/www/html/install-rpms/planetlab
188 /usr/bin/plc-config-tty
192 /usr/bin/clean-empty-dirs.py*
194 /usr/bin/check-ssl-peering.py*
198 * Thu Feb 14 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - myplc-4.2-2 myplc-4.2-3
199 - refresh-peer.py removed (duplicate with PLCAPI)
200 - plc.d/ scripts cleaned up
201 - sirius initscript updated
202 - slice auto renewal fixed
204 * Fri Aug 31 2007 Marc E. Fiuczynski <mef@CS.Princeton.EDU>