Accepting request 799851 from home:computersalat:devel:php
fix for boo#1170743 OBS-URL: https://build.opensuse.org/request/show/799851 OBS-URL: https://build.opensuse.org/package/show/server:php:applications/phpMyAdmin?expand=0&rev=354
This commit is contained in:
parent
f5c64e65a3
commit
fabe47cb05
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun May 3 15:22:25 UTC 2020 - chris@computersalat.de
|
||||||
|
|
||||||
|
- fix for boo#1170743
|
||||||
|
phpMyAdmin installation wipes it's sysconfig apache_server_flag entry
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat May 2 10:54:11 UTC 2020 - Arjen de Korte <suse+build@de-korte.org>
|
Sat May 2 10:54:11 UTC 2020 - Arjen de Korte <suse+build@de-korte.org>
|
||||||
|
|
||||||
|
@ -167,19 +167,23 @@ sed -i -e "s,@ap_docroot@,%{ap_docroot},g" -e "s,@name@,%{name},g" \
|
|||||||
# removing tmp/twig before ap_docroot change
|
# removing tmp/twig before ap_docroot change
|
||||||
# a new one will be created anyway in new ap_docroot (like after a clean install)
|
# a new one will be created anyway in new ap_docroot (like after a clean install)
|
||||||
if [ -d "%{ap_docroot_old}/%{name}/tmp" ]; then
|
if [ -d "%{ap_docroot_old}/%{name}/tmp" ]; then
|
||||||
echo "removing %{ap_docroot_old}/%{name}/tmp for ap_docroot change"
|
echo "info: removing %{ap_docroot_old}/%{name}/tmp for ap_docroot change"
|
||||||
rm -rf "%{ap_docroot_old}/%{name}/tmp" || :
|
rm -rf "%{ap_docroot_old}/%{name}/tmp" || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ]; then
|
if [ $1 -eq 0 ]; then
|
||||||
echo "removing %{ap_docroot}/%{name}/tmp for clean uninstall"
|
if [ -d "%{ap_docroot}/%{name}/tmp" ]; then
|
||||||
|
echo "info: removing %{ap_docroot}/%{name}/tmp for clean uninstall"
|
||||||
rm -rf "%{ap_docroot}/%{name}/tmp" || :
|
rm -rf "%{ap_docroot}/%{name}/tmp" || :
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
%post
|
%post
|
||||||
# on `rpm -ivh` PARAM is 1
|
# FIRST_ARG values on
|
||||||
# on `rpm -Uvh` PARAM is 2
|
# uninstall: 0
|
||||||
|
# install: 1
|
||||||
|
# update: 2
|
||||||
# set PmaAbsoluteUri ### generate blowfish secret
|
# set PmaAbsoluteUri ### generate blowfish secret
|
||||||
sed -i -e "s/\\\$cfg\['blowfish_secret'\] = ''/\$cfg['blowfish_secret'] = '`pwgen -s -1 46`'/" %{pma_config}
|
sed -i -e "s/\\\$cfg\['blowfish_secret'\] = ''/\$cfg['blowfish_secret'] = '`pwgen -s -1 46`'/" %{pma_config}
|
||||||
# enable required apache modules
|
# enable required apache modules
|
||||||
@ -190,6 +194,7 @@ if [ -x %{_sbindir}/a2enmod ]; then
|
|||||||
# php_version=$(awk -F[." "] '/cli/ {print $2}' <<< $(php -v))
|
# php_version=$(awk -F[." "] '/cli/ {print $2}' <<< $(php -v))
|
||||||
php_version=$(php -v | sed -n 's/^PHP\ \([[:digit:]]\+\)\..*$/\1/p')
|
php_version=$(php -v | sed -n 's/^PHP\ \([[:digit:]]\+\)\..*$/\1/p')
|
||||||
if [[ -n ${php_version} ]] && start_apache2 -V | grep -q prefork; then
|
if [[ -n ${php_version} ]] && start_apache2 -V | grep -q prefork; then
|
||||||
|
echo "info: adding php${php_version} to APACHE_MODULES"
|
||||||
a2enmod -q "php${php_version}" || a2enmod "php${php_version}"
|
a2enmod -q "php${php_version}" || a2enmod "php${php_version}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -197,6 +202,7 @@ fi
|
|||||||
if [ -x %{_sbindir}/a2enflag ]; then
|
if [ -x %{_sbindir}/a2enflag ]; then
|
||||||
flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*")
|
flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*")
|
||||||
if [ $flag_find -eq 0 ]; then
|
if [ $flag_find -eq 0 ]; then
|
||||||
|
echo "info: adding %{name} to APACHE_SERVER_FLAGS"
|
||||||
a2enflag %{name}
|
a2enflag %{name}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -216,13 +222,17 @@ fi
|
|||||||
#systemctl try-restart apache2 &>/dev/null
|
#systemctl try-restart apache2 &>/dev/null
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
|
# only do on uninstall, not on update
|
||||||
|
if [ $1 -eq 0 ]; then
|
||||||
# disable phpMyAdmin flag
|
# disable phpMyAdmin flag
|
||||||
if [ -x %{_sbindir}/a2enflag ]; then
|
if [ -x %{_sbindir}/a2enflag ]; then
|
||||||
flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*")
|
flag_find=$(grep -cw /etc/sysconfig/apache2 -e "^APACHE_SERVER_FLAGS=.*%{name}.*")
|
||||||
if [ $flag_find -eq 1 ]; then
|
if [ $flag_find -eq 1 ]; then
|
||||||
|
echo "info: removing %{name} from APACHE_SERVER_FLAGS"
|
||||||
a2enflag -d %{name}
|
a2enflag -d %{name}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
%restart_on_update apache2
|
%restart_on_update apache2
|
||||||
#systemctl try-restart apache2 &>/dev/null
|
#systemctl try-restart apache2 &>/dev/null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user