Use %set_build_flags and pass all LDFLAGS to the build

This commit is contained in:
Timm Bäder 2021-11-19 16:02:05 +01:00
parent afd03d999e
commit 003c4a4cd6

View File

@ -29,7 +29,7 @@
Summary: A widely used Mail Transport Agent (MTA)
Name: sendmail
Version: 8.17.1
Release: 3%{?dist}
Release: 4%{?dist}
License: Sendmail
URL: http://www.sendmail.org/
@ -213,14 +213,15 @@ done
sed -i 's|/usr/local/bin/perl|%{_bindir}/perl|' contrib/*.pl
%build
%set_build_flags
# generate redhat config file
cat > redhat.config.m4 << EOF
define(\`confMAPDEF', \`-DNEWDB -DCDB %{?nis_cflags} -DMAP_REGEX -DSOCKETMAP -DNAMED_BIND=1')
define(\`confOPTIMIZE', \`\`\`\`${RPM_OPT_FLAGS}'''')
define(\`confOPTIMIZE', \`\`\`\`${CFLAGS}'''')
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 -DHASFLOCK')
define(\`confLIBDIRS', \`-L%{_prefix}/kerberos/%{_lib}')
define(\`confLIBS', \`%{?nis_ldadd} -lcrypt -ldb -lcdb -lresolv')
%{?_hardened_build:define(\`confLDOPTS', \`-Xlinker -z -Xlinker relro -Xlinker -z -Xlinker now')}
%{?_hardened_build:define(\`confLDOPTS', \`${LDFLAGS}')}
define(\`confMANOWN', \`root')
define(\`confMANGRP', \`root')
define(\`confMANMODE', \`644')
@ -230,7 +231,7 @@ define(\`confMAN8SRC', \`8')
define(\`confSTDIR', \`%{stdir}')
define(\`STATUS_FILE', \`%{stdir}/statistics')
define(\`confLIBSEARCH', \`db resolv 44bsd')
define(\`confCC', \`%{__cc}')
define(\`confCC', \`${CC}')
EOF
#'
@ -707,6 +708,9 @@ exit 0
%changelog
* Fri Nov 19 2021 Timm Bäder <tbaeder@redhat.com> - 8.17.1-4
- Use %%set_build_flags and pass all LDFLAGS to the build
* Fri Nov 12 2021 Björn Esser <besser82@fedoraproject.org> - 8.17.1-3
- Rebuild(libnsl2)