-[ -d %{_sysconfdir}/httpd/conf.d ] || exit 0
-[ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && exit 0
-cp -p %{_sysconfdir}/shibboleth/apache2.config \
- %{_sysconfdir}/httpd/conf.d/shib.conf
+if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
+ if [ ! -f %{_sysconfdir}/httpd/conf.d/shib.conf ] ; then
+ sed "s/\/usr\/doc\/shibboleth/\/usr\/share\/doc\/shibboleth-@-VERSION-@/g" \
+ %{_sysconfdir}/shibboleth/apache2.config \
+ > %{_sysconfdir}/httpd/conf.d/shib.conf
+ fi
+fi
+
+# Install the shibd init.d scripts and service
+if [ -d %{_sysconfdir}/init.d ] ; then
+ if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
+ cp -p %{_sysconfdir}/shibboleth/shibd %{_sysconfdir}/init.d/shibd
+ chmod 755 %{_sysconfdir}/init.d/shibd
+ chkconfig --add shibd
+ fi
+fi