Rewrite spec file, make corect CFLAGS, CPPFLAGS and LDFLAGS
This commit is contained in:
parent
410f2cd182
commit
c4c518457a
@ -9,7 +9,7 @@
|
|||||||
Summary: The Cyrus SASL library
|
Summary: The Cyrus SASL library
|
||||||
Name: cyrus-sasl
|
Name: cyrus-sasl
|
||||||
Version: 2.1.23
|
Version: 2.1.23
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
License: BSD
|
License: BSD
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
# Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/;
|
# Source0 originally comes from ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/;
|
||||||
@ -190,41 +190,42 @@ krb5_prefix=`krb5-config --prefix`
|
|||||||
if test x$krb5_prefix = x%{_prefix} ; then
|
if test x$krb5_prefix = x%{_prefix} ; then
|
||||||
krb5_prefix=
|
krb5_prefix=
|
||||||
else
|
else
|
||||||
CPPFLAGS="-I${krb5_prefix}/include"; export CPPFLAGS
|
CPPFLAGS="-I${krb5_prefix}/include $CPPFLAGS"; export CPPFLAGS
|
||||||
CFLAGS="-I${krb5_prefix}/include $CFLAGS"
|
LDFLAGS="-L${krb5_prefix}/%{_lib} $LDFLAGS"; export LDFLAGS
|
||||||
LDFLAGS="-L${krb5_prefix}/%{_lib}"; export LDFLAGS
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find OpenSSL.
|
# Find OpenSSL.
|
||||||
LIBS="-lcrypt"; export LIBS
|
LIBS="-lcrypt"; export LIBS
|
||||||
if pkg-config openssl ; then
|
if pkg-config openssl ; then
|
||||||
CPPFLAGS="`pkg-config --cflags-only-I openssl` $CPPFLAGS"; export CPPFLAGS
|
CPPFLAGS="`pkg-config --cflags-only-I openssl` $CPPFLAGS"; export CPPFLAGS
|
||||||
CFLAGS="`pkg-config --cflags openssl` $CFLAGS"; export CFLAGS
|
|
||||||
LDFLAGS="`pkg-config --libs-only-L openssl` $LDFLAGS"; export LDFLAGS
|
LDFLAGS="`pkg-config --libs-only-L openssl` $LDFLAGS"; export LDFLAGS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find the SQL libraries used needed by the SQL auxprop plugin.
|
# Find the MySQL libraries used needed by the SQL auxprop plugin.
|
||||||
mysql_config=mysql_config
|
INC_DIR="`mysql_config --include`"
|
||||||
pg_config=pg_config
|
if test x"$INC_DIR" != "x-I%{_includedir}"; then
|
||||||
SQL_CFLAGS=`${mysql_config} --cflags`" -I"`${pg_config} --includedir`
|
CPPFLAGS="$INC_DIR $CPPFLAGS"; export CPPFLAGS
|
||||||
SQL_LIBS=`${mysql_config} --libs`" -L"`${pg_config} --libdir`" -lpq"
|
fi
|
||||||
SQL_CFLAGS=`eval echo "$SQL_CFLAGS" | sed -e 's,-I%{_includedir}[^/],,g' -e 's,-I%{_includedir}$,,g' -e 's,[[:blank:]]+, ,g'`
|
LIB_DIR="`mysql_config --libs | sed -e 's,-[^L][^ ]*,,g' -e 's,^ *,,' -e 's, *$,,' -e 's, *, ,g'`"
|
||||||
SQL_LIBS=`eval echo "$SQL_LIBS" | sed -e 's,-L%{_libdir}[^/],,g' -e 's,-L%{_libdir}$,,g' -e 's,[[:blank:]]+, ,g'`
|
if test x"$LIB_DIR" != "x-L%{_libdir}"; then
|
||||||
SQL_LDFLAGS=`eval echo "$SQL_LIBS" | sed -e 's,-[^L][^ ]*,,g'`
|
LDFLAGS="$LIB_DIR $LDFLAGS"; export LDFLAGS
|
||||||
echo $SQL_LDFLAGS
|
fi
|
||||||
SQL_LIBS=`eval echo "$SQL_LIBS" | sed -e 's,-[^l][^ ]*,,g'`
|
|
||||||
echo $SQL_LIBS
|
|
||||||
|
|
||||||
cleanup_flags() {
|
# Find the PostgreSQL libraries used needed by the SQL auxprop plugin.
|
||||||
sed -r -e 's,-D_GNU_SOURCE(=[^[:blank:]]+)?,,g' \
|
INC_DIR="-I`pg_config --includedir`"
|
||||||
-e 's,-D_FILE_OFFSET_BITS=[[:digit:]]+,,g' \
|
if test x"$INC_DIR" != "x-I%{_includedir}"; then
|
||||||
-e 's,-D_LARGEFILE_SOURCE(=[^[:blank:]]+)?,,g' \
|
CPPFLAGS="$INC_DIR $CPPFLAGS"; export CPPFLAGS
|
||||||
-e 's,[[:blank:]]+, ,g'
|
fi
|
||||||
}
|
LIB_DIR="-L`pg_config --libdir`"
|
||||||
CFLAGS=`echo $CFLAGS $SQL_CFLAGS | cleanup_flags`; export CFLAGS
|
if test x"$LIB_DIR" != "x-L%{_libdir}"; then
|
||||||
CPPFLAGS=`echo $CPPFLAGS $SQL_CFLAGS | cleanup_flags`; export CPPFLAGS
|
LDFLAGS="$LIB_DIR $LDFLAGS"; export LDFLAGS
|
||||||
LDFLAGS=`echo $LDFLAGS $SQL_LDFLAGS | cleanup_flags`; export LDFLAGS
|
fi
|
||||||
|
|
||||||
|
CFLAGS="$CFLAGS $CPPFLAGS"; export CFLAGS
|
||||||
|
|
||||||
|
echo "$CFLAGS"
|
||||||
|
echo "$CPPFLAGS"
|
||||||
|
echo "$LDFLAGS"
|
||||||
|
|
||||||
%configure \
|
%configure \
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
@ -395,6 +396,9 @@ fi
|
|||||||
%{_sbindir}/sasl2-shared-mechlist
|
%{_sbindir}/sasl2-shared-mechlist
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 10 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-10
|
||||||
|
- Rewrite spec file, make corect CFLAGS, CPPFLAGS and LDFLAGS
|
||||||
|
|
||||||
* Mon Feb 22 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-9
|
* Mon Feb 22 2010 Jan F. Chadima <jchadima@redhat.com> - 2.1.23-9
|
||||||
- solve race condition (#566875)
|
- solve race condition (#566875)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user