msmtp: msmtp-scripts: Enable PROVIDES and ALTERNATIVES
authorDaniel F. Dickinson <redacted>
Wed, 16 Jan 2019 07:56:33 +0000 (02:56 -0500)
committerDaniel F. Dickinson <redacted>
Thu, 8 Aug 2019 06:02:06 +0000 (02:02 -0400)
Use the PROVIDES mechanism so that msmtp and msmtp-nossl can be be
+depended-on and avoid generating a file level conflict.  Also use
alternatives for msmtp-mta and msmtpq-ng-mta with msmtp-mta since
we can only have one sendmail at a time.

Signed-off-by: Daniel F. Dickinson <redacted>
mail/msmtp-scripts/Makefile
mail/msmtp/Makefile

index 3e38d4896316a3599d4f8d2a11e89f83880d0a09..480e11c807ce7bd36cd1cf27bb926b27f572f243 100644 (file)
@@ -41,7 +41,7 @@ endef
 
 define Package/msmtpq-ng
 $(call Package/msmtp-scripts/Default)
-  DEPENDS+= @(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
+  DEPENDS+= +msmtp
   TITLE+= (msmtpq-ng wrappers)
 endef
 
@@ -61,6 +61,12 @@ $(call Package/msmtp-scripts/Default)
   TITLE+= (as MTA)
   DEPENDS+=+msmtpq-ng
   USERID:=msmtp=482:msmtp=482
+  ALTERNATIVES:=\
+    400:/usr/sbin/sendmail:/usr/bin/msmtpq-ng-mta \
+    400:/usr/lib/sendmail:/usr/bin/msmtpq-ng-mta \
+    400:/usr/sbin/mailq:/usr/bin/msmtpq-ng-queue-mta \
+    400:/usr/sbin/postqueue:/usr/bin/msmtpq-ng-queue-mta \
+    400:/usr/sbin/postsuper:/usr/sin/msmtpq-ng-queue-mta
 endef
 
 define Package/msmtp-queue-mta/conffiles
@@ -126,11 +132,6 @@ define Package/msmtpq-ng-mta/install
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/msmtpq-ng-mta/msmtpq-ng-queue-mta $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc/crontabs
        $(INSTALL_BIN) ./files/msmtpq-ng-mta.init $(1)/etc/init.d/msmtpq-ng-mta
-       ln -sf ../bin/msmtpq-ng-mta $(1)/usr/sbin/sendmail
-       ln -sf ../bin/msmtpq-ng-mta $(1)/usr/lib/sendmail
-       ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/mailq
-       ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postqueue
-       ln -sf ../bin/msmtpq-ng-queue-mta $(1)/usr/sbin/postsuper
 endef
 
 define Package/msmtpq-ng-mta-smtpd/install
index 17b1ae17dedf90de827908c8ad4f7bc576c04094..3595949a454a920cb8b1e56d2255f0a5fc8af149 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=msmtp
 PKG_VERSION:=1.8.5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://marlam.de/msmtp/releases
@@ -49,6 +49,7 @@ $(call Package/msmtp/Default)
   DEPENDS+= +libgnutls +ca-bundle
   TITLE+= (with SSL support)
   VARIANT:=ssl
+  DEFAULT_VARIANT:=1
 endef
 
 define Package/msmtp/conffiles
@@ -64,6 +65,7 @@ define Package/msmtp-nossl
 $(call Package/msmtp/Default)
   TITLE+= (without SSL support)
   VARIANT:=nossl
+  PROVIDES:=msmtp
 endef
 
 define Package/msmtp-nossl/description
@@ -74,7 +76,10 @@ endef
 define Package/msmtp-mta
 $(call Package/msmtp/Default)
   TITLE+= (as MTA)
-  DEPENDS+=@(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
+  DEPENDS+=+msmtp
+  ALTERNATIVES:=\
+       100:/usr/sbin/sendmail:/usr/bin/msmtp \
+       100:/usr/lib/sendmail:/usr/bin/msmtp
 endef
 
 define Package/msmtp-mta/description
@@ -85,7 +90,7 @@ endef
 
 define Package/msmtp-queue
 $(call Package/msmtp/Default)
-  DEPENDS+= +bash @(PACKAGE_msmtp||PACKAGE_msmtp-nossl)
+  DEPENDS+= +bash +msmtp
   TITLE+= (queue scripts)
 endef
 
@@ -119,8 +124,6 @@ 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)
git clone https://git.99rst.org/PROJECT