Compare commits
10 Commits
4040cba77a
...
789e2291c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
789e2291c0 | ||
|
|
e61d81f92e | ||
|
|
ad75231efb | ||
|
|
03d8b2898c | ||
|
|
3a7f986927 | ||
|
|
56c4dc1780 | ||
|
|
8e9a713d76 | ||
|
|
8424b7db08 | ||
|
|
e04d9e00bb | ||
|
|
c53027d693 |
34
postfix-use-lmdb-by-default-instead-of-libdb.patch
Normal file
34
postfix-use-lmdb-by-default-instead-of-libdb.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 771dfac772b6d4893b6043b70336fae46e60351f Mon Sep 17 00:00:00 2001
|
||||
From: eaglegai <eaglegai@163.com>
|
||||
Date: Mon, 24 May 2021 20:11:06 +0800
|
||||
Subject: [PATCH] use lmdb by default instead of libdb
|
||||
|
||||
---
|
||||
conf/main.cf | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/conf/main.cf b/conf/main.cf
|
||||
index 495e346..6d7b236 100644
|
||||
--- a/conf/main.cf
|
||||
+++ b/conf/main.cf
|
||||
@@ -402,7 +402,7 @@ unknown_local_recipient_reject_code = 550
|
||||
# "postfix reload" to eliminate the delay.
|
||||
#
|
||||
#alias_maps = dbm:/etc/aliases
|
||||
-alias_maps = hash:/etc/aliases
|
||||
+alias_maps = lmdb:/etc/aliases
|
||||
#alias_maps = hash:/etc/aliases, nis:mail.aliases
|
||||
#alias_maps = netinfo:/aliases
|
||||
|
||||
@@ -413,7 +413,7 @@ alias_maps = hash:/etc/aliases
|
||||
#
|
||||
#alias_database = dbm:/etc/aliases
|
||||
#alias_database = dbm:/etc/mail/aliases
|
||||
-alias_database = hash:/etc/aliases
|
||||
+alias_database = lmdb:/etc/aliases
|
||||
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
|
||||
|
||||
# ADDRESS EXTENSIONS (e.g., user+foo)
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
107
postfix.spec
107
postfix.spec
@ -23,7 +23,7 @@
|
||||
Name: postfix
|
||||
Summary: Postfix Mail Transport Agent
|
||||
Version: 3.3.1
|
||||
Release: 10
|
||||
Release: 15
|
||||
Epoch: 2
|
||||
URL: http://www.postfix.org
|
||||
License: (IBM and GPLv2+) or (EPL-2.0 and GPLv2+)
|
||||
@ -44,14 +44,16 @@ Patch9: pflogsumm-1.1.5-datecalc.patch
|
||||
Patch10: pflogsumm-1.1.5-ipv6-warnings-fix.patch
|
||||
|
||||
Patch6000: fix-postfix-build-failed.patch
|
||||
Patch9000: postfix-use-lmdb-by-default-instead-of-libdb.patch
|
||||
|
||||
BuildRequires: libdb-devel perl-generators pkgconfig zlib-devel systemd-units libicu-devel libnsl2-devel gcc m4 openldap-devel
|
||||
BuildRequires: lmdb-devel perl-generators pkgconfig zlib-devel systemd-units libicu-devel libnsl2-devel gcc m4 openldap-devel
|
||||
BuildRequires: cyrus-sasl-devel pcre-devel mariadb-connector-c-devel postgresql-devel sqlite-devel tinycdb-devel openssl-devel procps-ng
|
||||
BuildRequires: chrpath
|
||||
Requires(post): systemd-sysv %{_sbindir}/alternatives %{_bindir}/openssl
|
||||
Requires(pre): %{_sbindir}/groupadd %{_sbindir}/useradd
|
||||
Requires(preun): %{_sbindir}/alternatives
|
||||
%{?systemd_requires}
|
||||
Requires: diffutils
|
||||
Requires: diffutils %{name}-help
|
||||
|
||||
Provides: MTA smtpd smtpdaemon server(smtp)
|
||||
Provides: %{name}-mysql %{name}-sqlite %{name}-ldap %{name}-pcre
|
||||
@ -112,6 +114,7 @@ maps with Postfix, you need this.
|
||||
%patch4 -p1 -b .large-fs
|
||||
|
||||
%patch6000 -p1
|
||||
%patch9000 -p1
|
||||
|
||||
sed -i \
|
||||
's|^\(\s*#define\s\+DEF_SHLIB_DIR\s\+\)"/usr/lib/postfix"|\1"%{_libdir}/postfix"|' \
|
||||
@ -131,11 +134,13 @@ for f in README_FILES/TLS_{LEGACY_,}README TLS_ACKNOWLEDGEMENTS; do
|
||||
done
|
||||
|
||||
%build
|
||||
unset AUXLIBS AUXLIBS_LDAP AUXLIBS_PCRE AUXLIBS_MYSQL AUXLIBS_PGSQL AUXLIBS_SQLITE AUXLIBS_CDB
|
||||
unset AUXLIBS AUXLIBS_LDAP AUXLIBS_LMDB AUXLIBS_PCRE AUXLIBS_MYSQL AUXLIBS_PGSQL AUXLIBS_SQLITE AUXLIBS_CDB
|
||||
CCARGS="-fPIC"
|
||||
AUXLIBS="-lnsl"
|
||||
CCARGS="${CCARGS} -DHAS_LDAP -DLDAP_DEPRECATED=1 %{?with_sasl:-DUSE_LDAP_SASL}"
|
||||
AUXLIBS_LDAP="-lldap -llber"
|
||||
CCARGS="${CCARGS} -DHAS_LMDB"
|
||||
AUXLIBS_LMDB="-llmdb"
|
||||
CCARGS="${CCARGS} -DHAS_PCRE -I%{_includedir}/pcre"
|
||||
AUXLIBS_PCRE="-lpcre"
|
||||
CCARGS="${CCARGS} -DHAS_MYSQL -I%{_includedir}/mysql"
|
||||
@ -163,8 +168,8 @@ CCARGS="${CCARGS} $(getconf LFS_CFLAGS)"
|
||||
LDFLAGS="%{?__global_ldflags} %{?_hardened_build:-Wl,-z,relro,-z,now}"
|
||||
|
||||
make -f Makefile.init makefiles shared=yes dynamicmaps=yes \
|
||||
%{?_hardened_build:pie=yes} CCARGS="${CCARGS}" AUXLIBS="${AUXLIBS}" \
|
||||
AUXLIBS_LDAP="${AUXLIBS_LDAP}" AUXLIBS_PCRE="${AUXLIBS_PCRE}" \
|
||||
%{?_hardened_build:pie=yes} CCARGS="${CCARGS} -DNO_DB" AUXLIBS="${AUXLIBS}" \
|
||||
AUXLIBS_LDAP="${AUXLIBS_LDAP}" AUXLIBS_LMDB="${AUXLIBS_LMDB}" AUXLIBS_PCRE="${AUXLIBS_PCRE}" \
|
||||
AUXLIBS_MYSQL="${AUXLIBS_MYSQL}" AUXLIBS_PGSQL="${AUXLIBS_PGSQL}" \
|
||||
AUXLIBS_SQLITE="${AUXLIBS_SQLITE}" AUXLIBS_CDB="${AUXLIBS_CDB}"\
|
||||
DEBUG="" SHLIB_RPATH="-Wl,-rpath,%{postfix_shlib_dir} $LDFLAGS" \
|
||||
@ -268,6 +273,54 @@ do
|
||||
touch %{buildroot}$i
|
||||
done
|
||||
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/anvil
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/spawn
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/trivial-rewrite
|
||||
chrpath -d %{buildroot}%{_sbindir}/postlock
|
||||
chrpath -d %{buildroot}%{_sbindir}/postkick
|
||||
chrpath -d %{buildroot}%{_sbindir}/postfix
|
||||
chrpath -d %{buildroot}%{_sbindir}/postlog
|
||||
chrpath -d %{buildroot}%{_sbindir}/postdrop
|
||||
chrpath -d %{buildroot}%{_libdir}/postfix/*.so*
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/smtp
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/pipe
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/master
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/nqmgr
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/scache
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/cleanup
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/postscreen
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/error
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/proxymap
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/showq
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/qmgr
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/dnsblog
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/flush
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/local
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/verify
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/smtpd
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/qmqpd
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/virtual
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/lmtp
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/bounce
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/tlsmgr
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/oqmgr
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/pickup
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/discard
|
||||
chrpath -d %{buildroot}%{_libexecdir}/postfix/tlsproxy
|
||||
chrpath -d %{buildroot}%{_sbindir}/sendmail.postfix
|
||||
chrpath -d %{buildroot}%{_sbindir}/smtp-source
|
||||
chrpath -d %{buildroot}%{_sbindir}/postmap
|
||||
chrpath -d %{buildroot}%{_sbindir}/postalias
|
||||
chrpath -d %{buildroot}%{_sbindir}/postqueue
|
||||
chrpath -d %{buildroot}%{_sbindir}/postcat
|
||||
chrpath -d %{buildroot}%{_sbindir}/smtp-sink
|
||||
chrpath -d %{buildroot}%{_sbindir}/postconf
|
||||
chrpath -d %{buildroot}%{_sbindir}/postsuper
|
||||
chrpath -d %{buildroot}%{_sbindir}/postmulti
|
||||
|
||||
mkdir -p %{buildroot}/etc/ld.so.conf.d
|
||||
echo "%{_libdir}/postfix" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
|
||||
function split_file
|
||||
{
|
||||
grep "$1" "$3" >> "$3.d/$2" || :
|
||||
@ -275,7 +328,7 @@ function split_file
|
||||
}
|
||||
|
||||
pushd %{buildroot}%{postfix_config_dir}
|
||||
for map in mysql pgsql sqlite cdb ldap pcre; do
|
||||
for map in mysql pgsql sqlite cdb ldap lmdb pcre; do
|
||||
rm -f dynamicmaps.cf.d/"$map" "postfix-files.d/$map"
|
||||
split_file "^\s*$map\b" "$map" dynamicmaps.cf
|
||||
sed -i "s|postfix-$map\\.so|%{postfix_shlib_dir}/\\0|" "dynamicmaps.cf.d/$map"
|
||||
@ -288,6 +341,7 @@ popd
|
||||
|
||||
%post -e
|
||||
%systemd_post %{name}.service
|
||||
/sbin/ldconfig
|
||||
|
||||
%{_sbindir}/postfix set-permissions upgrade-configuration \
|
||||
daemon_directory=%{postfix_daemon_dir} \
|
||||
@ -330,7 +384,7 @@ if [ ! -f %{sslcert} ]; then
|
||||
FQDN=localhost.localdomain
|
||||
fi
|
||||
|
||||
%{_bindir}/openssl req -new -key %{sslkey} -x509 -sha256 -days 365 -set_serial $RANDOM -out %{sslcert} \
|
||||
%{_bindir}/openssl req -new -key %{sslkey} -x509 -sha256 -days 730 -set_serial $RANDOM -out %{sslcert} \
|
||||
-subj "/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=${FQDN}/emailAddress=root@${FQDN}"
|
||||
chmod 644 %{sslcert}
|
||||
fi
|
||||
@ -359,6 +413,7 @@ exit 0
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
/sbin/ldconfig
|
||||
|
||||
%post sysvinit
|
||||
/sbin/chkconfig --add postfix >/dev/null 2>&1 ||:
|
||||
@ -385,6 +440,7 @@ fi
|
||||
%defattr(-,root,root)
|
||||
%config(noreplace) %{sasl_config_dir}/smtpd.conf
|
||||
%config(noreplace) %{_sysconfdir}/pam.d/smtp.postfix
|
||||
%config(noreplace) /etc/ld.so.conf.d/*
|
||||
%{_unitdir}/postfix.service
|
||||
%{postfix_doc_dir}
|
||||
%dir %attr(0700,postfix,root) %{postfix_queue_dir}/active
|
||||
@ -450,6 +506,11 @@ fi
|
||||
%{_bindir}/rmail.postfix
|
||||
%{_sbindir}/sendmail.postfix
|
||||
/usr/lib/sendmail.postfix
|
||||
|
||||
%attr(0644, root, root) %{postfix_config_dir}/dynamicmaps.cf.d/lmdb
|
||||
%attr(0644, root, root) %{postfix_config_dir}/postfix-files.d/lmdb
|
||||
%attr(0755, root, root) %{postfix_shlib_dir}/postfix-lmdb.so
|
||||
|
||||
%ghost %{_sysconfdir}/pam.d/smtp
|
||||
%ghost %attr(0755, root, root) %{_bindir}/mailq
|
||||
%ghost %attr(0755, root, root) %{_bindir}/newaliases
|
||||
@ -505,6 +566,36 @@ fi
|
||||
%{postfix_doc_dir}/README_FILES/*
|
||||
|
||||
%changelog
|
||||
* Wed Jun 14 2023 zhouyihang <zhouyihang3@h-partners.com> - 2:3.3.1-15
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add require of help to fix empty symlink
|
||||
|
||||
* Fri Mar 10 2023 gaihuiying <eaglegai@163.com> - 2:3.3.1-14
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:modify Certificate validity period
|
||||
|
||||
* Fri Sep 16 2022 xingwei <xingwei14@h-partners.com> - 2:3.3.1-13
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:remove runpath of files
|
||||
|
||||
* Tue May 25 2021 gaihuiying <gaihuiying1@huawei.com> - 2:3.3.1-12
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:set lmdb database by default in main.cf
|
||||
|
||||
* Fri Jan 15 2021 gaihuiying <gaihuiying1@huawei.com> - 2:3.3.1-11
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:use lmdb instead of libdb
|
||||
|
||||
* Wed Dec 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 2:3.3.1-10
|
||||
- change permission of files
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user