From 843fab534dfa5088eeab910e4982d63dbeed7b00 Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Mon, 4 Jul 2016 21:53:57 -0400 Subject: [PATCH 1/2] mail/msmtp: Remove use of symlink postinst/postrm Avoid the postrm/postinst symlink addition and removal as 1) This fails to conflict with other packages which also provide the same commands and makes what packages is supply the command depend on which command was installed last. 2) Trunk devs don't like postrm/postinst symlink mangling 3) Packages changing things from other packages is considered bad packaging pratice on most distros and debian, for example, prohibits it. Signed-off-by: Daniel Dickinson --- mail/msmtp/Makefile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mail/msmtp/Makefile b/mail/msmtp/Makefile index 0c3af6df6..9ea72427b 100644 --- a/mail/msmtp/Makefile +++ b/mail/msmtp/Makefile @@ -112,19 +112,7 @@ define Package/msmtp/install $(1)/etc/msmtprc $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/ -endef - -define Package/msmtp/postinst - [ -e $${IPKG_INSTROOT}/usr/sbin/sendmail ] || { - mkdir -p $${IPKG_INSTROOT}/usr/sbin - ln -sf ../bin/msmtp $${IPKG_INSTROOT}/usr/sbin/sendmail - } -endef - -define Package/msmtp/prerm - [ "../bin/msmtp" = "$(readlink -qs $${IPKG_INSTROOT}/usr/sbin/sendmail)" ] && { - rm -f $${IPKG_INSTROOT}/usr/sbin/sendmail - } + ln -s ../bin/msmtp $(1)/usr/sbin/sendmail endef Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles) From ee93d38db88b92933d0775d1078f1f00e8c0f96a Mon Sep 17 00:00:00 2001 From: Daniel Dickinson Date: Fri, 16 Sep 2016 21:49:08 -0400 Subject: [PATCH 2/2] mail/msmtp: Separate option to use msmtp as sendmail Make msmtp as MTA separate from msmtp package proper to allow msmtp-scripts (to be added) to use msmtp as the backend while providing the ability to act as the system MTA without msmtp getting in the way. Also get rid of symlinking in postinst/postrm as that is something the trunk devs don't like. In addition it allows the -mta package to conflict with any other package providing sendmail command, as it should (once the other packages also move postinst/postrm sendmail symlinks to install section). Signed-off-by: Daniel Dickinson --- mail/msmtp/Makefile | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/mail/msmtp/Makefile b/mail/msmtp/Makefile index 9ea72427b..09bf3c686 100644 --- a/mail/msmtp/Makefile +++ b/mail/msmtp/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=msmtp PKG_VERSION:=1.6.2 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/msmtp @@ -71,9 +71,21 @@ $(call Package/msmtp/Default/description) This package is built without SSL support. endef +define Package/msmtp-mta +$(call Package/msmtp/Default) + TITLE+= (as MTA) + DEPENDS+=@(PACKAGE_msmtp||PACAKGE_msmtp-nossl) +endef + +define Package/msmtp-mta/description +$(call Package/msmtp/Default/description) + This package add a link from sendmail to msmtp + and is built with SSL support. +endef + define Package/msmtp-queue $(call Package/msmtp/Default) - DEPENDS+= +bash + DEPENDS+= +bash @(PACKAGE_msmtp||PACKAGE_msmtp-nossl) TITLE+= (queue scripts) endef @@ -112,13 +124,16 @@ define Package/msmtp/install $(1)/etc/msmtprc $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/msmtp $(1)/usr/bin/ - ln -s ../bin/msmtp $(1)/usr/sbin/sendmail +endef + +define Package/msmtp-mta/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/lib + ln -sf ../bin/msmtp $(1)/usr/sbin/sendmail + ln -sf ../bin/msmtp $(1)/usr/lib/sendmail endef Package/msmtp-nossl/conffiles = $(Package/msmtp/conffiles) Package/msmtp-nossl/install = $(Package/msmtp/install) -Package/msmtp-nossl/postinst = $(Package/msmtp/postinst) -Package/msmtp-nossl/prerm = $(Package/msmtp/prerm) define Package/msmtp-queue/install $(INSTALL_DIR) $(1)/usr/bin @@ -129,3 +144,4 @@ endef $(eval $(call BuildPackage,msmtp)) $(eval $(call BuildPackage,msmtp-nossl)) $(eval $(call BuildPackage,msmtp-queue)) +$(eval $(call BuildPackage,msmtp-mta))