iterating on new nodes index
[plewww.git] / PLCWWW.spec
index 93382be..20b563f 100644 (file)
@@ -9,7 +9,7 @@
 #%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}
@@ -29,7 +29,7 @@ URL: http://svn.one-lab.org/svn/new_plc_www/
 Requires: php >= 5.0
 Requires: postgresql >= 8.0
 Requires: PLCAPI >= 5.0
-Requires: drupal >= 6.7
+Requires: drupal = 4.7
 
 # on centos5, when rebuilding the full monty, we get:
 # Error: Missing Dependency: perl(GD) is needed by package PLCWWW
@@ -60,7 +60,32 @@ mkdir -p $RPM_BUILD_ROOT/var/www/html
 rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/
 
 echo "* PLEWWW: Installing config for httpd"
-install -D -m 644 planetlab.conf $RPM_BUILD_ROOT/etc/httpd/conf.d/planetlab.conf
+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