Переглянути джерело

add options for LDAP and MySQL backends, patch for MySQL4 support

Michael van Elst 23 роки тому
батько
коміт
9792ffdf23
1 змінених файлів з 31 додано та 1 видалено
  1. 31 1
      sasl/sasl.spec

+ 31 - 1
sasl/sasl.spec

@@ -39,11 +39,14 @@ Release:      20030307
 %option       with_fsl    no
 %option       with_pam    no
 %option       with_login  no
+%option       with_ldap   no
+%option       with_mysql  no
 
 #   list of sources
 Source0:      ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz
 Source1:      rc.sasl
 Source2:      fsl.sasl
+Patch0:       sasl.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -58,6 +61,12 @@ PreReq:       fsl
 BuildPreReq:  PAM
 PreReq:       PAM
 %endif
+%if "%{with_ldap}" == "yes"
+BuildPreReq:  openldap
+%endif
+%if "%{with_mysql}" == "yes"
+BuildPreReq:  MYSQL, zlib
+%endif
 AutoReq:      no
 AutoReqProv:  no
 
@@ -75,6 +84,7 @@ AutoReqProv:  no
     %{l_shtool} subst \
         -e 's;^ *for dbname in ;for dbname in db ;' \
         configure
+    %patch -p0
 
 %build
     %{l_shtool} subst \
@@ -84,14 +94,22 @@ AutoReqProv:  no
         configure
 
     cflags="%{l_cflags -O} %{l_cppflags}"
-    ldflags="-L%{l_prefix}/lib"
+    ldflags="%{l_ldflags}"
     libs="-ldb"
 %if "%{with_fsl}" == "yes"
     ldflags="$ldflags `%{l_prefix}/bin/fsl-config --all --ldflags`"
     libs="$libs `%{l_prefix}/bin/fsl-config --all --libs`"
+%endif
+%if "%{with_ldap}" == "yes"
+    ldflags="$ldflags `%{l_prefix}/bin/fsl-config --all --ldflags`"
+    libs="$libs `%{l_prefix}/bin/fsl-config --all --libs`"
+%endif
+%if "%{with_mysql}" == "yes"
+    libs="$libs -lz -lm"
 %endif
     CC="%{l_cc}" \
     CFLAGS="$cflags" \
+    CPPFLAGS="%{l_cppflags}" \
     LDFLAGS="$ldflags" \
     LIBS="$libs" \
     ./configure \
@@ -109,6 +127,18 @@ AutoReqProv:  no
 %endif
 %if "%{with_login}" == "yes"
         --enable-login \
+%else
+        --disable-login \
+%endif
+%if "%{with_ldap}" == "yes"
+        --with-ldap=%{l_prefix} \
+%else
+        --without-ldap \
+%endif
+%if "%{with_mysql}" == "yes"
+        --with-mysql=%{l_prefix} \
+%else
+        --without-mysql \
 %endif
         --disable-shared \
         --enable-static \