diff options
Diffstat (limited to 'meta-networking/recipes-daemons/postfix')
13 files changed, 193 insertions, 188 deletions
diff --git a/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch b/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch deleted file mode 100644 index 6b86e39259..0000000000 --- a/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 63619acf25151d4dade6d65732722ec4a710a5ac Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 15 Jul 2017 09:54:25 -0700 -Subject: [PATCH] Check for glibc before setting CANT_USE_SEND_RECV_MSG - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/util/sys_defs.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h -index f720e2a..7314c63 100644 ---- a/src/util/sys_defs.h -+++ b/src/util/sys_defs.h -@@ -813,7 +813,7 @@ extern int initgroups(const char *, int); - #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1) - #endif - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \ -- || (__GLIBC__ < 2) -+ || (defined(__GLIBC__) && (__GLIBC__ < 2)) - #define CANT_USE_SEND_RECV_MSG - #define DEF_SMTP_CACHE_DEMAND 0 - #else --- -2.13.3 - diff --git a/meta-networking/recipes-daemons/postfix/files/makedefs.patch b/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch index 98d5f7ed60..8c9c13b1c4 100644 --- a/meta-networking/recipes-daemons/postfix/files/makedefs.patch +++ b/meta-networking/recipes-daemons/postfix/files/0001-Fix-makedefs.patch @@ -1,8 +1,9 @@ -From 4f49e2ce420fb3c17415937530493158ef312733 Mon Sep 17 00:00:00 2001 +From 9000ee4d8bb5c5e0bcc588e9bec86eb56f4285e1 Mon Sep 17 00:00:00 2001 From: Li xin <lixin.fnst@cn.fujitsu.com> Date: Fri, 19 Jun 2015 16:45:54 +0900 -Subject: [PATCH] 1)remove RANLIB, SYSLIBS, AR and get them from env. +Subject: [PATCH] Fix makedefs +1)remove RANLIB, SYSLIBS, AR and get them from env. 2)reference sysroot when searching header files 3)include sysroot path instead of absolute include path for Linux2 and Linux3 systems. @@ -10,7 +11,7 @@ for Linux2 and Linux3 systems. native build, search host library path for nsl and resolv library which comes from libc -Upstreamstatus: Inappropriate [embedded specific] +Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Yao Zhao <yao.zhao@windriver.com> --- @@ -18,10 +19,10 @@ Signed-off-by: Yao Zhao <yao.zhao@windriver.com> 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/makedefs b/makedefs -index 8b84e47..893fb0d 100644 +index 3448c1e..78e0717 100644 --- a/makedefs +++ b/makedefs -@@ -170,9 +170,6 @@ echo "# pie=$pie" +@@ -197,9 +197,6 @@ echo "# pie=$pie" # Defaults for most sane systems @@ -31,7 +32,7 @@ index 8b84e47..893fb0d 100644 ARFL=rv # Ugly function to make our error message more visible among the -@@ -424,12 +421,12 @@ case "$SYSTEM.$RELEASE" in +@@ -492,12 +489,12 @@ case "$SYSTEM.$RELEASE" in case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; @@ -47,7 +48,7 @@ index 8b84e47..893fb0d 100644 else # No, we're not going to try db1 db2 db3 etc. # On a properly installed system, Postfix builds -@@ -438,12 +435,12 @@ case "$SYSTEM.$RELEASE" in +@@ -506,12 +503,12 @@ case "$SYSTEM.$RELEASE" in echo "Install the appropriate db*-devel package first." 1>&2 exit 1 fi @@ -62,7 +63,7 @@ index 8b84e47..893fb0d 100644 do test -e $lib/lib$name.a -o -e $lib/lib$name.so && { SYSLIBS="$SYSLIBS -l$name" -@@ -463,7 +460,7 @@ case "$SYSTEM.$RELEASE" in +@@ -531,7 +528,7 @@ case "$SYSTEM.$RELEASE" in if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ] then : @@ -71,7 +72,7 @@ index 8b84e47..893fb0d 100644 then echo CCARGS="$CCARGS -DNO_EPOLL" else -@@ -487,8 +484,6 @@ int main(int argc, char **argv) +@@ -555,8 +552,6 @@ int main(int argc, char **argv) } EOF ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1 @@ -80,7 +81,7 @@ index 8b84e47..893fb0d 100644 rm -f makedefs.test makedefs.test.[co] fi;; esac -@@ -504,12 +499,12 @@ EOF +@@ -572,12 +567,12 @@ EOF case "$CCARGS" in *-DNO_DB*) ;; *-DHAS_DB*) ;; @@ -96,7 +97,7 @@ index 8b84e47..893fb0d 100644 else # On a properly installed system, Postfix builds # by including <db.h> and by linking with -ldb -@@ -517,12 +512,12 @@ EOF +@@ -585,12 +580,12 @@ EOF echo "Install the appropriate db*-devel package first." 1>&2 exit 1 fi @@ -112,5 +113,5 @@ index 8b84e47..893fb0d 100644 test -e $lib/lib$name.a -o -e $lib/lib$name.so && { SYSLIBS="$SYSLIBS -l$name" -- -1.8.4.2 +2.17.1 diff --git a/meta-networking/recipes-daemons/postfix/files/install.patch b/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch index d023680f3b..28199ccdd2 100644 --- a/meta-networking/recipes-daemons/postfix/files/install.patch +++ b/meta-networking/recipes-daemons/postfix/files/0002-Change-fixed-postconf-to-a-variable-for-cross-compil.patch @@ -1,20 +1,34 @@ -From 190650e1cd5700cd6950ead3fcb17ebcec192a2e Mon Sep 17 00:00:00 2001 +From cb69ffda0c2cbde6acdc8b01c8d5ff78d81a84fc Mon Sep 17 00:00:00 2001 From: Li xin <lixin.fnst@cn.fujitsu.com> Date: Fri, 19 Jun 2015 17:14:58 +0900 Subject: [PATCH] Change fixed postconf to a variable for cross-compiling -Upstreamstatus: Inappropriate [embedded specific] +Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Yao Zhao <yao.zhao@windriver.com> --- + Makefile.in | 2 +- postfix-install | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) + 2 files changed, 11 insertions(+), 9 deletions(-) +diff --git a/Makefile.in b/Makefile.in +index 65e7911..40295be 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -22,7 +22,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 = \ +- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`} ++ $${shlib_directory:-`$(SHLIB_ENV) $(POSTCONF) -dhx shlib_directory`} + + default: update + diff --git a/postfix-install b/postfix-install -index 1662c3d..d11fa12 100644 +index e498cd3..8049f43 100644 --- a/postfix-install +++ b/postfix-install -@@ -226,8 +226,8 @@ test -z "$non_interactive" -a ! -t 0 && { +@@ -244,8 +244,8 @@ test -z "$non_interactive" -a ! -t 0 && { exit 1 } @@ -25,7 +39,7 @@ index 1662c3d..d11fa12 100644 exit 1 } -@@ -248,7 +248,7 @@ do +@@ -266,7 +266,7 @@ do case "$junk" in *MAIL_VERSION*) case "$mail_version" in @@ -34,7 +48,7 @@ index 1662c3d..d11fa12 100644 esac val=`echo "$junk" | sed 's/MAIL_VERSION$/'"$mail_version/g"` || exit 1 case "$val" in -@@ -434,7 +434,7 @@ template files main.cf.proto and master.cf.proto." +@@ -454,7 +454,7 @@ template files main.cf.proto and master.cf.proto." : ${install_root=/} : ${tempdir=`pwd`} @@ -43,7 +57,7 @@ index 1662c3d..d11fa12 100644 # Find out the location of installed configuration files. -@@ -500,7 +500,7 @@ test -f $CONFIG_DIRECTORY/main.cf && { +@@ -520,7 +520,7 @@ test -f $CONFIG_DIRECTORY/main.cf && { case "$junk" in "") eval unset $name;; esac @@ -52,7 +66,7 @@ index 1662c3d..d11fa12 100644 exit 1 done } -@@ -513,7 +513,7 @@ do +@@ -533,7 +533,7 @@ do case "$junk" in "") eval unset $name;; esac @@ -61,7 +75,7 @@ index 1662c3d..d11fa12 100644 done # Override settings manually. -@@ -639,6 +639,8 @@ README_DIRECTORY=$install_root$readme_directory +@@ -670,6 +670,8 @@ README_DIRECTORY=$install_root$readme_directory SHLIB_DIRECTORY=$install_root$shlib_directory META_DIRECTORY=$install_root$meta_directory @@ -70,16 +84,16 @@ index 1662c3d..d11fa12 100644 # Avoid repeated tests for existence of these; default permissions suffice. test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1 -@@ -810,7 +812,7 @@ IFS="$BACKUP_IFS" +@@ -841,7 +843,7 @@ IFS="$BACKUP_IFS" # the wrong place when Postfix is being upgraded. case "$mail_version" in -"") mail_version="`bin/postconf -dhx mail_version`" || exit 1 -+"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1 ++"") mail_version="`$POSTCONF -c $CONFIG_DIRECTORY -dhx mail_version`" || exit 1 esac # Undo MAIL_VERSION expansion at the end of a parameter value. If -@@ -830,7 +832,7 @@ do +@@ -861,7 +863,7 @@ do esac done @@ -89,5 +103,5 @@ index 1662c3d..d11fa12 100644 "data_directory = $data_directory" \ "command_directory = $command_directory" \ -- -1.8.4.2 +2.17.1 diff --git a/meta-networking/recipes-daemons/postfix/files/0001-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 763a4a9b98..1545f21637 100644 --- a/meta-networking/recipes-daemons/postfix/files/0001-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 a0d0de10e4c5ab55bc2fa48798079e2876b1211d Mon Sep 17 00:00:00 2001 +From 995bddd9563b1aecca2369f2f9c675f88bdc0053 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Sat, 26 Aug 2017 10:29:37 -0700 Subject: [PATCH] makedefs: Use native compiler to build makedefs.test @@ -7,14 +7,16 @@ Its a binary used during build Signed-off-by: Khem Raj <raj.khem@gmail.com> --- +Upstream-Status: Pending + makedefs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/makedefs b/makedefs -index 9fd4bc2..5ee7747 100644 +index 78e0717..3299eba 100644 --- a/makedefs +++ b/makedefs -@@ -526,7 +526,7 @@ int main(int argc, char **argv) +@@ -551,7 +551,7 @@ int main(int argc, char **argv) exit(0); } EOF @@ -23,7 +25,7 @@ index 9fd4bc2..5ee7747 100644 rm -f makedefs.test makedefs.test.[co] fi;; esac -@@ -762,7 +762,7 @@ int main(int argc, char **argv) +@@ -787,7 +787,7 @@ int main(int argc, char **argv) exit(0); } EOF @@ -32,7 +34,7 @@ index 9fd4bc2..5ee7747 100644 ./makedefs.test 2>/dev/null || CCARGS="$CCARGS -DNO_SIGSETJMP" rm -f makedefs.test makedefs.test.[co] -@@ -796,7 +796,7 @@ int main(int argc, char **argv) +@@ -823,7 +823,7 @@ int main(int argc, char **argv) &error) != 14); } EOF @@ -41,7 +43,7 @@ index 9fd4bc2..5ee7747 100644 $icu_ldflags >/dev/null 2>&1 if ./makedefs.test 2>/dev/null ; then CCARGS="$CCARGS $icu_cppflags" -@@ -911,7 +911,7 @@ int main(void) +@@ -938,7 +938,7 @@ int main(void) exit(ferror(stdout) ? 1 : 0); } EOF @@ -50,7 +52,7 @@ index 9fd4bc2..5ee7747 100644 ./makedefs.test || exit 1 rm -f makedefs.test makedefs.test.[co] } -@@ -1067,7 +1067,7 @@ int main(void) +@@ -1094,7 +1094,7 @@ int main(void) exit(ferror(stdout) ? 1 : 0); } EOF @@ -60,5 +62,5 @@ index 9fd4bc2..5ee7747 100644 rm -f makedefs.test makedefs.test.[co] eval ${parm_name}=\""\$parm_val"\" -- -2.14.1 +2.17.1 diff --git a/meta-networking/recipes-daemons/postfix/files/icu-config.patch b/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch index 9bd9c2f03e..a38e783309 100644 --- a/meta-networking/recipes-daemons/postfix/files/icu-config.patch +++ b/meta-networking/recipes-daemons/postfix/files/0004-Fix-icu-config.patch @@ -1,3 +1,8 @@ +From afef4a9391e6bb1a6c3e73d370f240577ed8b0dd Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 16 Jan 2022 11:21:54 +0800 +Subject: [PATCH] Fix icu config + do not entertain cppflags from icu, this is because icu-config feeds the -I path without sysroot which caused native headers to be included and build is @@ -6,12 +11,17 @@ to the CCARGS which we loose nothing if its not entertained. Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + makedefs | 1 - + 1 file changed, 1 deletion(-) -Index: postfix-3.2.2/makedefs -=================================================================== ---- postfix-3.2.2.orig/makedefs -+++ postfix-3.2.2/makedefs -@@ -799,7 +799,6 @@ EOF +diff --git a/makedefs b/makedefs +index 3299eba..2a76f20 100644 +--- a/makedefs ++++ b/makedefs +@@ -826,7 +826,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 @@ -19,3 +29,6 @@ Index: postfix-3.2.2/makedefs SYSLIBS="$SYSLIBS $icu_ldflags" else CCARGS="$CCARGS -DNO_EAI" +-- +2.17.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 new file mode 100644 index 0000000000..b425cf8432 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/0005-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch @@ -0,0 +1,58 @@ +From 545d4a79b50caa5698622c0c1905ae154197a16f Mon Sep 17 00:00:00 2001 +From: Yi Zhao <yi.zhao@windriver.com> +Date: Fri, 12 Oct 2018 12:38:02 +0800 +Subject: [PATCH] makedefs: add -lnsl and -lresolv to SYSLIBS by default + +We don't need to check libnsl.so and libresolv.so since the libnsl2 is +specified in DEPENDS and libresolv.so is from c libarary. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Yi Zhao <yi.zhao@windriver.com> +--- + makedefs | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/makedefs b/makedefs +index 2a76f20..9d5db9f 100644 +--- a/makedefs ++++ b/makedefs +@@ -506,16 +506,7 @@ case "$SYSTEM.$RELEASE" in + SYSLIBS="$SYSLIBS -ldb" + ;; + esac +- for name in nsl resolv $GDBM_LIBS +- do +- for lib in $BUILD_SYSROOT_NSL_PATH +- do +- test -e $lib/lib$name.a -o -e $lib/lib$name.so && { +- SYSLIBS="$SYSLIBS -l$name" +- break +- } +- done +- done ++ SYSLIBS="$SYSLIBS -lnsl -lresolv" + # Kernel 2.4 added IPv6 + case "$RELEASE" in + 2.[0-3].*) CCARGS="$CCARGS -DNO_IPV6";; +@@ -583,16 +574,7 @@ EOF + SYSLIBS="$SYSLIBS -ldb" + ;; + esac +- for name in nsl resolv +- do +- for lib in $BUILD_SYSROOT_NSL_PATH +- do +- test -e $lib/lib$name.a -o -e $lib/lib$name.so && { +- SYSLIBS="$SYSLIBS -l$name" +- break +- } +- done +- done ++ SYSLIBS="$SYSLIBS -lnsl -lresolv" + SYSLIBS="$SYSLIBS -ldl" + : ${SHLIB_SUFFIX=.so} + : ${SHLIB_CFLAGS=-fPIC} +-- +2.17.1 + diff --git a/meta-networking/recipes-daemons/postfix/files/aliasesdb b/meta-networking/recipes-daemons/postfix/files/aliasesdb index 855a64f705..855a64f705 100755..100644 --- a/meta-networking/recipes-daemons/postfix/files/aliasesdb +++ b/meta-networking/recipes-daemons/postfix/files/aliasesdb diff --git a/meta-networking/recipes-daemons/postfix/files/check_hostname.sh b/meta-networking/recipes-daemons/postfix/files/check_hostname.sh index 37a0dd088c..37a0dd088c 100755..100644 --- a/meta-networking/recipes-daemons/postfix/files/check_hostname.sh +++ b/meta-networking/recipes-daemons/postfix/files/check_hostname.sh diff --git a/meta-networking/recipes-daemons/postfix/files/main.cf b/meta-networking/recipes-daemons/postfix/files/main.cf index e75c6fc0d7..22c57485d7 100644 --- a/meta-networking/recipes-daemons/postfix/files/main.cf +++ b/meta-networking/recipes-daemons/postfix/files/main.cf @@ -1,4 +1,4 @@ -compatibility_level = 2 +compatibility_level = 3.6 smtputf8_enable = no # Configure your domain and accounts diff --git a/meta-networking/recipes-daemons/postfix/files/postfix b/meta-networking/recipes-daemons/postfix/files/postfix index 8c7a60175a..8c7a60175a 100755..100644 --- a/meta-networking/recipes-daemons/postfix/files/postfix +++ b/meta-networking/recipes-daemons/postfix/files/postfix diff --git a/meta-networking/recipes-daemons/postfix/files/postfix-install.patch b/meta-networking/recipes-daemons/postfix/files/postfix-install.patch deleted file mode 100644 index 45479bd52a..0000000000 --- a/meta-networking/recipes-daemons/postfix/files/postfix-install.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: postfix-3.2.2/postfix-install -=================================================================== ---- postfix-3.2.2.orig/postfix-install -+++ postfix-3.2.2/postfix-install -@@ -843,7 +843,7 @@ IFS="$BACKUP_IFS" - # the wrong place when Postfix is being upgraded. - - case "$mail_version" in --"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1 -+"") mail_version="`$POSTCONF -c $CONFIG_DIRECTORY -dhx mail_version`" || exit 1 - esac - - # Undo MAIL_VERSION expansion at the end of a parameter value. If -Index: postfix-3.2.2/Makefile.in -=================================================================== ---- postfix-3.2.2.orig/Makefile.in -+++ postfix-3.2.2/Makefile.in -@@ -20,7 +20,7 @@ META = meta/main.cf.proto meta/master.cf - EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \ - -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);" - SHLIB_DIR_OVERRIDE = \ -- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`} -+ $${shlib_directory:-`$(SHLIB_ENV) $(POSTCONF) -dhx shlib_directory`} - - default: update - diff --git a/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb b/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb deleted file mode 100644 index 89af406ac3..0000000000 --- a/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb +++ /dev/null @@ -1,9 +0,0 @@ -require postfix.inc - -SRC_URI += "file://0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch \ - file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \ - file://postfix-install.patch \ - file://icu-config.patch \ - " -SRC_URI[md5sum] = "aea073a9b0bea5bdb590460a270a4aa0" -SRC_URI[sha256sum] = "d06849418d119d09366997b2b481bb23f737629769b4e4a52da42fb3ad8b0576" diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix_3.8.6.bb index 09447d50ad..d48e9145f8 100644 --- a/meta-networking/recipes-daemons/postfix/postfix.inc +++ b/meta-networking/recipes-daemons/postfix/postfix_3.8.6.bb @@ -6,25 +6,31 @@ has a definite Sendmail-ish flavor, but the inside is completely different." HOMEPAGE= "http://www.postfix.org" SECTION = "mail" -DEPENDS = "db icu libpcre openssl postfix-native \ +DEPENDS = "db icu libpcre libnsl2 m4-native openssl postfix-native \ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ " -DEPENDS_class-native = "db-native icu-native openssl-native libpcre-native" - -LICENSE = "IPL-1.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=64375f37431336ea1b1b3005fe3fa354" - -SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \ - file://makedefs.patch \ - file://install.patch \ - file://main.cf \ - file://postfix \ - file://internal_recipient \ - file://postfix.service \ - file://aliasesdb \ - file://check_hostname.sh \ -" + +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 \ + " + +SRC_URI[sha256sum] = "4b6e17c826cc438cc3016a9c0a55ea7e77c6cbafba7dd57241d81b690b0e9774" + +UPSTREAM_CHECK_REGEX = "postfix\-(?P<pver>3\.8(\.\d+)+).tar.gz" S = "${WORKDIR}/postfix-${PV}" @@ -32,16 +38,16 @@ CLEANBROKEN = "1" BBCLASSEXTEND = "native" -inherit update-rc.d useradd update-alternatives systemd +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}" -USERADD_PARAM_${PN} = \ +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} = "--system postfix;--system postdrop;--system vmail" +GROUPADD_PARAM:${PN}-bin = "--system postfix;--system postdrop;--system vmail" export SYSLIBS = "${LDFLAGS}" @@ -57,10 +63,10 @@ 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-ldap:class-native = "" +export AUXLIBS-ldap:class-native = "" -export CCARGS-nonis_libc-musl = "-DNO_NIS" +export CCARGS-nonis:libc-musl = "-DNO_NIS" export CCARGS-nonis = "" # SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH @@ -69,15 +75,14 @@ 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 = "" +export CCARGS-sasl:class-native = "" +export AUXLIBS-sasl:class-native = "" # PCRE, TLS support default export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}" export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" -export CCARGS-nonis_libc-musl = "-DNO_NIS" # 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= " @@ -99,38 +104,20 @@ do_compile () { "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ ${S}/Makefile.in export BUILD_SYSROOT="${STAGING_DIR_HOST}" - export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \ - ${STAGING_LIBDIR}" else # native build export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" - - # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32) - # on 64 bits, 32 libs in i386-linux-gnu - # let makedefs finds nsl and resolv libs, host CC will link - # the correct libraries - BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \ - sed -n '/^libraries: =/s/libraries: =//p' | \ - sed -e 's/:/\n/g' | xargs -n1 readlink -f | \ - grep -v 'gcc\|/[0-9.]\+$' | sort -u)" - if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then - BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \ - /lib/x86_64-linux-gnu \ - /usr/lib /lib \ - /lib/i386-linux-gnu" - fi - export BUILD_SYSROOT_NSL_PATH fi oe_runmake makefiles oe_runmake } -do_install_prepend_class-native() { +do_install:prepend:class-native() { export POSTCONF="bin/postconf" } -SYSTEMD_SERVICE_${PN} = "postfix.service" +SYSTEMD_SERVICE:${PN} = "postfix.service" do_install () { sh ./postfix-install 'install_root=${D}' \ @@ -146,24 +133,24 @@ do_install () { 'data_directory=${localstatedir}/lib/postfix' \ -non-interactive rm -rf ${D}${localstatedir}/spool/postfix - mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf + mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/${MLPREFIX}sample-main.cf install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/ install -d ${D}${sysconfdir}/init.d - install -m 644 ${WORKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf + install -m 644 ${UNPACKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf - install -m 755 ${WORKDIR}/check_hostname.sh ${D}${sbindir}/ + install -m 755 ${UNPACKDIR}/check_hostname.sh ${D}${sbindir}/ - install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix - install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient + install -m 755 ${UNPACKDIR}/postfix ${D}${sysconfdir}/init.d/postfix + install -m 644 ${UNPACKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/postfix.service ${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 - install -m 0755 ${WORKDIR}/aliasesdb ${D}${libexecdir}/postfix + install -m 0755 ${UNPACKDIR}/aliasesdb ${D}${libexecdir}/postfix install -m 770 -d ${D}${localstatedir}/spool/postfix chown postfix:postfix ${D}${localstatedir}/spool/postfix @@ -207,56 +194,47 @@ do_install () { 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() { +do_install:append:class-native() { ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq } -do_install_append_class-target() { - # Remove references to buildmachine paths in target makedefs.out - sed -i 's:-fdebug-prefix-map[^ ]*::g; s:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out -} - -ALTERNATIVE_${PN} = "sendmail" +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:${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" -PACKAGE_WRITE_DEPS += "postfix-native" -pkg_postinst_${PN} () { - if [ "x$D" = "x" ]; then - touch /etc/aliases - newaliases +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 - else - if ${@'true' if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) else 'false'}; then - # /usr/lib/sendmail is required by LSB core test - [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/ - fi - - touch $D/etc/aliases - # This can fail depending on host setup - if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then - $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX} - exit 0 - fi - touch $D/etc/postfix/virtual_alias - postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias - - fi + # generate virtual_alias, default is hash + touch /etc/postfix/virtual_alias + postmap /etc/postfix/virtual_alias } +PACKAGES =+ "${PN}-cfg" +RDEPENDS:${PN}-cfg:class-target += "${PN}-bin" +RDEPENDS:${PN}:class-target += "${PN}-cfg" # Exclude .debug directories from the main package -FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \ +FILES:${PN}-bin += "${localstatedir} ${bindir}/* ${sbindir}/* \ ${libexecdir}/* ${systemd_unitdir}/*" -FILES_${PN}-dbg += "${libexecdir}/postfix/.debug" +FILES:${PN}-cfg = "${sysconfdir}" +FILES:${PN}-dbg += "${libexecdir}/postfix/.debug" +ALLOW_EMPTY:${PN} = "1" |