summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-networking/recipes-daemons/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-daemons/postfix')
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc44
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb12
5 files changed, 82 insertions, 67 deletions
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch
deleted file mode 100644
index 6b86e3925..000000000
--- a/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch
new file mode 100644
index 000000000..565098400
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch
@@ -0,0 +1,58 @@
+From 4caa18feb70f8f3d133657c1250a53f4e292bb42 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 2683bce..8f1b3f4 100644
+--- a/makedefs
++++ b/makedefs
+@@ -484,16 +484,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";;
+@@ -561,16 +552,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.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
index 09447d50a..3d4f1df43 100644
--- a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -6,14 +6,13 @@ 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 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"
+LICENSE = "IPL-1.0 | EPL-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b181651ad99a7dc4cc8c4ce2f491ed1a"
SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
file://makedefs.patch \
@@ -77,7 +76,6 @@ export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS -I${STAGING_INCDIR}/openssl ${C
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,27 +97,9 @@ 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
@@ -207,6 +187,8 @@ 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() {
@@ -214,14 +196,12 @@ do_install_append_class-native() {
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} += "sendmail mailq newaliases"
+ALTERNATIVE_TARGET[mailq] = "${bindir}/mailq"
+ALTERNATIVE_TARGET[newaliases] = "${bindir}/newaliases"
ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix"
ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+
ALTERNATIVE_PRIORITY = "120"
ALTERNATIVE_${PN}-doc += "mailq.1 newaliases.1 sendmail.1"
@@ -248,10 +228,10 @@ pkg_postinst_${PN} () {
# 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
+ else
+ touch $D/etc/postfix/virtual_alias
+ postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
fi
- touch $D/etc/postfix/virtual_alias
- postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
fi
}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb
deleted file mode 100644
index 89af406ac..000000000
--- a/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb
new file mode 100644
index 000000000..6718b7ef9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.3.1.bb
@@ -0,0 +1,12 @@
+require postfix.inc
+
+SRC_URI += "file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
+ file://postfix-install.patch \
+ file://icu-config.patch \
+ file://0001-makedefs-add-lnsl-and-lresolv-to-SYSLIBS-by-default.patch \
+ "
+
+SRC_URI[md5sum] = "4381c6492f415e4a69cf5099d4acea76"
+SRC_URI[sha256sum] = "54f514dae42b5275cb4bc9c69283f16c06200b71813d0bb696568c4ba7ae7e3b"
+
+UPSTREAM_CHECK_REGEX = "postfix\-(?P<pver>3\.3(\.\d+)+).tar.gz"