diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index 8d18202..5ac9eb7 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -11,7 +11,7 @@ Summary: The Cyrus SASL library. Name: cyrus-sasl Version: 2.1.21 -Release: 1 +Release: 1.4 License: Freely Distributable Group: System Environment/Libraries Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz @@ -184,6 +184,9 @@ autoheader autoconf -f popd +mkdir build-static build-shared +ln -s ../configure build-static +ln -s ../configure build-shared popd %if %{includev1} @@ -278,6 +281,9 @@ CPPFLAGS=`echo $CPPFLAGS $SQL_CFLAGS | cleanup_flags`; export CPPFLAGS LDFLAGS=`echo $LDFLAGS $SQL_LDFLAGS | cleanup_flags`; export LDFLAGS pushd cyrus-sasl-%{version} +build() { +pushd build-$1 +shift %configure \ --enable-shared --enable-static \ --disable-java \ @@ -302,19 +308,30 @@ pushd cyrus-sasl-%{version} --enable-ldapdb \ --enable-sql --with-mysql=%{_prefix} --with-pgsql=%{_prefix} \ --without-sqlite \ - $moreflags + "$@" # --enable-auth-sasldb -- EXPERIMENTAL make sasldir=%{_plugindir2} make -C saslauthd testsaslauthd popd +} + +# Build the static library without sql auxprop support. +build static --enable-static --disable-shared --disable-sql +# Build the shared library with all that stuff. +build shared --enable-static --enable-shared # Merge our static libdb in with libsasl, because we won't be installing it. -pushd cyrus-sasl-%{version}/lib +pushd build-static/lib ar x ${topdir}/db-instroot/lib/libdb.a ar cru libsasl2.a `ar t ${topdir}/db-instroot/lib/libdb.a` +tagname=CC ../libtool --mode=link %{__cc} -o sasl2-static-mechlist -I../../include $CFLAGS $RPM_SOURCE_DIR/sasl-mechlist.c $LDFLAGS ./libsasl2.la +popd # Build small programs to list the available mechanisms, because I need them. -tagname=CC ../libtool --mode=link %{__cc} -o sasl2-shared-mechlist -I../include $CFLAGS $RPM_SOURCE_DIR/sasl-mechlist.c $LDFLAGS ./libsasl2.la +pushd build-shared/lib +tagname=CC ../libtool --mode=link %{__cc} -o sasl2-shared-mechlist -I../../include $CFLAGS $RPM_SOURCE_DIR/sasl-mechlist.c $LDFLAGS ./libsasl2.la +popd + popd %install @@ -331,8 +348,12 @@ install -m755 sample/server $RPM_BUILD_ROOT%{_bindir}/sasl-sample-server popd %endif -pushd cyrus-sasl-%{version} +pushd cyrus-sasl-%{version}/build-shared make install DESTDIR=$RPM_BUILD_ROOT sasldir=%{_plugindir2} +cd ../build-static +make install DESTDIR=$RPM_BUILD_ROOT sasldir=%{_plugindir2} +cd ../build-shared +make install DESTDIR=$RPM_BUILD_ROOT sasldir=%{_plugindir2} -C plugins install -m755 -d $RPM_BUILD_ROOT%{_bindir} libtool --mode=install \ @@ -347,7 +368,7 @@ install -m755 utils/dbconverter-2 $RPM_BUILD_ROOT%{_sbindir}/dbconverter-2 # Install the saslauthd mdoc page in the expected location. Sure, it's not # really a man page, but groff seems to be able to cope with it. install -m755 -d $RPM_BUILD_ROOT%{_mandir}/man8/ -install -m644 saslauthd/saslauthd.mdoc $RPM_BUILD_ROOT%{_mandir}/man8/saslauthd.8 +install -m644 ../saslauthd/saslauthd.mdoc $RPM_BUILD_ROOT%{_mandir}/man8/saslauthd.8 # Create the saslauthd listening directory. install -m755 -d $RPM_BUILD_ROOT/var/run/saslauthd @@ -369,28 +390,20 @@ $RPM_BUILD_ROOT%{_sbindir}/ #install -m755 cyrus-sasl-%{version}/build-shared/saslauthd2-checkpass \ #$RPM_BUILD_ROOT%{_sbindir}/ -# Figure out an easy way to query the list of available mechanisms. +# Provide out an easy way to query the list of available mechanisms. libtool --mode=install \ -install -m755 cyrus-sasl-%{version}/lib/sasl2-shared-mechlist \ +install -m755 cyrus-sasl-%{version}/build-static/lib/sasl2-static-mechlist \ +$RPM_BUILD_ROOT%{_sbindir}/ +libtool --mode=install \ +install -m755 cyrus-sasl-%{version}/build-shared/lib/sasl2-shared-mechlist \ $RPM_BUILD_ROOT%{_sbindir}/ # Remove unpackaged files from the buildroot. rm -f $RPM_BUILD_ROOT%{_libdir}/sasl2/libotp.* rm -f $RPM_BUILD_ROOT%{_libdir}/sasl2/*.a +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_mandir}/cat8/saslauthd.8 -# Check that the static library includes all of the dependencies which -# aren't provided by other packages, i.e. that static linking works. -mysql_config=mysql_config -pg_config=pg_config -SQL_CFLAGS=`${mysql_config} --cflags`" -I"`${pg_config} --includedir` -SQL_LIBS=`${mysql_config} --libs`" -L"`${pg_config} --libdir`" -lpq" -%{__cc} -o $RPM_BUILD_ROOT/%{_sbindir}/sasl2-static-mechlist \ - -I$RPM_BUILD_ROOT/%{_includedir}/sasl $RPM_OPT_FLAGS $SQL_CFLAGS \ - $RPM_SOURCE_DIR/sasl-mechlist.c \ - $RPM_BUILD_ROOT/%{_libdir}/libsasl2.a \ - $SQL_LIBS -lldap -llber `pkg-config --libs openssl` - %clean test "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT @@ -421,12 +434,6 @@ fi %dir %{_plugindir}/ %endif %dir %{_plugindir2}/ -%if %{includev1} -%{_plugindir}/*anonymous*.so* -%{_plugindir}/*anonymous*.la -%endif -%{_plugindir2}/*anonymous*.so* -%{_plugindir2}/*anonymous*.la %{_plugindir2}/*sasldb*.so* %{_plugindir2}/*sasldb*.la %{_plugindir2}/*ldapdb*.so* @@ -449,6 +456,13 @@ fi %defattr(-,root,root) %doc %{name}-%{version}/{AUTHORS,COPYING,NEWS,README,doc/*.html} %{_libdir}/libsasl*.so.* +%dir %{_plugindir2}/ +%if %{includev1} +%{_plugindir}/*anonymous*.so* +%{_plugindir}/*anonymous*.la +%endif +%{_plugindir2}/*anonymous*.so* +%{_plugindir2}/*anonymous*.la %files plain %defattr(-,root,root) @@ -508,7 +522,7 @@ fi %{_bindir}/sasl2-sample-client %{_bindir}/sasl2-sample-server %{_includedir}/* -%{_libdir}/libsasl*.*a +%{_libdir}/libsasl*.a %{_libdir}/libsasl*.*so %if %{includev1} %{_plugindir}/*anonymous*.a @@ -536,6 +550,11 @@ fi #%{_sbindir}/saslauthd2-checkpass %changelog +* Mon Aug 29 2005 Nalin Dahyabhai 2.1.21-2 +- move the ANONYMOUS mech plugin to the -lib subpackage so that multilib + systems can use it without installing the main package +- build the static libraries without sql auxprop support + * Mon Aug 29 2005 Nalin Dahyabhai 2.1.21-1 - update to 2.1.21 - turn off compilation of libsasl v1 (finally)