From ad0f53d2bb127c32f22c6af4af21dc6faa407683 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Fri, 15 May 2026 10:40:10 +0800 Subject: postfix: upgrade 3.10.9 -> 3.11.2 * Refresh patch to mute patch-fuzz * Remove 0001-makedefs-Account-for-linux-7.x-version.patch * This upgrade include the following commit, which make postfix can compile on latest stable ubuntu 26.04, which have Linux 7.x kernel Postfix works on Linux 7.x kernels. Frank Scheiner. Files: makedefs, util/sys_defs.h. Changes: https://www.ftp.saix.net/MTA/postfix/official/postfix-3.11.2.HISTORY Signed-off-by: Changqing Li Signed-off-by: Khem Raj --- .../postfix/files/0001-Fix-makedefs.patch | 25 +- ...d-postconf-to-a-variable-for-cross-compil.patch | 9 +- ...se-native-compiler-to-build-makedefs.test.patch | 17 +- .../postfix/files/0004-Fix-icu-config.patch | 9 +- ...dd-lnsl-and-lresolv-to-SYSLIBS-by-default.patch | 11 +- .../recipes-daemons/postfix/postfix_3.10.9.bb | 252 --------------------- .../recipes-daemons/postfix/postfix_3.11.2.bb | 251 ++++++++++++++++++++ 7 files changed, 279 insertions(+), 295 deletions(-) delete mode 100644 meta-networking/recipes-daemons/postfix/postfix_3.10.9.bb create mode 100644 meta-networking/recipes-daemons/postfix/postfix_3.11.2.bb (limited to 'meta-networking') diff --git a/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch b/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch index 785fe87452..4e187849dc 100644 --- a/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch +++ b/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch @@ -1,4 +1,4 @@ -From e4197bc1f431fd7e555a31e6f7f1e020b4ec8f4c Mon Sep 17 00:00:00 2001 +From 51e29c0a1d98948118e5135bb817a96811105d39 Mon Sep 17 00:00:00 2001 From: Li xin Date: Fri, 19 Jun 2015 16:45:54 +0900 Subject: [PATCH] Fix makedefs @@ -19,10 +19,10 @@ Signed-off-by: Yao Zhao 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/makedefs b/makedefs -index a740e41..28fb128 100644 +index d5103ce..9713327 100644 --- a/makedefs +++ b/makedefs -@@ -230,9 +230,6 @@ echo "# pie=$pie" +@@ -232,9 +232,6 @@ echo "# pie=$pie" # Defaults for most sane systems @@ -32,7 +32,7 @@ index a740e41..28fb128 100644 ARFL=rv # Ugly function to make our error message more visible among the -@@ -563,12 +560,12 @@ case "$SYSTEM.$RELEASE" in +@@ -608,12 +605,12 @@ case "$SYSTEM.$RELEASE" in case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; @@ -48,8 +48,8 @@ index a740e41..28fb128 100644 else # No, we're not going to try db1 db2 db3 etc. # On a properly installed system, Postfix builds -@@ -577,12 +574,12 @@ case "$SYSTEM.$RELEASE" in - echo "Install the appropriate db*-devel package first." 1>&2 +@@ -623,12 +620,12 @@ case "$SYSTEM.$RELEASE" in + echo "Alternatively, build with CCARGS=\"-NO_DB ...\"" 1>&2 exit 1 fi - SYSLIBS="-ldb" @@ -63,7 +63,7 @@ index a740e41..28fb128 100644 do test -e $lib/lib$name.a -o -e $lib/lib$name.so && { SYSLIBS="$SYSLIBS -l$name" -@@ -602,7 +599,7 @@ case "$SYSTEM.$RELEASE" in +@@ -648,7 +645,7 @@ case "$SYSTEM.$RELEASE" in if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ] then : @@ -72,7 +72,7 @@ index a740e41..28fb128 100644 then echo CCARGS="$CCARGS -DNO_EPOLL" else -@@ -626,8 +623,6 @@ int main(int argc, char **argv) +@@ -672,8 +669,6 @@ int main(int argc, char **argv) } EOF ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1 @@ -81,7 +81,7 @@ index a740e41..28fb128 100644 rm -f makedefs.test makedefs.test.[co] fi;; esac -@@ -644,12 +639,12 @@ EOF +@@ -690,12 +685,12 @@ EOF case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; @@ -97,8 +97,8 @@ index a740e41..28fb128 100644 else # On a properly installed system, Postfix builds # by including and by linking with -ldb -@@ -657,12 +652,12 @@ EOF - echo "Install the appropriate db*-devel package first." 1>&2 +@@ -705,12 +700,12 @@ EOF + echo "See: https://www.postfix.org/NON_BERKELEYDB_README.html#build-conf" 1>&2 exit 1 fi - SYSLIBS="-ldb" @@ -112,6 +112,3 @@ index a740e41..28fb128 100644 do test -e $lib/lib$name.a -o -e $lib/lib$name.so && { SYSLIBS="$SYSLIBS -l$name" --- -2.25.1 - diff --git a/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch b/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch index d46efb95cb..a74c46fa92 100644 --- a/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch +++ b/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch @@ -1,4 +1,4 @@ -From 953719878466c55572294f42e85127bda5d34999 Mon Sep 17 00:00:00 2001 +From ce8deeaac8ca5d7329e1923790a1f35798953799 Mon Sep 17 00:00:00 2001 From: Li xin Date: Fri, 19 Jun 2015 17:14:58 +0900 Subject: [PATCH] Change fixed postconf to a variable for cross-compiling @@ -12,10 +12,10 @@ Signed-off-by: Yao Zhao 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in -index a37f89f..17cb64b 100644 +index 8d7501a..d2a85e8 100644 --- a/Makefile.in +++ b/Makefile.in -@@ -22,7 +22,7 @@ META = meta/main.cf.proto meta/master.cf.proto meta/postfix-files \ +@@ -23,7 +23,7 @@ META = meta/main.cf.proto meta/master.cf.proto meta/postfix-files \ EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \ -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);" SHLIB_DIR_OVERRIDE = \ @@ -102,6 +102,3 @@ index 563ee27..00d4651 100644 "daemon_directory = $daemon_directory" \ "data_directory = $data_directory" \ "command_directory = $command_directory" \ --- -2.25.1 - diff --git a/meta-networking/recipes-daemons/postfix/files/0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch b/meta-networking/recipes-daemons/postfix/files/0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch index 6f8e3e84da..201b4741de 100644 --- a/meta-networking/recipes-daemons/postfix/files/0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch +++ b/meta-networking/recipes-daemons/postfix/files/0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch @@ -1,4 +1,4 @@ -From a8ec63a71361ccd3f6d2959c4c87b7824282b291 Mon Sep 17 00:00:00 2001 +From fc51d9145210350577fdb29a9b0680df779ae347 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 26 Aug 2017 10:29:37 -0700 Subject: [PATCH] makedefs: Use native compiler to build makedefs.test @@ -13,10 +13,10 @@ Signed-off-by: Khem Raj 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/makedefs b/makedefs -index 28fb128..313b401 100644 +index 9713327..e879832 100644 --- a/makedefs +++ b/makedefs -@@ -622,7 +622,7 @@ int main(int argc, char **argv) +@@ -668,7 +668,7 @@ int main(int argc, char **argv) exit(0); } EOF @@ -25,7 +25,7 @@ index 28fb128..313b401 100644 rm -f makedefs.test makedefs.test.[co] fi;; esac -@@ -865,7 +865,7 @@ int main(int argc, char **argv) +@@ -914,7 +914,7 @@ int main(int argc, char **argv) exit(0); } EOF @@ -34,7 +34,7 @@ index 28fb128..313b401 100644 ./makedefs.test 2>/dev/null || CCARGS="$CCARGS -DNO_SIGSETJMP" rm -f makedefs.test makedefs.test.[co] -@@ -903,7 +903,7 @@ int main(int argc, char **argv) +@@ -952,7 +952,7 @@ int main(int argc, char **argv) &error) != 14); } EOF @@ -43,7 +43,7 @@ index 28fb128..313b401 100644 $icu_ldflags >/dev/null 2>&1 if ./makedefs.test 2>/dev/null ; then CCARGS="$CCARGS $icu_cppflags" -@@ -1024,7 +1024,7 @@ int main(void) +@@ -1088,7 +1088,7 @@ int main(void) exit(ferror(stdout) ? 1 : 0); } EOF @@ -52,7 +52,7 @@ index 28fb128..313b401 100644 ./makedefs.test || exit 1 rm -f makedefs.test makedefs.test.[co] } -@@ -1180,7 +1180,7 @@ int main(void) +@@ -1245,7 +1245,7 @@ int main(void) exit(ferror(stdout) ? 1 : 0); } EOF @@ -61,6 +61,3 @@ index 28fb128..313b401 100644 parm_val=`./makedefs.test` || exit 1 rm -f makedefs.test makedefs.test.[co] eval ${parm_name}=\""\$parm_val"\" --- -2.25.1 - diff --git a/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch b/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch index 0660ee098e..daf5c7089e 100644 --- a/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch +++ b/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch @@ -1,4 +1,4 @@ -From 404150f53bb49af987d7338a808f47fdbd50ba7f Mon Sep 17 00:00:00 2001 +From b63facf538af99e7c79ebee8d41abd52e7d5ee5e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 16 Jan 2022 11:21:54 +0800 Subject: [PATCH] Fix icu config @@ -18,10 +18,10 @@ Signed-off-by: Khem Raj 1 file changed, 1 deletion(-) diff --git a/makedefs b/makedefs -index 313b401..e5db212 100644 +index e879832..f9c132e 100644 --- a/makedefs +++ b/makedefs -@@ -906,7 +906,6 @@ EOF +@@ -955,7 +955,6 @@ EOF ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \ $icu_ldflags >/dev/null 2>&1 if ./makedefs.test 2>/dev/null ; then @@ -29,6 +29,3 @@ index 313b401..e5db212 100644 SYSLIBS="$SYSLIBS $icu_ldflags" else CCARGS="$CCARGS -DNO_EAI" --- -2.25.1 - diff --git a/meta-networking/recipes-daemons/postfix/files/0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch b/meta-networking/recipes-daemons/postfix/files/0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch index 1571aa844d..c2e640d6ff 100644 --- a/meta-networking/recipes-daemons/postfix/files/0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch +++ b/meta-networking/recipes-daemons/postfix/files/0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch @@ -1,4 +1,4 @@ -From 25e7d1a9bc64f39666eb0e2b9b175773615e28d2 Mon Sep 17 00:00:00 2001 +From fb5b16db0282b5d80edb0ccc6f0f197a7f663610 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 12 Oct 2018 12:38:02 +0800 Subject: [PATCH] makedefs: add -lnsl and -lresolv to SYSLIBS by default @@ -14,10 +14,10 @@ Signed-off-by: Yi Zhao 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/makedefs b/makedefs -index e5db212..b00049b 100644 +index f9c132e..5ebef5b 100644 --- a/makedefs +++ b/makedefs -@@ -577,16 +577,7 @@ case "$SYSTEM.$RELEASE" in +@@ -623,16 +623,7 @@ case "$SYSTEM.$RELEASE" in SYSLIBS="$SYSLIBS -ldb" ;; esac @@ -35,7 +35,7 @@ index e5db212..b00049b 100644 # Kernel 2.4 added IPv6 case "$RELEASE" in 2.[0-3].*) CCARGS="$CCARGS -DNO_IPV6";; -@@ -655,16 +646,7 @@ EOF +@@ -703,16 +694,7 @@ EOF SYSLIBS="$SYSLIBS -ldb" ;; esac @@ -53,6 +53,3 @@ index e5db212..b00049b 100644 SYSLIBS="$SYSLIBS -ldl" : ${SHLIB_SUFFIX=.so} : ${SHLIB_CFLAGS=-fPIC} --- -2.25.1 - diff --git a/meta-networking/recipes-daemons/postfix/postfix_3.10.9.bb b/meta-networking/recipes-daemons/postfix/postfix_3.10.9.bb deleted file mode 100644 index 633e4a7a0d..0000000000 --- a/meta-networking/recipes-daemons/postfix/postfix_3.10.9.bb +++ /dev/null @@ -1,252 +0,0 @@ -SUMMARY = "Postfix Mail Transport Agent" -DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \ -IBM research as an alternative to the widely-used Sendmail program. \ -Postfix attempts to be fast, easy to administer, and secure. The outsidei \ -has a definite Sendmail-ish flavor, but the inside is completely different." - -HOMEPAGE = "http://www.postfix.org" -SECTION = "mail" -DEPENDS = "db icu libpcre2 libnsl2 m4-native openssl postfix-native \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ -" - -LICENSE = "IPL-1.0 | EPL-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=b181651ad99a7dc4cc8c4ce2f491ed1a" - -SRC_URI = "http://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \ - file://main.cf \ - file://postfix \ - file://internal_recipient \ - file://postfix.service \ - file://aliasesdb \ - file://check_hostname.sh \ - file://0001-Fix-makedefs.patch \ - file://0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch \ - file://0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch \ - file://0004-Fix-icu-config.patch \ - file://0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \ - file://0001-makedefs-Account-for-linux-7.x-version.patch \ - file://0001-Fix-build-with-musl.patch \ - " - -SRC_URI[sha256sum] = "d4b4daab0af2e0c16c0d2d5ac3c7680d5ebd2001ea054f7f2a601c759801bc13" - -UPSTREAM_CHECK_URI = "https://www.postfix.org/announcements.html" -UPSTREAM_CHECK_REGEX = "postfix-(?P\d+(\.\d+)+)" - -S = "${UNPACKDIR}/postfix-${PV}" - -CLEANBROKEN = "1" - -BBCLASSEXTEND = "native" - -inherit pkgconfig update-rc.d useradd update-alternatives systemd lib_package - -INITSCRIPT_NAME = "postfix" -INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ." -USERADD_PACKAGES = "${PN}-bin" -USERADD_PARAM:${PN}-bin = \ -"-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \ - -d /var/spool/vmail -r -g vmail --shell /bin/false vmail \ -" -GROUPADD_PARAM:${PN}-bin = "--system postfix;--system postdrop;--system vmail" - -export SYSLIBS = "${LDFLAGS}" - -# CCARGS specifies includes, defines -# AUXLIBS specifies libraries -# Linux2/Linux3 has HAS_DB defined -# makedefs will make CC to be CC+CCARGS - -# ldap support -export CCARGS-ldap = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}" -export AUXLIBS-ldap = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}" - -# no native openldap -export CCARGS-ldap:class-native = "" -export AUXLIBS-ldap:class-native = "" - -export CCARGS-nonis:libc-musl = "-DNO_NIS" -export CCARGS-nonis = "" - -# SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH -# current openldap didn't enable SASL -export CCARGS-sasl = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${STAGING_INCDIR}/sasl', '', d)}" -export AUXLIBS-sasl = "\ - ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}" -export CCARGS-sasl:class-native = "" -export AUXLIBS-sasl:class-native = "" - -# PCRE, TLS support default -export CCARGS = "${CFLAGS} -DHAS_PCRE=2 -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}" -export AUXLIBS = "-lpcre2-8 -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" -export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" - -# OPT,DEBUG is aready in CFLAGS -# ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS -EXTRA_OEMAKE += "OPT= DEBUG= OPTS= " - -# use gnu17 for now as recommended in: -# https://marc.info/?l=postfix-users&m=173542420611213 -CFLAGS += "-std=gnu17" - -do_compile () { - unset CFLAGS CPPFLAGS CXXFLAGS - local native_build - - native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}" - - # if not native build, then pass SYSTEM and RELEASE to makedefs - if [ "${native_build}" != "1" ]; then - # uname -s for target - SYSTEM="Linux" - - # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6 - RELEASE="2.6.34" - sed -i -e \ - "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ - ${S}/Makefile.in - export BUILD_SYSROOT="${STAGING_DIR_HOST}" - else - # native build - export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" - fi - - oe_runmake makefiles - oe_runmake -} - -do_install:prepend:class-native() { - export POSTCONF="bin/postconf" -} - -SYSTEMD_SERVICE:${PN} = "postfix.service" - -do_install () { - sh ./postfix-install 'install_root=${D}' \ - 'config_directory=${sysconfdir}/postfix' \ - 'daemon_directory=${libexecdir}/postfix' \ - 'command_directory=${sbindir}' \ - 'queue_directory=${localstatedir}/spool/postfix' \ - 'sendmail_path=${sbindir}/sendmail.postfix' \ - 'newaliases_path=${bindir}/newaliases' \ - 'mailq_path=${bindir}/mailq' \ - 'manpage_directory=${mandir}' \ - 'readme_directory=${datadir}/doc/postfix' \ - 'data_directory=${localstatedir}/lib/postfix' \ - -non-interactive - rm -rf ${D}${localstatedir}/spool/postfix - mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/${MLPREFIX}sample-main.cf - install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/ - install -m 644 ${UNPACKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf - sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf - - install -m 755 ${UNPACKDIR}/check_hostname.sh ${D}${sbindir}/ - - install -m 644 ${UNPACKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient - - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then - install -d ${D}${sysconfdir}/init.d - install -m 755 ${UNPACKDIR}/postfix ${D}${sysconfdir}/init.d/postfix - fi - - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${UNPACKDIR}/postfix.service ${D}${systemd_unitdir}/system - sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/postfix.service - sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/postfix.service - sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/postfix.service - fi - - install -m 0755 ${UNPACKDIR}/aliasesdb ${D}${libexecdir}/postfix - - install -m 770 -d ${D}${localstatedir}/spool/postfix - chown postfix:postfix ${D}${localstatedir}/spool/postfix - - install -m 0755 -d ${D}${localstatedir}/lib/postfix - chown postfix:nogroup ${D}${localstatedir}/lib/postfix - install -m 0755 -d ${D}${localstatedir}/spool/postfix - chown root:postfix ${D}${localstatedir}/spool/postfix - install -m 0700 -d ${D}${localstatedir}/spool/postfix/active - chown postfix:root ${D}${localstatedir}/spool/postfix/active - install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce - chown postfix:root ${D}${localstatedir}/spool/postfix/bounce - install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt - chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt - install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer - chown postfix:root ${D}${localstatedir}/spool/postfix/defer - install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred - chown postfix:root ${D}${localstatedir}/spool/postfix/deferred - install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush - chown postfix:root ${D}${localstatedir}/spool/postfix/flush - install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold - chown postfix:root ${D}${localstatedir}/spool/postfix/hold - install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming - chown postfix:root ${D}${localstatedir}/spool/postfix/incoming - install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved - chown postfix:root ${D}${localstatedir}/spool/postfix/saved - install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace - chown postfix:root ${D}${localstatedir}/spool/postfix/trace - install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop - chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop - install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid - chown root:root ${D}${localstatedir}/spool/postfix/pid - install -m 0700 -d ${D}${localstatedir}/spool/postfix/private - chown postfix:root ${D}${localstatedir}/spool/postfix/private - install -m 0710 -d ${D}${localstatedir}/spool/postfix/public - chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public - install -m 0755 -d ${D}${localstatedir}/spool/vmail - chown vmail:vmail ${D}${localstatedir}/spool/vmail - - chown :postdrop ${D}${sbindir}/postqueue - chown :postdrop ${D}${sbindir}/postdrop - chmod g+s ${D}${sbindir}/postqueue - chmod g+s ${D}${sbindir}/postdrop - - rm -rf ${D}/etc/postfix/makedefs.out -} - -do_install:append:class-native() { - ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases - ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq -} - -ALTERNATIVE:${PN}-bin = "sendmail mailq newaliases" -# /usr/lib/sendmial is required by LSB core test -ALTERNATIVE:${PN}-bin:linuxstdbase = "sendmail mailq newaliases usr-lib-sendmail" -ALTERNATIVE_TARGET[mailq] = "${bindir}/mailq" -ALTERNATIVE_TARGET[newaliases] = "${bindir}/newaliases" -ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix" -ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" -ALTERNATIVE_TARGET[usr-lib-sendmail] = "${sbindir}/sendmail.postfix" -ALTERNATIVE_LINK_NAME[usr-lib-sendmail] = "/usr/lib/sendmail" - -ALTERNATIVE_PRIORITY = "120" - -ALTERNATIVE:${PN}-doc += "mailq.1 newaliases.1 sendmail.1" -ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1" -ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1" -ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1" - -pkg_postinst_ontarget:${PN}-cfg () { - touch /etc/aliases - newaliases - - # generate virtual_alias, default is hash - touch /etc/postfix/virtual_alias - postmap /etc/postfix/virtual_alias -} - -PACKAGES =+ "${PN}-cfg" -RDEPENDS:${PN}-cfg:append:class-target = " ${PN}-bin" -RDEPENDS:${PN}:append:class-target = " ${PN}-cfg" -# Exclude .debug directories from the main package -FILES:${PN}-bin += "${localstatedir} ${bindir}/* ${sbindir}/* \ - ${libexecdir}/* ${systemd_unitdir}/*" -FILES:${PN}-cfg = "${sysconfdir}" -FILES:${PN}-dbg += "${libexecdir}/postfix/.debug" -ALLOW_EMPTY:${PN} = "1" diff --git a/meta-networking/recipes-daemons/postfix/postfix_3.11.2.bb b/meta-networking/recipes-daemons/postfix/postfix_3.11.2.bb new file mode 100644 index 0000000000..894e58261b --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/postfix_3.11.2.bb @@ -0,0 +1,251 @@ +SUMMARY = "Postfix Mail Transport Agent" +DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \ +IBM research as an alternative to the widely-used Sendmail program. \ +Postfix attempts to be fast, easy to administer, and secure. The outsidei \ +has a definite Sendmail-ish flavor, but the inside is completely different." + +HOMEPAGE = "http://www.postfix.org" +SECTION = "mail" +DEPENDS = "db icu libpcre2 libnsl2 m4-native openssl postfix-native \ + ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ +" + +LICENSE = "IPL-1.0 | EPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b181651ad99a7dc4cc8c4ce2f491ed1a" + +SRC_URI = "http://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \ + file://main.cf \ + file://postfix \ + file://internal_recipient \ + file://postfix.service \ + file://aliasesdb \ + file://check_hostname.sh \ + file://0001-Fix-makedefs.patch \ + file://0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch \ + file://0003-makedefs-Use-native-compiler-to-build-makedefs.test.patch \ + file://0004-Fix-icu-config.patch \ + file://0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \ + file://0001-Fix-build-with-musl.patch \ + " + +SRC_URI[sha256sum] = "daed65b08c9288cdb386a914f3e52cdddd44935407b5ce5aee8bcc3aa4207778" + +UPSTREAM_CHECK_URI = "https://www.postfix.org/announcements.html" +UPSTREAM_CHECK_REGEX = "postfix-(?P\d+(\.\d+)+)" + +S = "${UNPACKDIR}/postfix-${PV}" + +CLEANBROKEN = "1" + +BBCLASSEXTEND = "native" + +inherit pkgconfig update-rc.d useradd update-alternatives systemd lib_package + +INITSCRIPT_NAME = "postfix" +INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ." +USERADD_PACKAGES = "${PN}-bin" +USERADD_PARAM:${PN}-bin = \ +"-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \ + -d /var/spool/vmail -r -g vmail --shell /bin/false vmail \ +" +GROUPADD_PARAM:${PN}-bin = "--system postfix;--system postdrop;--system vmail" + +export SYSLIBS = "${LDFLAGS}" + +# CCARGS specifies includes, defines +# AUXLIBS specifies libraries +# Linux2/Linux3 has HAS_DB defined +# makedefs will make CC to be CC+CCARGS + +# ldap support +export CCARGS-ldap = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}" +export AUXLIBS-ldap = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}" + +# no native openldap +export CCARGS-ldap:class-native = "" +export AUXLIBS-ldap:class-native = "" + +export CCARGS-nonis:libc-musl = "-DNO_NIS" +export CCARGS-nonis = "" + +# SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH +# current openldap didn't enable SASL +export CCARGS-sasl = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${STAGING_INCDIR}/sasl', '', d)}" +export AUXLIBS-sasl = "\ + ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}" +export CCARGS-sasl:class-native = "" +export AUXLIBS-sasl:class-native = "" + +# PCRE, TLS support default +export CCARGS = "${CFLAGS} -DHAS_PCRE=2 -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}" +export AUXLIBS = "-lpcre2-8 -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" +export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" + +# OPT,DEBUG is aready in CFLAGS +# ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS +EXTRA_OEMAKE += "OPT= DEBUG= OPTS= " + +# use gnu17 for now as recommended in: +# https://marc.info/?l=postfix-users&m=173542420611213 +CFLAGS += "-std=gnu17" + +do_compile () { + unset CFLAGS CPPFLAGS CXXFLAGS + local native_build + + native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}" + + # if not native build, then pass SYSTEM and RELEASE to makedefs + if [ "${native_build}" != "1" ]; then + # uname -s for target + SYSTEM="Linux" + + # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6 + RELEASE="2.6.34" + sed -i -e \ + "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ + ${S}/Makefile.in + export BUILD_SYSROOT="${STAGING_DIR_HOST}" + else + # native build + export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" + fi + + oe_runmake makefiles + oe_runmake +} + +do_install:prepend:class-native() { + export POSTCONF="bin/postconf" +} + +SYSTEMD_SERVICE:${PN} = "postfix.service" + +do_install () { + sh ./postfix-install 'install_root=${D}' \ + 'config_directory=${sysconfdir}/postfix' \ + 'daemon_directory=${libexecdir}/postfix' \ + 'command_directory=${sbindir}' \ + 'queue_directory=${localstatedir}/spool/postfix' \ + 'sendmail_path=${sbindir}/sendmail.postfix' \ + 'newaliases_path=${bindir}/newaliases' \ + 'mailq_path=${bindir}/mailq' \ + 'manpage_directory=${mandir}' \ + 'readme_directory=${datadir}/doc/postfix' \ + 'data_directory=${localstatedir}/lib/postfix' \ + -non-interactive + rm -rf ${D}${localstatedir}/spool/postfix + mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/${MLPREFIX}sample-main.cf + install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/ + install -m 644 ${UNPACKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf + sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf + + install -m 755 ${UNPACKDIR}/check_hostname.sh ${D}${sbindir}/ + + install -m 644 ${UNPACKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient + + if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 755 ${UNPACKDIR}/postfix ${D}${sysconfdir}/init.d/postfix + fi + + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${UNPACKDIR}/postfix.service ${D}${systemd_unitdir}/system + sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/postfix.service + sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/postfix.service + sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/postfix.service + fi + + install -m 0755 ${UNPACKDIR}/aliasesdb ${D}${libexecdir}/postfix + + install -m 770 -d ${D}${localstatedir}/spool/postfix + chown postfix:postfix ${D}${localstatedir}/spool/postfix + + install -m 0755 -d ${D}${localstatedir}/lib/postfix + chown postfix:nogroup ${D}${localstatedir}/lib/postfix + install -m 0755 -d ${D}${localstatedir}/spool/postfix + chown root:postfix ${D}${localstatedir}/spool/postfix + install -m 0700 -d ${D}${localstatedir}/spool/postfix/active + chown postfix:root ${D}${localstatedir}/spool/postfix/active + install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce + chown postfix:root ${D}${localstatedir}/spool/postfix/bounce + install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt + chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt + install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer + chown postfix:root ${D}${localstatedir}/spool/postfix/defer + install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred + chown postfix:root ${D}${localstatedir}/spool/postfix/deferred + install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush + chown postfix:root ${D}${localstatedir}/spool/postfix/flush + install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold + chown postfix:root ${D}${localstatedir}/spool/postfix/hold + install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming + chown postfix:root ${D}${localstatedir}/spool/postfix/incoming + install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved + chown postfix:root ${D}${localstatedir}/spool/postfix/saved + install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace + chown postfix:root ${D}${localstatedir}/spool/postfix/trace + install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop + chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop + install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid + chown root:root ${D}${localstatedir}/spool/postfix/pid + install -m 0700 -d ${D}${localstatedir}/spool/postfix/private + chown postfix:root ${D}${localstatedir}/spool/postfix/private + install -m 0710 -d ${D}${localstatedir}/spool/postfix/public + chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public + install -m 0755 -d ${D}${localstatedir}/spool/vmail + chown vmail:vmail ${D}${localstatedir}/spool/vmail + + chown :postdrop ${D}${sbindir}/postqueue + chown :postdrop ${D}${sbindir}/postdrop + chmod g+s ${D}${sbindir}/postqueue + chmod g+s ${D}${sbindir}/postdrop + + rm -rf ${D}/etc/postfix/makedefs.out +} + +do_install:append:class-native() { + ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases + ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq +} + +ALTERNATIVE:${PN}-bin = "sendmail mailq newaliases" +# /usr/lib/sendmial is required by LSB core test +ALTERNATIVE:${PN}-bin:linuxstdbase = "sendmail mailq newaliases usr-lib-sendmail" +ALTERNATIVE_TARGET[mailq] = "${bindir}/mailq" +ALTERNATIVE_TARGET[newaliases] = "${bindir}/newaliases" +ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix" +ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" +ALTERNATIVE_TARGET[usr-lib-sendmail] = "${sbindir}/sendmail.postfix" +ALTERNATIVE_LINK_NAME[usr-lib-sendmail] = "/usr/lib/sendmail" + +ALTERNATIVE_PRIORITY = "120" + +ALTERNATIVE:${PN}-doc += "mailq.1 newaliases.1 sendmail.1" +ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1" +ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1" +ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1" + +pkg_postinst_ontarget:${PN}-cfg () { + touch /etc/aliases + newaliases + + # generate virtual_alias, default is hash + touch /etc/postfix/virtual_alias + postmap /etc/postfix/virtual_alias +} + +PACKAGES =+ "${PN}-cfg" +RDEPENDS:${PN}-cfg:append:class-target = " ${PN}-bin" +RDEPENDS:${PN}:append:class-target = " ${PN}-cfg" +# Exclude .debug directories from the main package +FILES:${PN}-bin += "${localstatedir} ${bindir}/* ${sbindir}/* \ + ${libexecdir}/* ${systemd_unitdir}/*" +FILES:${PN}-cfg = "${sysconfdir}" +FILES:${PN}-dbg += "${libexecdir}/postfix/.debug" +ALLOW_EMPTY:${PN} = "1" -- cgit v1.2.3-54-g00ecf