Plug the SP into Apache automatically (if the config dir exists).
authorwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 1 Apr 2005 18:28:54 +0000 (18:28 +0000)
committerwarlord <warlord@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 1 Apr 2005 18:28:54 +0000 (18:28 +0000)
Also make sure not to overwrite an existing config file.

git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@1476 cb58f699-b61c-0410-a6fe-9272a202ed29

shibboleth.spec.in

index a071619..afd2431 100644 (file)
@@ -84,9 +84,20 @@ make check
 %post
 /sbin/ldconfig
 
+# Plug the shibboleth SP into Apache2 on a Red Hat system.
+[ -d %{_sysconfdir}/httpd/conf.d ] || exit 0
+[ -f %{_sysconfdir}/httpd/conf.d/shibboleth.conf ] && exit 0
+cp -p %{_sysconfdir}/shibboleth/apache2.config \
+    %{_sysconfdir}/httpd/conf.d/shibboleth.conf
+
 %postun
 /sbin/ldconfig
 
+# delete the shibboleth apache configuration if we're being removed
+[ "$0" = 0 ] || exit 0
+[ -f %{_sysconfdir}/httpd/conf.d/shibboleth.conf ] && \
+    rm -f %{_sysconfdir}/httpd/conf.d/shibboleth.conf
+
 %triggerin selinux-targeted-policy -- %{name}
 restorecon %{_sbindir}/shar