[oe,meta-networking,25/49] ssmtp: Add recipe

Message ID 20161123092209.23699-25-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj Nov. 23, 2016, 9:21 a.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../ssmtp/ssmtp/build-ouside_srcdir.patch          | 17 +++++
 .../recipes-support/ssmtp/ssmtp/use-DESTDIR.patch  | 74 ++++++++++++++++++++++
 .../recipes-support/ssmtp/ssmtp_2.64.bb            | 31 +++++++++
 3 files changed, 122 insertions(+)
 create mode 100644 meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
 create mode 100644 meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
 create mode 100644 meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb

-- 
2.10.2

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch hide | download patch | download mbox

diff --git a/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch b/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
new file mode 100644
index 0000000..d53cff2
--- /dev/null
+++ b/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
@@ -0,0 +1,17 @@ 
+help compile when S != B
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -24,7 +24,7 @@ INSTALLED_REVALIASES_FILE=$(REVALIASES_F
+ # Programs
+ GEN_CONFIG=$(srcdir)/generate_config
+ 
+-SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
++SRCS=$(srcdir)/ssmtp.c $(srcdir)/arpadate.c $(srcdir)/base64.c $(srcdir)/xgethostname.c @SRCS@
+ 
+ OBJS=$(SRCS:.c=.o)
+ 
diff --git a/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch b/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
new file mode 100644
index 0000000..26d8527
--- /dev/null
+++ b/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
@@ -0,0 +1,74 @@ 
+Use DESTDIR during  install/uninstall, this helps
+with cross or staged builds. Additionally pass LDFLAGS
+during linking.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -46,40 +46,40 @@ all: ssmtp
+ 
+ .PHONY: install
+ install: ssmtp $(GEN_CONFIG)
+-	$(INSTALL) -d -m 755 $(bindir)
+-	$(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
+-	$(INSTALL) -d -m 755 $(mandir)
+-	$(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
+-	$(INSTALL) -d -m 755 $(SSMTPCONFDIR)
+-	$(INSTALL) -m 644 $(srcdir)/revaliases $(INSTALLED_REVALIASES_FILE)
+-	$(GEN_CONFIG) $(INSTALLED_CONFIGURATION_FILE)
++	$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
++	$(INSTALL) -m 755 ssmtp $(DESTDIR)$(bindir)/ssmtp
++	$(INSTALL) -d -m 755 $(DESTDIR)$(mandir)
++	$(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(DESTDIR)$(mandir)/ssmtp.8
++	$(INSTALL) -d -m 755 $(DESTDIR)$(SSMTPCONFDIR)
++	$(INSTALL) -m 644 $(srcdir)/revaliases $(DESTDIR)$(INSTALLED_REVALIASES_FILE)
++	$(GEN_CONFIG) $(DESTDIR)$(INSTALLED_CONFIGURATION_FILE)
+ 
+ 
+ .PHONY: install-sendmail
+ install-sendmail: install
+-	$(RM) $(bindir)/sendmail
+-	$(LN_S) ssmtp $(bindir)/sendmail
+-	$(INSTALL) -d -m 755 $(libexecdir)
+-	$(RM) $(libexecdir)/sendmail
+-	$(LN_S) sendmail /lib/sendmail
+-	$(RM) $(mandir)/sendmail.8
+-	$(LN_S) ssmtp.8 $(mandir)/sendmail.8
++	$(RM) $(DESTDIR)$(bindir)/sendmail
++	$(LN_S) ssmtp $(DESTDIR)$(bindir)/sendmail
++	$(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
++	$(RM) $(DESTDIR)$(libexecdir)/sendmail
++	$(LN_S) sendmail $(DESTDIR)/lib/sendmail
++	$(RM) $(DESTDIR)$(mandir)/sendmail.8
++	$(LN_S) ssmtp.8 $(DESTDIR)$(mandir)/sendmail.8
+ 
+ .PHONY: uninstall
+ uninstall:
+-	$(RM) $(bindir)/ssmtp
+-	$(RM) $(mandir)/ssmtp.8
+-	$(RM) $(CONFIGURATION_FILE) $(REVALIASES_FILE)
+-	$(RM) -r $(SSMTPCONFDIR)
++	$(RM) $(DESTDIR)$(bindir)/ssmtp
++	$(RM) $(DESTDIR)$(mandir)/ssmtp.8
++	$(RM) $(DESTDIR)$(CONFIGURATION_FILE) $(DESTDIR)$(REVALIASES_FILE)
++	$(RM) -r $(DESTDIR)$(SSMTPCONFDIR)
+ 
+ .PHONY: uninstall-sendmail
+ uninstall-sendmail: uninstall
+-	$(RM)  $(bindir)/sendmail /lib/sendmail
+-	$(RM)  $(mandir)/sendmail.8
++	$(RM)  $(DESTDIR)$(bindir)/sendmail $(DESTDIR)/lib/sendmail
++	$(RM)  $(DESTDIR)$(mandir)/sendmail.8
+ 
+ # Binaries:
+ ssmtp: $(OBJS)
+-	$(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS)
++	$(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS) $(LDFLAGS)
+ 
+ .PHONY: clean
+ clean:
diff --git a/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb b/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
new file mode 100644
index 0000000..9d4864d
--- /dev/null
+++ b/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
@@ -0,0 +1,31 @@ 
+SUMMARY = "extremely simple MTA to get mail off the system to a mail hub"
+HOMEPAGE = "http://packages.qa.debian.org/s/ssmtp.html"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+
+SRC_URI = "\
+           ${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.bz2 \
+           file://build-ouside_srcdir.patch \
+           file://use-DESTDIR.patch \
+          "
+
+EXTRA_OECONF += "--mandir=${mandir}"
+
+EXTRA_OEMAKE = "GEN_CONFIG='/bin/true'"
+
+SRC_URI[md5sum] = "65b4e0df4934a6cd08c506cabcbe584f"
+SRC_URI[sha256sum] = "22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36"
+
+inherit autotools pkgconfig
+
+DEPENDS += "openssl inetutils"
+
+do_install_append () {
+    install -d ${D}${mandir}/
+    mv ${D}${exec_prefix}/man/* ${D}${mandir}/
+    rmdir ${D}${exec_prefix}/man
+    ln -s ssmtp ${D}${sbindir}/sendmail
+    ln -s ssmtp ${D}${sbindir}/newaliases
+    ln -s ssmtp ${D}${sbindir}/mailq
+}