Disable NIS support for RHEL9+

This commit is contained in:
Jaroslav Škarvada 2021-03-25 20:51:58 +01:00
parent 566370c3be
commit 39fb928d58

View File

@ -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 <jskarvad@redhat.com> - 8.16.1-6
- Disable NIS support for RHEL9+
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 8.16.1-5
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.