From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- .../recipes-daemons/postfix/postfix.inc | 62 ++++++++-------------- 1 file changed, 21 insertions(+), 41 deletions(-) (limited to 'external/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc') diff --git a/external/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc b/external/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc index 3d4f1df4..4b9940cc 100644 --- a/external/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc +++ b/external/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc @@ -14,33 +14,22 @@ DEPENDS = "db icu libpcre libnsl2 openssl postfix-native \ 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 \ - file://install.patch \ - file://main.cf \ - file://postfix \ - file://internal_recipient \ - file://postfix.service \ - file://aliasesdb \ - file://check_hostname.sh \ -" - S = "${WORKDIR}/postfix-${PV}" CLEANBROKEN = "1" BBCLASSEXTEND = "native" -inherit update-rc.d useradd update-alternatives systemd +inherit 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}" @@ -196,11 +185,15 @@ do_install_append_class-native() { ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq } -ALTERNATIVE_${PN} += "sendmail mailq newaliases" +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" @@ -209,34 +202,21 @@ 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} - else - touch $D/etc/postfix/virtual_alias - postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias - fi - - 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}-cfg = "${sysconfdir}" FILES_${PN}-dbg += "${libexecdir}/postfix/.debug" +ALLOW_EMPTY_${PN} = "1" -- cgit 1.2.3-korg