From 39fb928d58db7a4171f825a5367d8325e41bb7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 25 Mar 2021 20:51:58 +0100 Subject: [PATCH] Disable NIS support for RHEL9+ --- sendmail.spec | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sendmail.spec b/sendmail.spec index f7e5050..dee7b7c 100644 --- a/sendmail.spec +++ b/sendmail.spec @@ -3,6 +3,11 @@ %global with_sasl2 yes %global with_milter yes %global with_ldap yes +%if 0%{?rhel} < 9 +%global with_nis yes +%else +%global with_nis no +%endif %global enable_pie yes %global sendmailcf %{_datadir}/sendmail-cf @@ -16,10 +21,15 @@ # hardened build if not overridden %{!?_hardened_build:%global _hardened_build 1} +%if "%{with_nis}" == "yes" +%global nis_cflags -DNIS +%global nis_ldadd -lnsl +%endif + Summary: A widely used Mail Transport Agent (MTA) Name: sendmail Version: 8.16.1 -Release: 5%{?dist} +Release: 6%{?dist} License: Sendmail URL: http://www.sendmail.org/ @@ -87,7 +97,9 @@ Patch26: sendmail-8.16.1-libmilter-socket-activation.patch BuildRequires: make BuildRequires: libdb-devel +%if "%{with_nis}" == "yes" BuildRequires: libnsl2-devel +%endif BuildRequires: tinycdb-devel BuildRequires: groff BuildRequires: ghostscript @@ -203,11 +215,11 @@ sed -i 's|/usr/local/bin/perl|%{_bindir}/perl|' contrib/*.pl %build # generate redhat config file cat > redhat.config.m4 << EOF -define(\`confMAPDEF', \`-DNEWDB -DCDB -DNIS -DMAP_REGEX -DSOCKETMAP -DNAMED_BIND=1') +define(\`confMAPDEF', \`-DNEWDB -DCDB %{?nis_cflags} -DMAP_REGEX -DSOCKETMAP -DNAMED_BIND=1') define(\`confOPTIMIZE', \`\`\`\`${RPM_OPT_FLAGS}'''') define(\`confENVDEF', \`-I%{_includedir}/libdb -I%{_prefix}/kerberos/include -Wall -DXDEBUG=0 -DNETINET6 -DHES_GETMAILHOST -DUSE_VENDOR_CF_PATH=1 -D_FFR_LINUX_MHNL -D_FFR_QOS -D_FILE_OFFSET_BITS=64 -DHAS_GETHOSTBYNAME2') define(\`confLIBDIRS', \`-L%{_prefix}/kerberos/%{_lib}') -define(\`confLIBS', \`-lnsl -lcrypt -ldb -lcdb -lresolv') +define(\`confLIBS', \`%{?nis_ldadd} -lcrypt -ldb -lcdb -lresolv') %{?_hardened_build:define(\`confLDOPTS', \`-Xlinker -z -Xlinker relro -Xlinker -z -Xlinker now')} define(\`confMANOWN', \`root') define(\`confMANGRP', \`root') @@ -695,6 +707,9 @@ exit 0 %changelog +* Thu Mar 25 2021 Jaroslav Škarvada - 8.16.1-6 +- Disable NIS support for RHEL9+ + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 8.16.1-5 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583.