#
-# Conditional builds:
-# _with_srp - build srp pluggin
-# _without_myslq - don't build mysql pluggin
-# _without_ldap - disable LDAP support for sasluthd
+# TODO:
+# - add ldap plugin from openldap sources
+# - cleaner solution for mysql/pgsql support
+#
+# Conditional build:
+%bcond_without ldap # disable LDAP support for saslauthd
+%bcond_with gssapi # enable GSSAPI support for saslauthd and build gssapi plugin
+%bcond_without mysql # don't build mysql pluggin
+%bcond_with pgsql # build pgsql pluggin
+%bcond_with srp # build srp pluggin
+%bcond_with pwcheck # build pwcheck helper (deprecated)
+%bcond_with x509 # build x509 plugin (no sources in package???)
#
Summary: The SASL library API for the Cyrus mail system
Summary(pl): Biblioteka Cyrus SASL
Summary(ru): âÉÂÌÉÏÔÅËÁ Cyrus SASL
Summary(uk): â¦Â̦ÏÔÅËÁ Cyrus SASL
Name: cyrus-sasl
-Version: 2.1.10
+Version: 2.1.19
Release: 1
License: distributable
Group: Libraries
-Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail//%{name}-%{version}.tar.gz
+Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus/%{name}-%{version}.tar.gz
+# Source0-md5: ea76410ad88fa7b6c17a6aac424382c9
Source1: saslauthd.init
Source2: saslauthd.sysconfig
Source3: %{name}.pam
Patch0: %{name}-configdir.patch
Patch1: %{name}-nolibs.patch
-Patch2: %{name}-lt14d.patch
-Patch3: %{name}-do_dlopen.patch
-BuildRequires: autoconf
+Patch2: %{name}-lt.patch
+URL: http://asg.web.cmu.edu/sasl/
+BuildRequires: autoconf >= 2.54
BuildRequires: automake
BuildRequires: db-devel
+BuildRequires: ed
+%{?with_gssapi:BuildRequires: heimdal-devel}
BuildRequires: libtool >= 1.4
-%{!?_without_mysql:BuildRequires: mysql-devel}
-%{!?_without_ldap:BuildRequires: openldap-devel}
-BuildRequires: openssl-devel >= 0.9.6a
+%{?with_mysql:BuildRequires: mysql-devel}
+%{?with_pgsql:BuildRequires: postgresql-devel}
+%{?with_ldap:BuildRequires: openldap-devel}
+BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pam-devel
-URL: http://asg.web.cmu.edu/sasl/
+Requires(post): /sbin/ldconfig
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sysconfdir /etc/sasl
%description
-This is an implemention of the SASL API, useful for adding
+This is an implementation of the SASL API, useful for adding
authentication, authorization, and security to network protocols. The
SASL protocol itself is documented in rfc2222; the API standard is a
work in progress.
Summary(ru): æÁÊÌÙ ÄÌÑ ÐÒÏÇÒÁÍÍÉÒÏ×ÁÎÉÑ Ó ÂÉÂÌÉÏÔÅËÏÊ Cyrus SASL
Summary(ru): æÁÊÌÉ ÄÌÑ ÐÒÏÇÒÁÍÕ×ÁÎÎÑ Ú Â¦Â̦ÏÔÅËÏÀ Cyrus SASL
Group: Development/Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description devel
This includes the header files and documentation needed to develop
Summary(ru): óÔÁÔÉÞÅÓËÉÅ ÂÉÂÌÉÏÔÅËÉ Cyrus SASL
Summary(uk): óÔÁÔÉÞΦ ¦Â̦ÏÔÅËÉ Cyrus SASL
Group: Development/Libraries
-Requires: %{name}-devel = %{version}
+Requires: %{name}-devel = %{version}-%{release}
%description static
Static cyrus-sasl libraries.
Summary(pl): Wtyczka Cram-MD5 do Cyrus SASL
Summary(pt_BR): Mecanismo SASL CRAM-MD5
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description cram-md5
This plugin implements the SASL CRAM-MD5 mechanism. CRAM-MD5 is the
Summary(pl): Wtyczka Digest-MD5 do Cyrus SASL
Summary(pt_BR): Mecanismo SASL DIGEST-MD5
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description digest-md5
This plugin implements the latest draft of the SASL DIGEST-MD5
Summary(pl): Wtyczka plain do Cyrus SASL
Summary(pt_BR): Mecanismo SASL PLAIN
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description plain
This plugin implements the SASL PLAIN mechanism. Although insecure,
Summary(pl): Wtyczka anonymous do Cyrus SASL
Summary(pt_BR): Mecanismo SASL ANONYMOUS
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description anonymous
This plugin implements the SASL ANONYMOUS mechanism, used for
Este plugin implementa o mecanismo SASL ANONYMOUS, usado para
autenticação anônima.
+%package gssapi
+Summary: GSSAPI Cyrus SASL plugin
+Summary(pl): Wtyczka GSSAPI do Cyrus SASL
+Summary(pt_BR): Mecanismo SASL GSSAPI
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description gssapi
+This plugin implements the SASL GSSAPI mechanism, used for
+GSSAPI/Kerberos5 authentication.
+
+%description gssapi -l pl
+Wtyczka dodaj±ca obs³ugê mechanizmu SASL GSSAPI, u¿ywanego do
+uwierzytelniania z u¿yciem GSSAPI/Kerberos5.
+
+%description gssapi -l pt_BR
+Este plugin implementa o mecanismo SASL GSSAPI, usado para
+autenticação Kerberos/GSSAPI.
+
%package login
Summary: Unsupported Login Cyrus SASL plugin
Summary(pl): Nie wspierana wtyczka Login do Cyrus SASL
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description login
Unsupported LOGIN Cyrus SASL plugin.
Summary(pl): Wtyczka SRP do Cyrus SASL
Summary(pt_BR): Mecanismo SASL SRP
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description srp
This plugin implements the SASL SRP mechanism, based on the Secure
Summary(pl): Wtyczka OTP do Cyrus SASL
Summary(pt_BR): Mecanismo SASL OTP
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description otp
This plugin implements the SASL OTP (One Time Password) mechanism.
Summary: x509 Cyrus SASL plugin
Summary(pl): Wtyczka x509 do Cyrus SASL
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description x509
x509 Cyrus SASL plugin.
%package saslauthd
Summary: Cyrus SASL authd
Summary(pl): Demon authd do Cyrus SASL
-Group: Libraries
+Group: Daemons
Requires(post,postun): /sbin/chkconfig
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description saslauthd
Cyrus SASL authd.
Summary: Cyrus SASL pwcheck helper
Summary(pl): Program pomocniczy pwcheck do Cyrus SASL
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description pwcheck
Cyrus SASL pwcheck helper.
Summary: Cyrus SASL sasldb plugin
Summary(pl): Wtyczka sasldb do Cyrus SASL
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description sasldb
Cyrus SASL sasldb plugin.
Summary: Cyrus SASL mysql plugin
Summary(pl): Wtyczka mysql do Cyrus SASL
Group: Libraries
-Requires: %{name} = %{version}
+Requires: %{name} = %{version}-%{release}
%description mysql
Cyrus SASL mysql plugin.
%description mysql -l pl
Wtyczka mysql do Cyrus SASL.
+%package pgsql
+Summary: Cyrus SASL PostgreSQL plugin
+Summary(pl): Wtyczka PostgreSQL do Cyrus SASL
+Group: Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description pgsql
+Cyrus SASL PostgreSQL plugin.
+
+%description pgsql -l pl
+Wtyczka PostgreSQL do Cyrus SASL.
+
%prep
-%setup -q
+%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
-%patch3 -p1
+
+cd doc
+echo "cyrus-sasl complies with the following RFCs:" > rfc-compliance
+ls rfc*.txt >> rfc-compliance
+rm -f rfc*.txt
%build
# acinclude.m4 contains only old libtool.m4
-rm -f acinclude.m4 config/missing
+rm -f acinclude.m4 libtool config/libtool.m4
%{__libtoolize}
%{__aclocal} -I cmulocal -I config
%{__autoheader}
%{__autoconf}
cd saslauthd
-%{__aclocal} -I ../cmulocal -I ../config -I config
-%{__autoheader}
-automake -a
-%{__autoconf}
+ rm -f acinclude.m4
+ %{__libtoolize}
+ %{__aclocal} -I ../cmulocal -I ../config -I config
+ %{__autoheader}
+ %{__automake}
+ %{__autoconf}
cd ..
-LDFLAGS="%{rpmldflags} -ldl"; export LDFLAGS
%configure \
- --enable-static \
+ --disable-krb4 \
+ %{!?with_gssapi: --disable-gssapi} \
+ %{?with_gssapi: --enable-gssapi --with-gss_impl=heimdal} \
--enable-login \
- %{?_with_srp:--enable-srp} \
- %{?!_without_mysql: --with-mysql=%{_prefix}} \
- %{?!_without_ldap: --with-ldap=%{_prefix}} \
- %{?_with_pwcheck: --with-pwcheck=/var/lib/sasl2} \
- --with-saslauthd=/var/lib/sasl2 \
- --with-pam \
+ --enable-sql \
+ %{?with_srp: --enable-srp} \
+ --enable-static \
+ --with-plugindir=%{_libdir}/sasl2 \
+ --with-configdir=%{_sysconfdir} \
--with-dblib=berkeley \
--with-dbpath=/var/lib/sasl2/sasl.db \
- --with-configdir=%{_sysconfdir} \
- --disable-krb4 \
- --disable-gssapi
+ %{?with_ldap: --with-ldap=%{_prefix}} \
+ %{?with_mysql: --with-mysql=%{_prefix}} \
+ %{?with_pgsql: --with-pgsql=%{_prefix}} \
+ --with-pam \
+ %{?with_pwcheck: --with-pwcheck=/var/lib/sasl2} \
+ --with-saslauthd=/var/lib/sasl2
%{__make}
+%{__make} -C saslauthd testsaslauthd
+%{__make} -C saslauthd saslcache
+
+cd doc
+RFCLIST=`grep 'rfc.\+\.txt' rfc-compliance`
+for i in $RFCLIST; do
+ RFCDIR=../RFC/text/`echo $i | sed -e 's:^rfc::' -e 's:..\.txt$::' `00
+ echo -e ',s:'$i':'$RFCDIR/$i'\n,w\nq' | ed index.html
+done
+
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/var/lib/sasl2,%{_sysconfdir},/etc/{rc.d/init.d,sysconfig,pam.d}} \
+install -d $RPM_BUILD_ROOT{/var/lib/sasl2,%{_sysconfdir},/etc/{rc.d/init.d,sysconfig}} \
$RPM_BUILD_ROOT%{_mandir}/man8
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
+
+%{__make} install \
+ sasldir=%{_libdir}/sasl2 \
+ DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_mandir}/cat*
-rm -f $RPM_BUILD_ROOT%{_libdir}/sasl2/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/sasl2/*.{la,a}
install {utils,saslauthd}/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/saslauthd
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/saslauthd
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/cyrus
+install %{SOURCE3} ./cyrus.pam
+
+install saslauthd/{testsaslauthd,saslcache} $RPM_BUILD_ROOT%{_sbindir}
%clean
rm -rf $RPM_BUILD_ROOT
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+echo "Remember to install appropriate plugins, or you won't have any mechs available."
+
%postun -p /sbin/ldconfig
%post saslauthd
%files
%defattr(644,root,root,755)
%doc AUTHORS COPYING ChangeLog NEWS README
-%doc doc/{ONEWS,TODO,*.txt,*.html,*.fig}
+%doc doc/{ONEWS,TODO,*.txt,*.html,*.fig,rfc-compliance}
%dir %{_sysconfdir}
%dir %{_libdir}/sasl2
%dir /var/lib/sasl2
%files static
%defattr(644,root,root,755)
%{_libdir}/lib*.a
-%{_libdir}/sasl2/lib*.a
%files anonymous
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/sasl2/libanonymous.so*
+%if %{with gssapi}
+%files gssapi
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/sasl2/libgssapiv2.so*
+%endif
+
%files cram-md5
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/sasl2/libcrammd5.so*
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/sasl2/libsasldb.so*
+%if %{with mysql}
%files mysql
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/sasl2/libmysql*.so*
+%attr(755,root,root) %{_libdir}/sasl2/libsql*.so*
+%endif
+
+%if %{with pgsql}
+%files pgsql
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/sasl2/libsql*.so*
+%endif
-%if %{?_with_srp:1}%{?!_with_srp:0}
+%if %{with srp}
%files srp
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/sasl2/libsrp.so*
%endif
-%if %{?_with_x509:1}%{?!_with_x509:0}
+%if %{with x509}
%files x509
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/sasl2/libx509.so*
%endif
-%if %{?_with_pwcheck:1}%{?!_with_pwcheck:0}
+%if %{with pwcheck}
%files pwcheck
%defattr(644,root,root,755)
%attr(755,root,root) %{_sbindir}/pwcheck
%files saslauthd
%defattr(644,root,root,755)
+%doc cyrus.pam
%attr(755,root,root) %{_sbindir}/saslauthd
+%attr(755,root,root) %{_sbindir}/testsaslauthd
+%attr(755,root,root) %{_sbindir}/saslcache
%attr(754,root,root) /etc/rc.d/init.d/saslauthd
%config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/saslauthd
-%config(noreplace) %verify(not mtime md5 size) /etc/pam.d/cyrus
%{_mandir}/man8/saslauthd.*