+#
+# Conditional build:
+%bcond_without ldap # do not include LDAP support
+
Summary: Courier authentication library
Summary(pl.UTF-8): Biblioteka uwierzytelniania Couriera
Name: courier-authlib
-Version: 0.59.1
-Release: 5
+Version: 0.65.0
+Release: 1
License: GPL
Group: Networking/Daemons
-Source0: http://dl.sourceforge.net/courier/%{name}-%{version}.tar.bz2
-# Source0-md5: 4e7327980724c4c327aace23facd5d59
+Source0: http://downloads.sourceforge.net/courier/%{name}-%{version}.tar.bz2
+# Source0-md5: e9287e33b0e70ea3745517b4d719948d
Source1: %{name}.init
-Patch0: %{name}-build.patch
-Patch1: %{name}-md5sum-passwords.patch
-Patch2: %{name}-authdaemonrc.patch
-Patch3: %{name}-nostatic.patch
-Patch4: %{name}-ltdl.patch
+Patch0: %{name}-md5sum-passwords.patch
+Patch1: %{name}-authdaemonrc.patch
+Patch2: %{name}-nostatic.patch
+Patch3: %{name}-ltdl.patch
URL: http://www.courier-mta.org/authlib/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libltdl-devel
BuildRequires: libtool
BuildRequires: mysql-devel
-BuildRequires: openldap-devel >= 2.4.6
+%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
BuildRequires: pam-devel
BuildRequires: postgresql-devel
BuildRequires: rpmbuild(macros) >= 1.304
+BuildRequires: sqlite3-devel
BuildRequires: sysconftool
BuildRequires: zlib-devel
Requires(post,postun): /sbin/ldconfig
Summary(pl.UTF-8): Pliki programistyczne dla biblioteki uwierzytelniania Couriera
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: %{name}-authldap = %{version}-%{release}
+%{?with_ldap:Requires: %{name}-authldap = %{version}-%{release}}
Requires: %{name}-authmysql = %{version}-%{release}
Requires: %{name}-authpgsql = %{version}-%{release}
Requires: %{name}-authuserdb = %{version}-%{release}
Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem
PostgreSQL.
+%package authpipe
+Summary: External authentication module that communicates via pipes
+Summary(pl.UTF-8): Zewnętrzny moduł uwierzytelniający komunikujący się przez potoki
+Group: Networking/Daemons
+Requires(pre,postun): sed >= 4.0
+Requires: %{name} = %{version}-%{release}
+Obsoletes: courier-authlib-authpipe
+
+%description authpipe
+This package installs the authpipe module, which is a generic plugin
+that enables authentication requests to be serviced by an external
+program, then communicates through messages on stdin and stdout.
+
+%description authpipe -l pl.UTF-8
+Pakiet ten instaluje moduł authpipe, który jest ogólną wtyczką
+umożliwiającą obsługę żądań uwierzytelnienia przez zewnętrzny program
+komunikujący się poprzez wiadomości wysyłane na stdin i stdout.
+
+%package authsqlite
+Summary: SQLite support for the Courier authentication library
+Summary(pl.UTF-8): Obsługa SQLite dla biblioteki uwierzytelniania Couriera
+Group: Networking/Daemons
+Requires(pre,postun): sed >= 4.0
+Requires: %{name} = %{version}-%{release}
+
+%description authsqlite
+This package installs SQLite support for the Courier authentication
+library. Install this package in order to be able to authenticate
+using SQLite.
+
+%description authsqlite -l pl.UTF-8
+Ten pakiet dodaje obsługę SQLite do biblioteki uwierzytelniania
+Couriera. Należy go zainstalować aby móc uwierzytelniać się z użyciem
+SQLite.
+
%package authuserdb
Summary: Userdb support for the Courier authentication library
Summary(pl.UTF-8): Obsługa userdb dla biblioteki uwierzytelniania Couriera
Należy go zainstalować aby móc uwierzytelniać się z użyciem userdb.
-%package authpipe
-Summary: External authentication module that communicates via pipes
-Summary(pl.UTF-8): Zewnętrzny moduł uwierzytelniający komunikujący się przez potoki
-Group: Networking/Daemons
-Requires(pre,postun): sed >= 4.0
-Requires: %{name} = %{version}-%{release}
-Obsoletes: courier-authlib-authpipe
-
-%description authpipe
-This package installs the authpipe module, which is a generic plugin
-that enables authentication requests to be serviced by an external
-program, then communicates through messages on stdin and stdout.
-
-%description authpipe -l pl.UTF-8
-Pakiet ten instaluje moduł authpipe, który jest ogólną wtyczką
-umożliwiającą obsługę żądań uwierzytelnienia przez zewnętrzny program
-komunikujący się poprzez wiadomości wysyłane na stdin i stdout.
-
%package -n openldap-schema-courier
Summary: Courier LDAP schema
Summary(pl.UTF-8): Schemat LDAP Couriera
%patch1 -p1
%patch2 -p1
%patch3 -p1
-%patch4 -p1
rm -rf libltdl
%build
-for d in . gdbmobj bdbobj md5 sha1 libhmac makedat userdb; do
-cd $d
+# Change Makefile.am files and force recreate Makefile.in's.
+OLDDIR=`pwd`
+find -type f -a \( -name configure.in -o -name configure.ac \) | while read FILE; do
+ cd "`dirname "$FILE"`"
+
+ if [ -f Makefile.am ]; then
+ sed -i -e '/_[L]DFLAGS=-static/d' Makefile.am
+ fi
+
%{__libtoolize}
%{__aclocal}
%{__autoconf}
- %{__autoheader}
+ if grep -q AC_CONFIG_HEADER configure.in; then
+ %{__autoheader}
+ fi
%{__automake}
-cd -
+
+ cd "$OLDDIR"
done
%configure \
+ --enable-ltdl-install=no \
+ %{!?with_ldap:--without-authldap} \
--with-db=db \
--with-mailuser=daemon \
--with-mailgroup=daemon
-%{__make} \
+%{__make} -j1 \
LDFLAGS="%{rpmldflags} -lcrypt"
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -j1 install \
DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/authlib/userdb,%{schemadir},%{_bindir}}
/sbin/ldconfig %{_libexecdir}/courier-authlib
%service -q courier-authlib restart
-%post authuserdb
+%post authpipe
if [ "$1" = 1 ]; then
# add to authmodulelist list if package is first installed
- %{__sed} -i -e '/^authmodulelist=/{/\buserdb\b/!s/"$/ userdb"/}' /etc/authlib/authdaemonrc
+ %{__sed} -i -e '/^authmodulelist=/{/\bpipe\b/!s/"$/ pipe"/}' /etc/authlib/authdaemonrc
fi
/sbin/ldconfig %{_libexecdir}/courier-authlib
%service -q courier-authlib restart
-%postun authuserdb
+%postun authpipe
if [ "$1" = 0 ]; then
# remove from authmodulelist if package is removed
- %{__sed} -i -e '/^authmodulelist=/{s/ \?\buserdb\b \?//}' /etc/authlib/authdaemonrc
+ %{__sed} -i -e '/^authmodulelist=/{s/ \?\bpipe\b \?//}' /etc/authlib/authdaemonrc
fi
/sbin/ldconfig %{_libexecdir}/courier-authlib
%service -q courier-authlib restart
-%post authpipe
+%post authsqlite
if [ "$1" = 1 ]; then
# add to authmodulelist list if package is first installed
- %{__sed} -i -e '/^authmodulelist=/{/\bpipe\b/!s/"$/ pipe"/}' /etc/authlib/authdaemonrc
+ %{__sed} -i -e '/^authmodulelist=/{/\bauthsqlite\b/!s/"$/ authsqlite"/}' /etc/authlib/authdaemonrc
fi
/sbin/ldconfig %{_libexecdir}/courier-authlib
%service -q courier-authlib restart
-%postun authpipe
+%postun authsqlite
if [ "$1" = 0 ]; then
# remove from authmodulelist if package is removed
- %{__sed} -i -e '/^authmodulelist=/{s/ \?\bpipe\b \?//}' /etc/authlib/authdaemonrc
+ %{__sed} -i -e '/^authmodulelist=/{s/ \?\bauthsqlite\b \?//}' /etc/authlib/authdaemonrc
+fi
+/sbin/ldconfig %{_libexecdir}/courier-authlib
+%service -q courier-authlib restart
+
+%post authuserdb
+if [ "$1" = 1 ]; then
+ # add to authmodulelist list if package is first installed
+ %{__sed} -i -e '/^authmodulelist=/{/\buserdb\b/!s/"$/ userdb"/}' /etc/authlib/authdaemonrc
+fi
+/sbin/ldconfig %{_libexecdir}/courier-authlib
+%service -q courier-authlib restart
+
+%postun authuserdb
+if [ "$1" = 0 ]; then
+ # remove from authmodulelist if package is removed
+ %{__sed} -i -e '/^authmodulelist=/{s/ \?\buserdb\b \?//}' /etc/authlib/authdaemonrc
fi
/sbin/ldconfig %{_libexecdir}/courier-authlib
%service -q courier-authlib restart
%attr(755,root,root) %{_libexecdir}/courier-authlib/authdaemond
%attr(755,root,root) %{_libexecdir}/courier-authlib/authsystem.passwd
%attr(755,root,root) %{_libexecdir}/courier-authlib/makedatprog
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthcustom.so.*.*.*
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpam.so.*.*.*
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthcommon.so.*.*.*
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsasl.so.*.*.*
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsaslclient.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthcustom.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthcustom.so.0
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpam.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpam.so.0
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthcommon.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthcommon.so.0
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsasl.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthsasl.so.0
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauthsaslclient.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauthsaslclient.so.0
%{_libexecdir}/courier-authlib/libauthcustom.la
%{_libexecdir}/courier-authlib/libauthpam.la
%{_libexecdir}/courier-authlib/libcourierauth.la
%files libs
%defattr(644,root,root,755)
%dir %{_libexecdir}/courier-authlib
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauth.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libcourierauth.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libcourierauth.so.0
%files devel
%defattr(644,root,root,755)
%{_mandir}/man3/*
%attr(755,root,root) %{_libexecdir}/courier-authlib/*.so
+%if %{with ldap}
%files authldap
%defattr(644,root,root,755)
%doc authldap.schema README.ldap
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authldaprc
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthldap.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthldap.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthldap.so.0
%{_libexecdir}/courier-authlib/libauthldap.la
+%endif
%files authmysql
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authmysqlrc
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthmysql.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthmysql.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthmysql.so.0
%{_libexecdir}/courier-authlib/libauthmysql.la
%files authpgsql
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authpgsqlrc
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpgsql.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpgsql.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpgsql.so.0
%{_libexecdir}/courier-authlib/libauthpgsql.la
+%files authpipe
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpipe.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthpipe.so.0
+%{_libexecdir}/courier-authlib/libauthpipe.la
+
+%files authsqlite
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/authlib/authsqliterc
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthsqlite.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthsqlite.so.0
+%{_libexecdir}/courier-authlib/libauthsqlite.la
+
%files authuserdb
%defattr(644,root,root,755)
%attr(700,root,root) %dir %{_sysconfdir}/authlib/userdb
%attr(755,root,root) %{_sbindir}/userdb
%attr(755,root,root) %{_sbindir}/userdb-test-cram-md5
%attr(755,root,root) %{_sbindir}/userdbpw
-%attr(755,root,root) %{_sbindir}/vchkpw2userdb
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthuserdb.so.*.*.*
+%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthuserdb.so
+%attr(755,root,root) %ghost %{_libexecdir}/courier-authlib/libauthuserdb.so.0
%{_libexecdir}/courier-authlib/libauthuserdb.la
%{_mandir}/man8/*userdb*
-%files authpipe
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libexecdir}/courier-authlib/libauthpipe.so.*.*.*
-%{_libexecdir}/courier-authlib/libauthpipe.la
-
+%if %{with ldap}
%files -n openldap-schema-courier
%defattr(644,root,root,755)
%{schemadir}/*.schema
+%endif