Skip to contentSkip to conversation

msmtp: add link sendmail to pass LSB test

PATCH In review Kang Kai 2 participants 6 messages Mar 18, 2011

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

cover msmtp: add link sendmail to pass LSB test

From: Kang Kai <[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.
msmtp has been added to replace sendmail.

Related to [YOCTO #520]

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: kangkai/distro01
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/distro01

Thanks,
Kang Kai <[email protected]>
---

Kang Kai (1):
msmtp: add link sendmail for lsb command check

 meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
author
#1 lore raw

PATCH 1/1 msmtp: add link sendmail for lsb command check

From: Kang Kai <[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.

Related to [YOCTO #520]

---
 meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +11 -1
index cb3d83c..5fc4060 100644
@@ -6,7 +6,7 @@ SECTION = "console/network"
 PRIORITY = "required"
 LICENSE = "GPLv3"
 DEPENDS = "zlib gnutls"
-PR = "r0"
+PR = "r1"
 
 
 #COPYING or Licence
@@ -19,3 +19,13 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
 SRC_URI[sha256sum] = "269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"
 
 inherit gettext autotools
+
+pkg_postinst_${PN} () {
+    if [ "x$D" != "x" ] ; then
+        exit 1
+    fi
+
+    if [ ! -e ${sbindir}/sendmail ]; then
+        ln -sf ${bindir}/msmtp ${sbindir}/sendmail
+    fi
+}
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH 1/1] msmtp: add link sendmail for lsb command check

Quoted 8 lines · Kang Kai

From: Kang Kai <[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.

Related to [YOCTO #520]

Shouldn't this be using the update-alternatives mechanism?

Cheers,

Richard

Quoted 30 lines
 meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +11 -1
index cb3d83c..5fc4060 100644
@@ -6,7 +6,7 @@ SECTION = "console/network"
 PRIORITY = "required"
 LICENSE = "GPLv3"
 DEPENDS = "zlib gnutls"
-PR = "r0"
+PR = "r1"
 
 
 #COPYING or Licence
@@ -19,3 +19,13 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
 SRC_URI[sha256sum] = "269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"
 
 inherit gettext autotools
+
+pkg_postinst_${PN} () {
+    if [ "x$D" != "x" ] ; then
+        exit 1
+    fi
+
+    if [ ! -e ${sbindir}/sendmail ]; then
+        ln -sf ${bindir}/msmtp ${sbindir}/sendmail
+    fi
+}
author
#3 lore raw

Re: [PATCH 1/1] msmtp: add link sendmail for lsb command check

From: Kang Kai <[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.

Related to [YOCTO #520]

---
 meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +1 -1
index cb3d83c..b3500d0 100644
@@ -6,7 +6,7 @@ SECTION = "console/network"
 PRIORITY = "required"
 LICENSE = "GPLv3"
 DEPENDS = "zlib gnutls"
-PR = "r0"
+PR = "r1"
 
 
 #COPYING or Licence
@@ -19,3 +19,11 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
 SRC_URI[sha256sum] = 

"269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"

inherit gettext autotools
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${sbindir}/sendmail sendmail ${bindir}/msmtp 100
+}
+
+pkg_prerm_${PN} () {
+ update-alternatives --remove sendmail ${bindir}/msmtp
+}

Signature · 1 line
1.7.1
author
#5 lore raw

Re: [PATCH 1/1] msmtp: add link sendmail for lsb command check

In reply to Richard Purdie
Quoted 10 lines · Richard Purdie
Quoted 8 lines · Kang Kai

From: Kang Kai<[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.

Related to [YOCTO #520]

Shouldn't this be using the update-alternatives mechanism?

Hi Richard,

I updated the patch, using update-alternatives to make links. Please help me to check in next letter.

Thanks and Regards,
Kai

Quoted 31 lines
Quoted 30 lines
  meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   12 +++++++++++-
  1 files changed, 11 insertions(+), 1 deletions(-)
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +11 -1
index cb3d83c..5fc4060 100644
@@ -6,7 +6,7 @@ SECTION = "console/network"
  PRIORITY = "required"
  LICENSE = "GPLv3"
  DEPENDS = "zlib gnutls"
-PR = "r0"
+PR = "r1"
 
 
  #COPYING or Licence
@@ -19,3 +19,13 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
  SRC_URI[sha256sum] = "269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"
 
  inherit gettext autotools
+
+pkg_postinst_${PN} () {
+    if [ "x$D" != "x" ] ; then
+        exit 1
+    fi
+
+    if [ ! -e ${sbindir}/sendmail ]; then
+        ln -sf ${bindir}/msmtp ${sbindir}/sendmail
+    fi
+}
#4 lore raw

Re: [PATCH 1/1] msmtp: add link sendmail for lsb command check

In reply to Kang Kai
Quoted 35 lines · Kang Kai

From: Kang Kai <[email protected]>

LSB command check will test the exist of sendmail, so make sendmail link to msmtp in order to pass the test.

Related to [YOCTO #520]

---
  meta/recipes-extended/msmtp/msmtp_1.4.23.bb |   10 +++++++++-
  1 files changed, 9 insertions(+), 1 deletions(-)
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +1 -1
index cb3d83c..b3500d0 100644
@@ -6,7 +6,7 @@ SECTION = "console/network"
  PRIORITY = "required"
  LICENSE = "GPLv3"
  DEPENDS = "zlib gnutls"
-PR = "r0"
+PR = "r1"
 
 
  #COPYING or Licence
@@ -19,3 +19,11 @@ SRC_URI[md5sum] = "5fb7ae88186624cdb125d3efad3fdc16"
  SRC_URI[sha256sum] = 

"269cd30eeb867167c6a599e23399f4fc24196fcdef3bac5b120d806b3b421810"

inherit gettext autotools

meta/recipes-extended/msmtp/msmtp_1.4.23.bb +3 -0
+
+pkg_postinst_${PN} () {
+    update-alternatives --install ${sbindir}/sendmail sendmail 

${bindir}/msmtp 100

meta/recipes-extended/msmtp/msmtp_1.4.23.bb

Quoted 5 lines
meta/recipes-extended/msmtp/msmtp_1.4.23.bb +5 -0
+}
+
+pkg_prerm_${PN} () {
+    update-alternatives --remove sendmail ${bindir}/msmtp
+}

Instead of doing this directly could you use the update-alternatives class please? meta/recipes-connectivity/iproute2/iproute2.inc shows an example of this. I think it should be something like:

inherit update-alternatives

ALTERNATIVE_NAME = "sendmail"
ALTERNATIVE_PATH = "${sbindir}/mstmp"
ALTERNATIVE_LINK = "${sbindir}/sendmail"
ALTERNATIVE_PRIORITY = "100"

Thanks,

Richard