Conditionally bypass built-in Apache dependency.
[shibboleth/sp.git] / shibboleth.spec.in
index ba5c42f..25ab215 100644 (file)
@@ -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: zlib-devel, unixODBC-devel, opensaml-devel >= 2.0
+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