From 75f7a79c0fc5b5789051ebb2da4fb1b2190fc477 Mon Sep 17 00:00:00 2001 From: wency_cn Date: Fri, 13 Feb 2026 19:22:33 +0800 Subject: [PATCH] Update code from upstream --- ...rhel-remove-version-mismatch-warning.patch | 16 ++++ postfix.spec | 95 +++++++++++++------ 2 files changed, 82 insertions(+), 29 deletions(-) create mode 100644 postfix-3.8.5-rhel-remove-version-mismatch-warning.patch diff --git a/postfix-3.8.5-rhel-remove-version-mismatch-warning.patch b/postfix-3.8.5-rhel-remove-version-mismatch-warning.patch new file mode 100644 index 0000000..7b472b8 --- /dev/null +++ b/postfix-3.8.5-rhel-remove-version-mismatch-warning.patch @@ -0,0 +1,16 @@ +diff --git a/src/tls/tls_misc.c b/src/tls/tls_misc.c +index b7acd1d..83f4d85 100644 +--- a/src/tls/tls_misc.c ++++ b/src/tls/tls_misc.c +@@ -1402,10 +1402,7 @@ void tls_check_version(void) + && (lib_info.micro < hdr_info.micro + || hdr_info.major == 0 + || (hdr_info.major == 1 && hdr_info.minor == 0)))) +- msg_warn("run-time library vs. compile-time header version mismatch: " +- "OpenSSL %d.%d.%d may not be compatible with OpenSSL %d.%d.%d", +- lib_info.major, lib_info.minor, lib_info.micro, +- hdr_info.major, hdr_info.minor, hdr_info.micro); ++ ; // Nothing. Warning output removed. + } + + /* tls_compile_version - compile-time OpenSSL version */ diff --git a/postfix.spec b/postfix.spec index f31ee31..7aa541e 100644 --- a/postfix.spec +++ b/postfix.spec @@ -1,4 +1,5 @@ -%define anolis_release 1 +ExclusiveArch: x86_64 aarch64 +%define anolis_release 3 # plugins have unresolvable symbols in compile time %undefine _strict_symbol_defs_build @@ -26,6 +27,12 @@ # hardened build if not overrided %{!?_hardened_build:%global _hardened_build 1} +%if 0%{?rhel} < 10 +%bcond_without db +%else +%bcond_with db +%endif + # Postfix requires one exlusive uid/gid and a 2nd exclusive gid for its own # use. Let me know if the second gid collides with another package. # Be careful: Redhat's 'mail' user & group isn't unique! @@ -106,18 +113,30 @@ Patch11: postfix-3.4.4-chroot-example-fix.patch # rhbz#1931403, sent upstream Patch13: pflogsumm-1.1.5-syslog-name-underscore-fix.patch Patch14: postfix-3.8.5-openssl-no-engine.patch +Patch15: postfix-3.8.5-rhel-remove-version-mismatch-warning.patch # Optional patches - set the appropriate environment variables to include # them when building the package/spec file # Determine the different packages required for building postfix -BuildRequires: make systemd-rpm-macros sed -BuildRequires: libdb-devel, perl-generators, pkgconfig, zlib-devel -BuildRequires: systemd-units, libicu-devel -BuildRequires: gcc, m4, findutils +BuildRequires: make +BuildRequires: perl-generators +BuildRequires: pkgconfig +BuildRequires: zlib-devel +BuildRequires: systemd-units +BuildRequires: libicu-devel +BuildRequires: gcc +BuildRequires: m4 +BuildRequires: findutils +BuildRequires: systemd-rpm-macros +BuildRequires: sed +%if 0%{?rhel} < 9 +BuildRequires: libnsl2-devel +%endif %{?with_db:BuildRequires: libdb-devel} +%{?with_db:BuildRequires: libnsl2-devel} %{?with_ldap:BuildRequires: openldap-devel} %{?with_lmdb:BuildRequires: lmdb-devel} %{?with_sasl:BuildRequires: cyrus-sasl-devel} @@ -129,7 +148,7 @@ BuildRequires: gcc, m4, findutils %{?with_tls:BuildRequires: openssl-devel} %if 0%{?defmap_lmdb} -Requires: %{name}-lmdb = %{EVR} +Requires: %{name}-lmdb%{?_isa} = %{epoch}:%{version}-%{release} %endif %description @@ -228,10 +247,10 @@ maps with Postfix, you need this. %prep %setup -q # Apply obligatory patches -%patch1 -p1 -b .config -%patch2 -p1 -b .files -%patch3 -p1 -b .alternatives -%patch4 -p1 -b .large-fs +%patch 1 -p1 -b .config +%patch 2 -p1 -b .files +%patch 3 -p1 -b .alternatives +%patch 4 -p1 -b .large-fs # Change DEF_SHLIB_DIR according to build host sed -i \ @@ -241,13 +260,15 @@ src/global/mail_params.h %if %{with pflogsumm} gzip -dc %{SOURCE53} | tar xf - pushd pflogsumm-%{pflogsumm_ver} -%patch9 -p1 -b .datecalc -%patch10 -p1 -b .ipv6-warnings-fix +%patch 9 -p1 -b .datecalc +%patch 10 -p1 -b .ipv6-warnings-fix popd %endif -%patch11 -p1 -b .chroot-example-fix -%patch13 -p1 -b .pflogsumm-1.1.5-syslog-name-underscore-fix -%patch14 -p1 -b .openssl-no-engine +%patch 11 -p1 -b .chroot-example-fix +%patch 13 -p1 -b .pflogsumm-1.1.5-syslog-name-underscore-fix +%patch 14 -p1 -b .openssl-no-engine +%patch 15 -p1 -b .remove-version-mismatch-warning +%patch15 -p1 -b .remove-version-mismatch-warning # Backport 3.8-20221006 fix for uname -r detection sed -i makedefs -e '\@Linux\.@s|345|3456|' @@ -270,7 +291,11 @@ done %set_build_flags unset AUXLIBS AUXLIBS_LDAP AUXLIBS_LMDB AUXLIBS_PCRE AUXLIBS_MYSQL AUXLIBS_PGSQL AUXLIBS_SQLITE AUXLIBS_CDB CCARGS="-fPIC -fcommon" +%if 0%{?rhel} >= 9 AUXLIBS="" +%else +AUXLIBS="-lnsl" +%endif %if %{without db} CCARGS="${CCARGS} -DNO_DB" @@ -280,6 +305,9 @@ AUXLIBS="" CCARGS="${CCARGS} -DHAS_LDAP -DLDAP_DEPRECATED=1 %{?with_sasl:-DUSE_LDAP_SASL}" AUXLIBS_LDAP="-lldap -llber" %endif +%ifarch s390 s390x ppc +CCARGS="${CCARGS} -fsigned-char" +%endif %if %{with lmdb} CCARGS="${CCARGS} -DHAS_LMDB" AUXLIBS_LMDB="-llmdb" @@ -321,10 +349,15 @@ AUXLIBS="" %if ! %{with ipv6} CCARGS="${CCARGS} -DNO_IPV6" %endif +%if ! %{with ipv6} + CCARGS="${CCARGS} -DNO_IPV6" +%endif CCARGS="${CCARGS} -DDEF_CONFIG_DIR=\\\"%{postfix_config_dir}\\\"" CCARGS="${CCARGS} $(getconf LFS_CFLAGS)" -CCARGS="${CCARGS} -DNO_NIS" +%if 0%{?rhel} >= 9 + CCARGS="${CCARGS} -DNO_NIS" +%endif LDFLAGS="$LDFLAGS %{?_hardened_build:-Wl,-z,relro,-z,now}" # SHLIB_RPATH is needed to find private libraries @@ -489,11 +522,11 @@ popd readme_directory=%{postfix_readme_dir} &> /dev/null ALTERNATIVES_DOCS="" -[ "%%{_excludedocs}" = 1 ] || ALTERNATIVES_DOCS='--slave %{_mandir}/man1/mailq.1%{_extension} mta-mailqman %{_mandir}/man1/mailq.postfix.1%{_extension} - --slave %{_mandir}/man1/newaliases.1%{_extension} mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1%{_extension} - --slave %{_mandir}/man8/sendmail.8%{_extension} mta-sendmailman %{_mandir}/man1/sendmail.postfix.1%{_extension} - --slave %{_mandir}/man5/aliases.5%{_extension} mta-aliasesman %{_mandir}/man5/aliases.postfix.5%{_extension} - --slave %{_mandir}/man8/smtpd.8%{_extension} mta-smtpdman %{_mandir}/man8/smtpd.postfix.8%{_extension}' +[ "%%{_excludedocs}" = 1 ] || ALTERNATIVES_DOCS='--slave %{_mandir}/man1/mailq.1.gz mta-mailqman %{_mandir}/man1/mailq.postfix.1.gz + --slave %{_mandir}/man1/newaliases.1.gz mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1.gz + --slave %{_mandir}/man8/sendmail.8.gz mta-sendmailman %{_mandir}/man1/sendmail.postfix.1.gz + --slave %{_mandir}/man5/aliases.5.gz mta-aliasesman %{_mandir}/man5/aliases.postfix.5.gz + --slave %{_mandir}/man8/smtpd.8.gz mta-smtpdman %{_mandir}/man8/smtpd.postfix.8.gz' %{_sbindir}/alternatives --install %{postfix_command_dir}/sendmail mta %{postfix_command_dir}/sendmail.postfix 60 \ --slave %{_bindir}/mailq mta-mailq %{_bindir}/mailq.postfix \ @@ -539,8 +572,8 @@ exit 0 # hack, to turn man8/smtpd.8.gz into alternatives symlink (part of the rhbz#1051180 fix) # this could be probably dropped in f23+ -if [ -e %{_mandir}/man8/smtpd.8%{_extension} ]; then - [ -h %{_mandir}/man8/smtpd.8%{_extension} ] || rm -f %{_mandir}/man8/smtpd.8%{_extension} +if [ -e %{_mandir}/man8/smtpd.8.gz ]; then + [ -h %{_mandir}/man8/smtpd.8.gz ] || rm -f %{_mandir}/man8/smtpd.8.gz fi exit 0 @@ -688,11 +721,11 @@ exit 0 %ghost %{_sysconfdir}/pam.d/smtp -%ghost %{_mandir}/man1/mailq.1.* -%ghost %{_mandir}/man1/newaliases.1.* -%ghost %{_mandir}/man5/aliases.5.* -%ghost %{_mandir}/man8/sendmail.8.* -%ghost %{_mandir}/man8/smtpd.8.* +%ghost %{_mandir}/man1/mailq.1.gz +%ghost %{_mandir}/man1/newaliases.1.gz +%ghost %{_mandir}/man5/aliases.5.gz +%ghost %{_mandir}/man8/sendmail.8.gz +%ghost %{_mandir}/man8/smtpd.8.gz %ghost %attr(0755, root, root) %{_bindir}/mailq %ghost %attr(0755, root, root) %{_bindir}/newaliases @@ -709,7 +742,7 @@ exit 0 %attr(0644, root, root) %{_mandir}/man1/qshape* %if %{with pflogsumm} %doc %{postfix_doc_dir}/pflogsumm-faq.txt -%attr(0644, root, root) %{_mandir}/man1/pflogsumm.1%{_extension} +%attr(0644, root, root) %{_mandir}/man1/pflogsumm.1* %attr(0755, root, root) %{postfix_command_dir}/pflogsumm %endif @@ -777,6 +810,10 @@ exit 0 %endif %changelog +* Tue Jan 06 2026 Fedor Vorobev - 2:3.8.5-2 +- Added a RHEL-specific patch to remove an OpenSSL version mismatch warning. + Resolves: RHEL-138726 + * Wed Mar 19 2025 happy_orange - 2:3.8.5-1 - update to 3.8.5 - Explicitly set default_database_type if lmdb map is used -- Gitee