diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index da256de1d0b4c03849166e3b8f3c1fdc4b773230..bc24fa26d9c606577f160025c0efe8fe0fbb663c 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -1,39 +1,52 @@ -%define anolis_release 5 +%define anolis_release 6 %global username saslauth %global bootstrap_cyrus_sasl 0 -Summary: The Cyrus SASL library Name: cyrus-sasl Version: 2.1.28 Release: %{anolis_release}%{?dist} +Summary: The Cyrus SASL library License: BSD with advertising URL: https://www.cyrusimap.org/sasl/ -Source0: https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-%{version}/cyrus-sasl-%{version}.tar.gz +Source0: https://github.com/cyrusimap/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz Source3: saslauth.sysusers Source5: saslauthd.service Source7: sasl-mechlist.c Source9: saslauthd.sysconfig -# From upstream git, required for reconfigure after applying patches to configure.ac -# https://raw.githubusercontent.com/cyrusimap/cyrus-sasl/master/autogen.sh Source11: autogen.sh + + + +BuildRequires: make, autoconf, automake, libtool, gdbm-devel, groff +BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig +BuildRequires: mariadb-connector-c-devel, libpq-devel, zlib-devel +%if ! %{bootstrap_cyrus_sasl} +BuildRequires: openldap-devel +%endif +BuildRequires: nss_wrapper socket_wrapper krb5-server + +Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd +Requires(postun): /usr/sbin/userdel /usr/sbin/groupdel +Requires: /sbin/nologin Requires: %{name}-lib = %{version}-%{release} + +Provides: user(%username) +Provides: group(%username) + Patch11: cyrus-sasl-2.1.25-no_rpath.patch Patch15: cyrus-sasl-2.1.20-saslauthd.conf-path.patch Patch23: cyrus-sasl-2.1.23-man.patch Patch24: cyrus-sasl-2.1.21-sizes.patch -# The 64 bit *INT8 type is not used anywhere and other types match Patch49: cyrus-sasl-2.1.26-md5global.patch Patch101: cyrus-sasl-2.1.27-Add-basic-test-infrastructure.patch Patch102: cyrus-sasl-2.1.27-Add-Channel-Binding-support-for-GSSAPI-GSS-SPNEGO.patch -#https://github.com/simo5/cyrus-sasl/commit/ebd2387f06c84c7f9aac3167ec041bb01e5c6e48 Patch106: cyrus-sasl-2.1.27-nostrncpy.patch -# Upstream PR: https://github.com/cyrusimap/cyrus-sasl/pull/635 Patch107: cyrus-sasl-2.1.27-more-tests.patch Patch108: cyrus-sasl-2.1.27-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO.patch Patch500: cyrus-sasl-2.1.27-coverity.patch @@ -41,130 +54,114 @@ Patch501: cyrus-sasl-2.1.27-cumulative-digestmd5.patch Patch502: cyrus-sasl-2.1.27-cumulative-ossl3.patch -BuildRequires: autoconf, automake, libtool, gdbm-devel, groff -BuildRequires: krb5-devel >= 1.2.2, openssl-devel, pam-devel, pkgconfig -BuildRequires: mariadb-connector-c-devel, libpq-devel, zlib-devel -%if ! %{bootstrap_cyrus_sasl} -BuildRequires: openldap-devel -%endif -BuildRequires: python3 nss_wrapper socket_wrapper krb5-server -BuildRequires: make -Requires(pre): /usr/sbin/useradd /usr/sbin/groupadd -Requires(postun): /usr/sbin/userdel /usr/sbin/groupdel -Requires: /sbin/nologin -Provides: user(%username) -Provides: group(%username) - - %description +Simple Authentication and Security Layer (SASL) is a specification +that describes how authentication mechanisms can be plugged into an +application protocol on the wire. Cyrus SASL is an implementation of +SASL that makes it easy for application developers to integrate +authentication mechanisms into their application in a generic way. + The %{name} package contains the Cyrus implementation of SASL. SASL is the Simple Authentication and Security Layer, a method for adding authentication support to connection-based protocols. %package lib -Summary: Shared libraries needed by applications which use Cyrus SASL +Summary: Shared libraries needed by applications which use %{name} %description lib The %{name}-lib package contains shared libraries which are needed by -applications which use the Cyrus SASL library. - -%package devel -Requires: %{name}-lib = %{version}-%{release} -Requires: %{name} = %{version}-%{release} -Summary: Files needed for developing applications with Cyrus SASL - -%description devel -The %{name}-devel package contains files needed for developing and -compiling applications which use the Cyrus SASL library. +applications which use the %{name} library. %package gssapi +Summary: GSSAPI authentication support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: GSSAPI authentication support for Cyrus SASL %description gssapi -The %{name}-gssapi package contains the Cyrus SASL plugins which +The %{name}-gssapi package contains the %{name} plugins which support GSSAPI authentication. GSSAPI is commonly used for Kerberos authentication. %package plain +Summary: PLAIN and LOGIN authentication support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: PLAIN and LOGIN authentication support for Cyrus SASL %description plain -The %{name}-plain package contains the Cyrus SASL plugins which support +The %{name}-plain package contains the %{name} plugins which support PLAIN and LOGIN authentication schemes. %package md5 +Summary: CRAM-MD5 and DIGEST-MD5 authentication support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: CRAM-MD5 and DIGEST-MD5 authentication support for Cyrus SASL %description md5 -The %{name}-md5 package contains the Cyrus SASL plugins which support +The %{name}-md5 package contains the %{name} plugins which support CRAM-MD5 and DIGEST-MD5 authentication schemes. %package ntlm +Summary: NTLM authentication support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: NTLM authentication support for Cyrus SASL %description ntlm -The %{name}-ntlm package contains the Cyrus SASL plugin which supports +The %{name}-ntlm package contains the %{name} plugin which supports the NTLM authentication scheme. -# This would more appropriately be named cyrus-sasl-auxprop-sql. %package sql +Summary: SQL auxprop support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: SQL auxprop support for Cyrus SASL %description sql -The %{name}-sql package contains the Cyrus SASL plugin which supports +The %{name}-sql package contains the %{name} plugin which supports using a RDBMS for storing shared secrets. %if ! %{bootstrap_cyrus_sasl} -# This was *almost* named cyrus-sasl-auxprop-ldapdb, but that's a lot of typing. %package ldap +Summary: LDAP auxprop support for %{name} Requires: %{name}-lib = %{version}-%{release} -Summary: LDAP auxprop support for Cyrus SASL %description ldap -The %{name}-ldap package contains the Cyrus SASL plugin which supports using +The %{name}-ldap package contains the %{name} plugin which supports using a directory server, accessed using LDAP, for storing shared secrets. %endif %package scram Requires: %{name}-lib = %{version}-%{release} -Summary: SCRAM auxprop support for Cyrus SASL +Summary: SCRAM auxprop support for %{name} %description scram -The %{name}-scram package contains the Cyrus SASL plugin which supports +The %{name}-scram package contains the %{name} plugin which supports the SCRAM authentication scheme. %package gs2 Requires: %{name}-lib = %{version}-%{release} -Summary: GS2 support for Cyrus SASL +Summary: GS2 support for %{name} %description gs2 -The %{name}-gs2 package contains the Cyrus SASL plugin which supports +The %{name}-gs2 package contains the %{name} plugin which supports the GS2 authentication scheme. +%package devel +Summary: Files needed for developing applications with Cyrus SASL +Requires: %{name}-lib = %{version}-%{release} +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains files needed for developing and +compiling applications which use the Cyrus SASL library. + %package doc Summary: Documentation files for %{name} -Requires: %{name} = %{EVR} +Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc The %{name}-doc package contains documentation files for %{name}. -### - - %prep %autosetup -p1 -n cyrus-sasl-%{version} -# dlcompat may cause potential legal risks find %{_builddir}/%{name}-%{version} -maxdepth 1 -name 'dlcompat-*' -exec rm -rf {} \; %build -# reconfigure cp %{SOURCE11} ./ rm configure aclocal.m4 config/ltmain.sh Makefile.in export NOCONFIGURE=yes @@ -210,7 +207,6 @@ echo "$LDFLAGS" %make_build -C saslauthd testsaslauthd %make_build -C sample -# Build a small program to list the available mechanisms, because I need it. pushd lib ../libtool --mode=link %{__cc} -o sasl2-shared-mechlist -I../include $CFLAGS %{SOURCE7} $LDFLAGS ./libsasl2.la @@ -219,40 +215,32 @@ pushd lib %make_install %make_install -C plugins -install -m755 -d $RPM_BUILD_ROOT%{_bindir} +install -m755 -d %{buildroot}%{_bindir} ./libtool --mode=install \ -install -m755 sample/client $RPM_BUILD_ROOT%{_bindir}/sasl2-sample-client +install -m755 sample/client %{buildroot}%{_bindir}/sasl2-sample-client ./libtool --mode=install \ -install -m755 sample/server $RPM_BUILD_ROOT%{_bindir}/sasl2-sample-server +install -m755 sample/server %{buildroot}%{_bindir}/sasl2-sample-server ./libtool --mode=install \ -install -m755 saslauthd/testsaslauthd $RPM_BUILD_ROOT%{_sbindir}/testsaslauthd +install -m755 saslauthd/testsaslauthd %{buildroot}%{_sbindir}/testsaslauthd -# 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 -p saslauthd/saslauthd.mdoc $RPM_BUILD_ROOT%{_mandir}/man8/saslauthd.8 -install -m644 -p saslauthd/testsaslauthd.8 $RPM_BUILD_ROOT%{_mandir}/man8/testsaslauthd.8 +install -m755 -d %{buildroot}%{_mandir}/man8/ +install -m644 -p saslauthd/saslauthd.mdoc %{buildroot}%{_mandir}/man8/saslauthd.8 +install -m644 -p saslauthd/testsaslauthd.8 %{buildroot}%{_mandir}/man8/testsaslauthd.8 -# Install the systemd unit file for saslauthd and the config file. -install -d -m755 $RPM_BUILD_ROOT/%{_unitdir} $RPM_BUILD_ROOT/etc/sysconfig -install -m644 -p %{SOURCE5} $RPM_BUILD_ROOT/%{_unitdir}/saslauthd.service -install -m644 -p %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/saslauthd +install -d -m755 %{buildroot}/%{_unitdir} %{buildroot}/etc/sysconfig +install -m644 -p %{SOURCE5} %{buildroot}/%{_unitdir}/saslauthd.service +install -m644 -p %{SOURCE9} %{buildroot}/etc/sysconfig/saslauthd -# Install the config dirs if they're not already there. -install -m755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2 -install -m755 -d $RPM_BUILD_ROOT/%{_libdir}/sasl2 +install -m755 -d %{buildroot}/%{_sysconfdir}/sasl2 +install -m755 -d %{buildroot}/%{_libdir}/sasl2 -# Provide an easy way to query the list of available mechanisms. ./libtool --mode=install \ -install -m755 lib/sasl2-shared-mechlist $RPM_BUILD_ROOT/%{_sbindir}/ - -# Sysusers file +install -m755 lib/sasl2-shared-mechlist %{buildroot}/%{_sbindir}/ install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/cyrus-sasl.conf -# 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%{_mandir}/cat8/saslauthd.8 +rm -f %{buildroot}%{_libdir}/sasl2/libotp.* +rm -f %{buildroot}%{_libdir}/sasl2/*.a +rm -f %{buildroot}%{_mandir}/cat8/saslauthd.8 %check %make_build check @@ -331,6 +319,9 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/cat8/saslauthd.8 %doc README INSTALL.TXT ChangeLog AUTHORS %changelog +* Tue Apr 11 2023 Ziyang Zhang -2.1.28-6 +- Optimize spec file + * Sat Mar 4 2023 Funda Wang - 2.1.28-5 - Add various patches