Conditionally bypass built-in Apache dependency.
[shibboleth/sp.git] / shibboleth.spec.in
index 1930de9..25ab215 100644 (file)
@@ -1,7 +1,7 @@
 Name:          shibboleth
 Summary:       Open source system to enable inter-institutional resource sharing
 Version:       @-VERSION-@
-Release:       1
+Release:       2
 #Copyright:    Internet2
 Group:         System Environment/Libraries
 License:       Apache style
@@ -9,14 +9,20 @@ URL:          http://shibboleth.internet2.edu/
 Source0:       http://shibboleth.internet2.edu/downloads/%{name}-%{version}.tar.gz
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
 
-BuildRequires: openssl-devel, curl-devel >= 7.10.6, xerces%{?xercesver}-c-devel >= 2.6.1
-BuildRequires: xml-security-c-devel >= 1.3.1, log4cpp-devel >= 0.3.5
+BuildRequires: openssl-devel, curl-devel >= 7.10.6
+BuildRequires: xerces%{?xercesver}-c-devel >= 2.6.1, xml-security-c-devel >= 1.3.1
 BuildRequires: zlib-devel, opensaml-devel >= 2.0
+%if %{?_with_log4cpp:1}
+BuildRequires: log4cpp-devel >= 0.3.5
+%else
+BuildRequires: log4shib-devel
+%endif
+%{!?_without_odbc:BuildRequires: unixODBC-devel}
 %if "%{_vendor}" == "redhat"
-BuildRequires: httpd-devel
+%{!?_without_builtinapache:BuildRequires: httpd-devel}
 %endif
 %if "%{_vendor}" == "suse"
-BuildRequires: apache2-devel
+%{!?_without_builtinapache:BuildRequires: apache2-devel}
 %endif
 
 
@@ -69,7 +75,7 @@ installed.
 %setup -q
 
 %build
-%configure %{?shib_options}
+%configure %{?_without_odbc:--disable-odbc} %{?_without_adfs:--disable-adfs} %{?shib_options}
 make
 #make -C selinux
 
@@ -80,6 +86,11 @@ make install DESTDIR=$RPM_BUILD_ROOT
 make -C selinux install DESTDIR=$RPM_BUILD_ROOT
 mv $RPM_BUILD_ROOT/usr/doc/%{name} _docs
 
+%if "%{_vendor}" == "suse"
+       sed -i "s/\/var\/log\/httpd/\/var\/log\/apache2/g" \
+               $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
+%endif
+
 find $RPM_BUILD_ROOT/%{_libexecdir} -type f -or -type l | grep \.so |
   sed -e "s|$RPM_BUILD_ROOT||" | sort > rpm.filelist
 
@@ -113,9 +124,15 @@ if [ "$APACHE_CONFIG" != "no" ] ; then
        fi
        if [ "$APACHE_CONFD" != "no" ] ; then
                if [ ! -f $APACHE_CONFD/shib.conf ] ; then
-                       sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
+%if "%{_vendor}" == "suse"
+                   sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
                                %{_sysconfdir}/%{name}/$APACHE_CONFIG \
                                > $APACHE_CONFD/shib.conf
+%else
+                       sed "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-@-VERSION-@/g" \
+                           %{_sysconfdir}/%{name}/$APACHE_CONFIG \
+                           > $APACHE_CONFD/shib.conf
+%endif
                fi
        fi
 fi
@@ -124,7 +141,7 @@ fi
 %if "%{_vendor}" == "redhat"
        if [ -d %{_sysconfdir}/init.d ] ; then
                if [ ! -f %{_sysconfdir}/init.d/shibd ] ; then
-                       cp -p %{_sysconfdir}/%{name}/shibd %{_sysconfdir}/init.d/shibd
+                       cp -p %{_sysconfdir}/%{name}/shibd-%{_vendor} %{_sysconfdir}/init.d/shibd
                        chmod 755 %{_sysconfdir}/init.d/shibd
                        chkconfig --add shibd
                fi
@@ -159,8 +176,8 @@ restorecon %{_sbindir}/shibd
 
 %files -f rpm.filelist
 %defattr(-,root,root,-)
-%doc _docs/CREDITS.txt _docs/NOTICE.txt _docs/NEWS.txt _docs/logo.jpg
-%doc _docs/main.css _docs/README.txt _docs/LICENSE.txt
+%doc _docs/CREDITS.txt _docs/LICENSE.txt _docs/NOTICE.txt _docs/README.txt _docs/RELEASE.txt
+%doc _docs/logo.jpg _docs/main.css
 %{_sbindir}/shibd
 %{_sbindir}/siterefresh
 %{_bindir}/samlquery
@@ -192,6 +209,12 @@ restorecon %{_sbindir}/shibd
 %{_sysconfdir}/selinux/targeted/src/policy/domains/program/*.te
 
 %changelog
+* Fri Jul 13 2007 Scott Cantor <cantor.2@osu.edu>  - 2.0-2
+- Second alpha release
+
+* Sun Jun 10 2007 Scott Cantor <cantor.2@osu.edu>  - 2.0-1
+- First alpha release
+
 * Mon Oct 2 2006 Scott Cantor  <cantor.2@osu.edu>  - 1.3-11
 - Applied fix for secadv 20061002
 - Fix for metadata loader loop