]> git.sthu.org Git - smailq.git/commitdiff
Use update-alternative for Debian v1.3
authorRaphaƫl Droz <raphael.droz+floss@gmail.com>
Tue, 27 Oct 2020 19:27:42 +0000 (16:27 -0300)
committerStefan Huber <shuber@sthu.org>
Tue, 3 Nov 2020 16:07:11 +0000 (17:07 +0100)
Add ability to suffix sbin/sendmail and sbin/mailq, which is required
for conflict-free installations.

Use update-alternative for Debian so that smailq can be installed
alongside msmtpd (msmtp-mta on Debian)

Makefile
debian/control
debian/rules
debian/smailq.postinst [new file with mode: 0644]

index 76d1670385bc43f14f884b7a4446d59e15fd45d6..aa72315f3be33cb2397198755b945947561d340d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,12 @@
 PREFIX ?= /usr
+BIN_SUFFIX ?=
+
 # Where the script binary should go
 BINPATH = $(DESTDIR)$(PREFIX)/bin
 SBINPATH = $(DESTDIR)$(PREFIX)/sbin
 MANPATH = $(DESTDIR)$(PREFIX)/share/man/man1
 SHAREDIR = $(DESTDIR)$(PREFIX)/share/smailq
 CONFFILE = $(SHAREDIR)/smailq.conf.sample
-
 ######################################################################
 
 all: manpage
@@ -13,8 +14,8 @@ all: manpage
 install: all
        mkdir -p $(BINPATH) $(SBINPATH) $(MANPATH) $(SHAREDIR)
        install -m 0755 smailq $(BINPATH)/smailq
-       install -m 0755 mailq $(BINPATH)/mailq
-       install -m 0755 sendmail $(SBINPATH)/sendmail
+       install -m 0755 mailq $(BINPATH)/mailq$(BIN_SUFFIX)
+       install -m 0755 sendmail $(SBINPATH)/sendmail$(BIN_SUFFIX)
        install -m 0644 smailq.conf $(CONFFILE)
        install -m 0644 smailq.1 $(MANPATH)/smailq.1
 
index 9678f5f298442ae52c4a8b48d5065e97205e233d..80aa265ec1ab35e2d89d6745363dfcecfe164b42 100644 (file)
@@ -8,7 +8,6 @@ Standards-Version: 2.0.0-rc
 
 Package: smailq
 Replaces: mail-transport-agent
-Conflicts: mail-transport-agent
 Depends: python3
 Section: mail
 Architecture: all
index 1e24e4fe7580799573434a9cebe99a1a01ec4bf8..e38bfd576408fdd152f71bd062ab058589e90a8f 100755 (executable)
@@ -13,7 +13,7 @@ install: build
        dh_prep
        dh_installdirs
 
-       $(MAKE) install DESTDIR=$(CURDIR)/debian/smailq
+       $(MAKE) install DESTDIR=$(CURDIR)/debian/smailq BIN_SUFFIX=.smailq
 
 binary-indep: install
        dh_testdir
diff --git a/debian/smailq.postinst b/debian/smailq.postinst
new file mode 100644 (file)
index 0000000..efc62da
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+if [ -e /usr/share/debconf/confmodule ]; then
+    . /usr/share/debconf/confmodule
+fi
+
+#DEBHELPER#
+
+case "$1" in
+    configure)
+       update-alternatives --install /usr/sbin/sendmail sendmail /usr/sbin/sendmail.smailq 5 \
+                           --slave /usr/lib/sendmail lib-sendmail /usr/sbin/sendmail.smailq;
+       update-alternatives --set sendmail /usr/sbin/sendmail.smailq || true
+       update-alternatives --set lib-sendmail /usr/sbin/sendmail.smailq || true
+       ;;
+esac