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