#
-# $Id: PLCWWW.spec 1206 2008-03-03 15:49:07Z thierry $
+# $Id$
#
-%define module_taglevel_varname subversion
%define name PLCWWW
-%define version 4.2
-%define subversion 8
+%define version PLE.5.0
+%define taglevel 0
-%define release %{subversion}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+# no need to mention pldistro as this module differs in both distros
+#%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%define release %{taglevel}%{?date:.%{date}}
-Summary: PlanetLab Central (PLC) Web Pages
+Summary: PlanetLab Europe (PLC) Web Pages
Name: %{name}
Version: %{version}
Release: %{release}
#Requires: httpd >= 2.0
Requires: php >= 5.0
Requires: postgresql >= 8.0
-Requires: bootcd >= 3.3
-Requires: PLCAPI >= 4.0
+Requires: PLCAPI >= 5.0
+Requires: drupal = 4.7
# on centos5, when rebuilding the full monty, we get:
# Error: Missing Dependency: perl(GD) is needed by package PLCWWW
AutoReqProv: no
%description
-The plcwww packages provides the web pages that run on
-top of the PLCAPI component to provide the Web User Interface to the
-PLC installation.
-This package was formerly embedded together with MyPLC, but there
-clearly is a need for separate upgrade of this component.
+The PLCWWW package is made of the web pages that run on top of the
+PLCAPI component to provide the Web Interface to MyPLC users.
%prep
%setup -q
# plcwww
#
-echo "* PLCWWW: Installing web pages"
+echo "* PLEWWW: Installing web pages"
mkdir -p $RPM_BUILD_ROOT/var/www/html
# let's be conservative and exclude codebase files, though there should not be any
rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/
-echo "* PLCWWW: Installing drupal config for httpd"
-install -D -m 644 drupal.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/drupal.conf
+echo "* PLEWWW: Installing config for httpd"
+install -D -m 644 httpd.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/plcwww.conf
+
+%post
+# attempt to perform most of the drupal post-install stuff - assuming version 6.x
+drupal_settings_dir=/var/www/html/sites/default
+if [ ! -d $drupal_settings_dir ] ; then
+ echo "Could not find directory $drupal_settings_dir"
+ echo "This suggests that you do not have a planetlab-custom drupal installed"
+ exit 1
+fi
+pushd $drupal_settings_dir
+# tune $db_url
+if [ ! -f settings.php.distrib ] ; then
+ cp settings.php settings.php.distrib
+ sed -e 's|^[ \t]*\$db_url.*|require_once("plc_config.php");$db_url="pgsql://" . PLC_DB_USER . ":" . PLC_DB_PASSWORD . "@" . PLC_DB_HOST . ":" . PLC_DB_PORT . "/drupal";|' \
+ settings.php.distrib > settings.php
+fi
+popd
+# append our own database creation hacks to the drupal database schema
+drupal_database_dir=/var/www/html/database
+pushd $drupal_database_dir
+if [ ! -f database.pgsql.distrib ] ; then
+ cp database.pgsql database.pgsql.distrib
+ cat database.pgsql.distrib ../drupal-hacks/database.pgsql > database.pgsql
+fi
+popd
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/var/www/html
-/etc/httpd/conf.d/drupal.conf
+/etc/httpd/conf.d/planetlab.conf
%changelog
+* Fri Apr 25 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-11
+- everyone is welcome to add nodes
+
+* Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-10
+- node-specific bootcd images to include arch in their name
+
+* Wed Apr 23 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-9
+- remove explicit dep to bootcd as the rpm name has changed
+
* Mon Mar 03 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-4.2-7 PLCWWW-4.2-8
- noarch