fix
[plewww.git] / PLCWWW.spec
index 450a96d..ba4aa86 100644 (file)
@@ -1,6 +1,8 @@
 #
 # $Id$
 #
+
+# what the myplc rpm requires
 %define name PLCWWW
 %define version PLE.5.0
 %define taglevel 0
@@ -60,7 +62,7 @@ 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
@@ -72,22 +74,26 @@ if [ ! -d $drupal_settings_dir ] ; then
 fi
 pushd $drupal_settings_dir
 # tune $db_url
-if [ ! -f settings.php.distrib ] ; then
-    cp settings.php settings.php.distrib
+if [ ! -f settings.php.drupal ] ; then
+    cp settings.php settings.php.drupal
     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
-#    chown apache:apache settings.php
-#    chmod 444 settings.php
+        settings.php.drupal > settings.php
+fi
+popd
+# append our own database creation hacks to the drupal database schema
+pushd /var/www/html/database
+if [ ! -f database.pgsql.drupal ] ; then
+    cp database.pgsql database.pgsql.drupal
+    cat database.pgsql.drupal ../drupal-hacks/database.pgsql > database.pgsql
+fi
+popd
+# hack the welcome page for MyPLC
+pushd /var/www/html/modules
+if [ ! -f node.module.drupal ] ; then
+    cp node.module node.module.drupal
+    [ -f /var/www/html/drupal-hacks/node.module ] && cp -f /var/www/html/drupal-hacks/node.module /var/www/html/modules/node.module
 fi
 popd
-#drupal_files_dirs="/var/www/html/files /var/www/html/sites/default/files"
-#for dir in $drupal_files_dirs; do 
-#    if [ ! -d $dir ] ; then
-#      mkdir -p $dir
-#      chown apache:apache $dir
-#    fi
-#done
-# drupal install script cannot be invoked here yet - pgsql might not even be running
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -95,7 +101,7 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root,-)
 /var/www/html
-/etc/httpd/conf.d/planetlab.conf
+/etc/httpd/conf.d/plcwww.conf
 
 %changelog
 * Fri Apr 25 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-11