-# $Id: courier-authlib.spec.in,v 1.8 2007/04/22 18:38:04 mrsam Exp $
+# $Id: courier-authlib.spec.in,v 1.18 2009/12/18 04:24:20 mrsam Exp $
#
-# Copyright 1998 - 2006 Double Precision, Inc. See COPYING for
+# Copyright 1998 - 2008 Double Precision, Inc. See COPYING for
# distribution information.
# No dist tag from mock; detect mandrake, redhat, etc. the old fashioned way
%if 0%{!?dist:1}
%define courier_release %(test -e /etc/mandrake-release -o -e /etc/mandriva-release && release="mdk" ; if test $? != 0; then release="`rpm -q --queryformat='.rh%{VERSION}' redhat-release 2>/dev/null`" ; if test $? != 0 ; then release="`rpm -q --queryformat='.fc%{VERSION}' fedora-release 2>/dev/null`" ; if test $? != 0 ; then release="" ; fi ; fi ; fi ; echo "$release")
+%else
+%define courier_release %{nil}
%endif
################################################################################
BuildRequires: pam-devel
BuildRequires: expect
BuildRequires: gcc-c++
+BuildRequires: redhat-rpm-config
BuildRequires: %{_includedir}/ltdl.h
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
+# Provides by symlinks in this release, for compatibility with 0.60,
+# will be removed in 0.62. This is temporary hack:
+
+%define dummysuffix %(test "%{_lib}" = "lib64" && echo '()(64bit)')
+
+Provides: libcourierauth.so.0%{dummysuffix} libcourierauthsasl.so.0%{dummysuffix} libcourierauthsaslclient.so.0%{dummysuffix} libcourierauthcommon.so.0%{dummysuffix}
+
################################################################################
%description
%prep
%setup -q
-%configure --with-redhat
+%configure -C --with-redhat
%build
-%{__make} %{_smp_mflags}
+%{__make} -s %{_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
MAKEFLAGS= %{__make} -j 1 install DESTDIR=$RPM_BUILD_ROOT
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/courier-authlib/*.a
%{__install} -m 555 sysconftool $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
-%{__install} -m 555 authmigrate $RPM_BUILD_ROOT%{_libexecdir}/courier-authlib
./courierauthconfig --configfiles >configtmp
-. configtmp
+. ./configtmp
-./authmksock $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
+d=`pwd`
+cd $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon || exit 1
+$d/authmksock ./socket || exit 1
+cd $d || exit 1
touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid.lock || exit 1
touch $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/pid || exit 1
%{__chmod} 777 $RPM_BUILD_ROOT%{_localstatedir}/spool/authdaemon/socket || exit 1
$RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/courier-authlib
%post
-%{_libexecdir}/courier-authlib/authmigrate >/dev/null
%{_libexecdir}/courier-authlib/sysconftool %{_sysconfdir}/authlib/*.dist >/dev/null
/sbin/chkconfig --del courier-authlib
%files -f configfiles.base
%defattr(-,root,root,-)
%doc README README*html README.authmysql.myownquery README.ldap
-%doc NEWS COPYING* AUTHORS ChangeLog authldap.schema
+%doc NEWS COPYING* AUTHORS ChangeLog
/etc/rc.d/init.d/*
%ghost %attr(600, root, root) %{_localstatedir}/spool/authdaemon/pid.lock
%ghost %attr(644, root, root) %{_localstatedir}/spool/authdaemon/pid
%files -f configfiles.ldap ldap
%defattr(-,root,root,-)
-%doc authldap.schema
+%doc authldap.schema authldap.ldif
%files -f configfiles.mysql mysql