+%triggerin -n mythweb -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun -n mythweb -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin -n mythweb -- apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerin -n mythweb -- lighttpd
+%webapp_register lighttpd %{_webapp}
+
+%triggerun -n mythweb -- apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerun -n mythweb -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
+%triggerpostun -n mythweb -- mythweb < 0.19
+for i in canned_searches.php conf.php htpasswd theme_Default.php theme_compact.php theme_vxml.php theme_wap.php theme_wml.php weathertypes.dat; do
+ if [ -f /etc/mythweb/$i.rpmsave ]; then
+ mv -f %{_webapps}/%{_webapp}/$i{,.rpmnew}
+ mv -f /etc/mythweb/$i.rpmsave %{_webapps}/%{_webapp}/$i
+ fi
+done
+sed -i -e 's,/etc/mythweb,%{_webapps}/%{_webapp},' %{_webapps}/%{_webapp}/{apache,httpd}.conf
+
+# migrate from apache-config macros
+if [ -f /etc/mythweb/apache.conf.rpmsave ]; then
+ if [ -d /etc/apache/webapps.d ]; then
+ cp -f %{_webapps}/%{_webapp}/apache.conf{,.rpmnew}
+ cp -f /etc/mythweb/apache.conf.rpmsave %{_webapps}/%{_webapp}/apache.conf
+ fi
+
+ if [ -d /etc/httpd/webapps.d ]; then
+ cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
+ cp -f /etc/mythweb/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
+ fi
+ rm -f /etc/mythweb/apache.conf.rpmsave
+fi
+
+if [ -L /etc/apache/conf.d/99_mythplugins.conf ]; then
+ rm -f /etc/apache/conf.d/99_mythplugins.conf
+ /usr/sbin/webapp register apache %{_webapp}
+ %service -q apache reload
+fi
+if [ -L /etc/httpd/httpd.conf/99_mythplugins.conf ]; then
+ rm -f /etc/httpd/httpd.conf/99_mythplugins.conf
+ /usr/sbin/webapp register httpd %{_webapp}
+ %service -q httpd reload
+fi
+
+%post -n mythweb
+echo "Read %{_docdir}/mythweb-%{version}/http_servers_conf_tips.txt.gz to find
+which packages you can need to run mythweb and how to set it quickly."
+