%triggerun -- apache < 2.2.0, apache-base
%webapp_unregister httpd %{_webapp}
-%triggerpostun -- %{name} < 4.6.4-0.4
-# rescue app configs.
-if [ -f /etc/drupal/sites/default/settings.php.rpmsave ]; then
- mv -f %{_sysconfdir}/sites/default/settings.php{,.rpmnew}
- mv -f /etc/drupal/sites/default/settings.php.rpmsave %{_sysconfdir}/sites/default/settings.php
-fi
-# other configured sites, if any
-for i in /etc/drupal/sites/*; do
- d=$(basename $i)
- [ "$d" = "default" ] && continue
- mv -f %{_sysconfdir}/sites/$d{,.rpmnew}
- mv -f $i %{_sysconfdir}/sites/$d
-done
-
-# migrate from apache-config macros
-if [ -f /etc/drupal/apache.conf.rpmsave ]; then
- if [ -d /etc/apache/webapps.d ]; then
- cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
- cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/apache.conf
- fi
-
- if [ -d /etc/httpd/webapps.d ]; then
- cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
- cp -f /etc/drupal/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
- fi
- rm -f /etc/drupal/apache.conf.rpmsave
-fi
-
-# place new config location, as trigger puts config only on first install, do it here.
-if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
- rm -f /etc/apache/conf.d/99_%{name}.conf
- /usr/sbin/webapp register apache %{_webapp}
- apache_reload=1
-fi
-if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
- rm -f /etc/httpd/httpd.conf/99_%{name}.conf
- /usr/sbin/webapp register httpd %{_webapp}
- httpd_reload=1
-fi
-
-if [ "$httpd_reload" ]; then
- %service -q httpd reload
-fi
-if [ "$apache_reload" ]; then
- %service -q apache reload
-fi
-
-%triggerpostun -- %{name} < 4.6.8-0.5
-grep -l 'This_is_a_Drupal_security_line_do_not_remove' \
-%{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
-| xargs -r \
-sed -i -e '
-/This_is_a_Drupal_security_line_do_not_remove/{
- d
- n
- a\ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- a\ Options None
- a\ <IfModule mod_rewrite.c>
- a\ \ RewriteEngine off
- a\ </IfModule>
-}'
-egrep -c 'Drupal_Security_Do_Not_Remove_See_SA_2006_006' \
-%{_sysconfdir}/apache.conf %{_sysconfdir}/httpd.conf \
-| awk -F: '/:0/{print $1}' | xargs -r \
-sed -i -e '
-/<Directory \/var\/lib\/drupal>/{
- n
- a\ SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
- a\ Options None
- a\ <IfModule mod_rewrite.c>
- a\ \ RewriteEngine off
- a\ </IfModule>
-}'
-[ ! -L /etc/httpd/webapps.d/drupal.conf ] || %service -q httpd reload
-[ ! -L /etc/apache/webapps.d/drupal.conf ] || %service -q apache reload
-
%files
%defattr(644,root,root,755)
%doc *.txt README.PLD