Hello community, here is the log from the commit of package phpMyAdmin for openSUSE:Factory checked in at 2020-01-28 10:54:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/phpMyAdmin (Old) and /work/SRC/openSUSE:Factory/.phpMyAdmin.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "phpMyAdmin" Tue Jan 28 10:54:09 2020 rev:163 rq:766405 version:4.9.4 Changes: -------- --- /work/SRC/openSUSE:Factory/phpMyAdmin/phpMyAdmin.changes 2020-01-08 17:58:00.501749940 +0100 +++ /work/SRC/openSUSE:Factory/.phpMyAdmin.new.26092/phpMyAdmin.changes 2020-01-28 10:54:15.136966381 +0100 @@ -1,0 +2,15 @@ +Tue Jan 21 21:24:30 UTC 2020 - ch...@computersalat.de + +- fix for boo#1092345 + * change ap_docroot from /srv/www/htdocs to /usr/share + work is based on changes provided by ec...@opensuse.org + if phpMyAdmin.conf for apache was changed by local admin, we will + create a backup and replace the original file with the new version + sorry admins, but you need to apply your changes again + * needed Alias /phpMyAdmin is an enabled APACHE_SERVER_FLAGS default + for more info have a look into /etc/apache2/conf.d/phpMyAdmin.conf +- cleanup tmp/twig on + * uninstall + * ap_docroot change + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ phpMyAdmin.spec ++++++ --- /var/tmp/diff_new_pack.9IR09u/_old 2020-01-28 10:54:16.608968105 +0100 +++ /var/tmp/diff_new_pack.9IR09u/_new 2020-01-28 10:54:16.612968110 +0100 @@ -19,7 +19,8 @@ %define apxs %{_sbindir}/apxs2 %define ap_sysconfdir %(%{apxs} -q SYSCONFDIR) %define ap_serverroot %(%{apxs} -q PREFIX) -%define ap_docroot %(%{apxs} -q PREFIX)/htdocs +%define ap_docroot_old %{ap_serverroot}/htdocs +%define ap_docroot %{_datadir} %define pma_config %{_sysconfdir}/%{name}/config.inc.php %if 0%{?suse_version} %define ap_usr wwwrun @@ -164,6 +165,20 @@ %fdupes %{buildroot}%{ap_docroot}/%{name}/libraries %fdupes %{buildroot}%{ap_docroot}/%{name}/themes +%pre +# removing tmp/twig before ap_docroot change +# a new one will be created anyway in new ap_docroot (like after a clean install) +if [ -d "%{ap_docroot_old}/%{name}/tmp" ]; then + echo "removing %{ap_docroot_old}/%{name}/tmp for ap_docroot change" + rm -rf "%{ap_docroot_old}/%{name}/tmp" || : +fi + +%preun +if [ $1 -eq 0 ]; then + echo "removing %{ap_docroot}/%{name}/tmp for clean uninstall" + rm -rf "%{ap_docroot}/%{name}/tmp" || : +fi + %post # on `rpm -ivh` PARAM is 1 # on `rpm -Uvh` PARAM is 2 @@ -174,14 +189,44 @@ if [ -x %{_sbindir}/a2enmod ]; then a2enmod -q version || a2enmod version # get installed php_version (5 or 7) + # ap_mpm=$(awk '/Server MPM/ {print $3}' <<<$(start_apache2 -V)) + # php_version=$(awk -F[." "] '/cli/ {print $2}' <<< $(php -v)) php_version=$(php -v | sed -n 's/^PHP\ \([[:digit:]]\+\)\..*$/\1/p') if [[ -n ${php_version} ]] && start_apache2 -V | grep -q prefork; then a2enmod -q "php${php_version}" || a2enmod "php${php_version}" fi fi +# enable phpMyAdmin flag +if [ -x %{_sbindir}/a2enflag ]; then + flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*") + if [ $flag_find -eq 0 ]; then + a2enflag %{name} + fi +fi +# We changed ap_docroot from %{ap_docroot_old} to %{ap_docroot} (/srv/www/htdocs to /usr/share) +# If someone did 'manually' change the config file it won't be replaced by rpm +# Hence we backup the existing and place the new one +find=0 +find=$(grep -cw %{ap_sysconfdir}/conf.d/%{name}.conf -e "%{ap_docroot_old}/%{name}") || : +if [ $find -gt 0 ]; then +ap_date="$(date '+%Y%m%d-%H%M')" +echo "creating backup of %{ap_sysconfdir}/conf.d/%{name}.conf to %{ap_sysconfdir}/conf.d/%{name}.conf.backup-${ap_date}" +cp -a %{ap_sysconfdir}/conf.d/%{name}.conf %{ap_sysconfdir}/conf.d/%{name}.conf.backup-${ap_date} +echo "copying %{ap_sysconfdir}/conf.d/%{name}.conf.rpmnew to %{ap_sysconfdir}/conf.d/%{name}.conf" +cp -a %{ap_sysconfdir}/conf.d/%{name}.conf.rpmnew %{ap_sysconfdir}/conf.d/%{name}.conf +fi +%restart_on_update apache2 #systemctl try-restart apache2 &>/dev/null -#%%postun +%postun +# disable phpMyAdmin flag +if [ -x %{_sbindir}/a2enflag ]; then + flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*") + if [ $flag_find -eq 1 ]; then + a2enflag -d %{name} + fi +fi +%restart_on_update apache2 #systemctl try-restart apache2 &>/dev/null %files -f FILELIST ++++++ phpMyAdmin.http ++++++ --- /var/tmp/diff_new_pack.9IR09u/_old 2020-01-28 10:54:16.656968161 +0100 +++ /var/tmp/diff_new_pack.9IR09u/_new 2020-01-28 10:54:16.656968161 +0100 @@ -1,8 +1,37 @@ +# By default the /@name@ Alias is enabled for all vhosts. +# To disable the /@name@ Alias, run +# a2enflag -d @name@ && rcapache2 restart +# This will make /@name@ unavailable on any vhosts. +# +# If you want to have the /@name@ Alias only on a specific +# vhost, add the Alias to the config of that vhost. + +<IfDefine @name@> + <IfModule mod_alias.c> + Alias /@name@ @ap_docroot@/@name@ + </IfModule> +</IfDefine> + <Directory @ap_docroot@/@name@> Options FollowSymLinks AllowOverride None + <IfVersion < 2.4> + Order Allow,Deny + Allow from all + </IfVersion> + + <IfVersion >= 2.4> + <IfModule !mod_access_compat.c> + Require all granted + </IfModule> + <IfModule mod_access_compat.c> + Order Allow,Deny + Allow from all + </IfModule> + </IfVersion> + <IfModule mod_php5.c> Include @ap_sysconfdir@/conf.d/@name@.inc php_admin_value open_basedir "@ap_docroot@/@name@:/var/lib/php5:/tmp:@docdir@/@name@:/etc/@name@:/proc/meminfo:/proc/stat"