# what the myplc rpm requires
%define name plewww
-%define version 5.2
-%define taglevel 9
+%define version 5.3
+%define taglevel 1
# no need to mention pldistro as this module differs in both distros
%define release %{taglevel}%{?date:.%{date}}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
BuildRequires: python
+# for patching drupal session code
+BuildRequires: ed
Vendor: OneLab
Packager: OneLab <support@one-lab.org>
Group: Applications/Systems
%description
-The plewww package is made of the web pages that run on top of the
+The plewww package is made of the web pages that run on top of the
PLCAPI component to provide the Web Interface to MyPLC users.
%description plekit
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"
+ echo "This suggests you do not have a planetlab-custom drupal installed"
exit 1
fi
pushd $drupal_settings_dir
# tune $db_url
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.drupal > settings.php
fi
+# always do this; it's idempotent
+# hopefully it will help in various upgrade scenarios where
+# drupal was re-installed, and settings.php was left in the original drupal state
+# which results in the infamous "cannot connect to mysql database"
+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.drupal > settings.php
popd
# append our own database creation hacks to the drupal database schema
pushd /var/www/html/database
cp -f /var/www/html/drupal-hacks/${module}.module /var/www/html/modules/${module}.module
done
popd
+# hack drupal's session handler for php8
+pushd /var/www/html/includes
+bash /var/www/html/drupal-hacks/patch-session-inc.sh
+popd
# create myslice.log and change its ownership
mkdir -p /var/log/myslice
touch /var/log/myslice/myslice.log
/var/www/html/plekit
%changelog
+* Fri Nov 22 2025 Thierry Parmentelat <thierry.parmentelat@inria.fr> - plewww-5.3-
+- always patch drupal settings, not just once
+ hopefully makes various upgrade scenarios more robust
+- various cosmetic fixes
+
+* Sat Apr 30 2022 Thierry Parmentelat <thierry.parmentelat@inria.fr> - plewww-5.3-0
+- for php8 on fedora35
+
* Wed May 16 2018 Thierry <Parmentelat> - plewww-5.2-9
- not too clean patches for r2lab:
- * search for a file named /etc/planetlab/php/person-registration.txt