-%post
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*flyspray.conf" /etc/httpd/httpd.conf; then
- echo "Include /etc/httpd/phpldapadmin.conf" >> /etc/httpd/httpd.conf
-elif [ -d /etc/httpd/httpd.conf ]; then
- ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+%post setup
+chmod 660 %{_sysconfdir}/flyspray.conf
+
+%postun setup
+if [ "$1" = "0" ]; then
+ chmod 640 %{_sysconfdir}/flyspray.conf
+fi
+
+%triggerin -- apache1
+%webapp_register apache %{_webapp}
+
+%triggerun -- apache1
+%webapp_unregister apache %{_webapp}
+
+%triggerin -- apache >= 2.0.0
+%webapp_register httpd %{_webapp}
+
+%triggerun -- apache >= 2.0.0
+%webapp_unregister httpd %{_webapp}
+
+%triggerpostun -- %{name} < 0.9.8-0.1
+if [ -f /etc/%{name}/flyspray.conf.php.rpmsave ]; then
+ mv -f %{_sysconfdir}/flyspray.conf{,.rpmnew}
+ mv -f /etc/%{name}/flyspray.conf.php.rpmsave %{_sysconfdir}/flyspray.conf