git: 02ee212d4b7b - main - dns/openresolv: use pkg-message to show message on remove

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Wed, 27 Jul 2022 14:27:19 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=02ee212d4b7b1ce294710974f2d0b27e70324e7c

commit 02ee212d4b7b1ce294710974f2d0b27e70324e7c
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-07-27 13:41:46 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-07-27 14:27:11 +0000

    dns/openresolv: use pkg-message to show message on remove
---
 dns/openresolv/Makefile               |  4 +++-
 dns/openresolv/files/pkg-deinstall.in | 21 ---------------------
 dns/openresolv/files/pkg-message.in   | 13 +++++++++++++
 3 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/dns/openresolv/Makefile b/dns/openresolv/Makefile
index 70bb65e4a905..a73911b7b368 100644
--- a/dns/openresolv/Makefile
+++ b/dns/openresolv/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	openresolv
 PORTVERSION=	3.12.0
+PORTREVISION=	1
 CATEGORIES=	dns
 MASTER_SITES=	https://roy.marples.name/downloads/openresolv/
 
@@ -12,6 +13,7 @@ CPE_VENDOR=	${PORTNAME}_project
 GNU_CONFIGURE=	yes
 
 NO_ARCH=	yes
-SUB_FILES=	pkg-deinstall pkg-message
+SUB_FILES=	pkg-message
+SUB_LIST=	PORTNAME=${PORTNAME}
 
 .include <bsd.port.mk>
diff --git a/dns/openresolv/files/pkg-deinstall.in b/dns/openresolv/files/pkg-deinstall.in
deleted file mode 100644
index 5d6ab56e733a..000000000000
--- a/dns/openresolv/files/pkg-deinstall.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-case $2 in
-	DEINSTALL)
-		;;
-	POST-DEINSTALL)
-		echo "===> post-deinstallation information for $1"
-		echo ""
-		echo "Please note that $1 was not completely removed"
-		echo "from this system:"
-		echo ""
-		echo "/etc/resolv.conf should now be changed to be a regular"
-		echo "file and /var/run/resolvconf can be removed if openresolv"
-		echo "will no longer be used."
-		echo ""
-		;;
-	*)
-		exit 64
-		;;
-esac
-exit 0
diff --git a/dns/openresolv/files/pkg-message.in b/dns/openresolv/files/pkg-message.in
index e25daf854019..1b6c44026dc2 100644
--- a/dns/openresolv/files/pkg-message.in
+++ b/dns/openresolv/files/pkg-message.in
@@ -4,6 +4,19 @@
 To make sure openresolv runs correctly
 please symlink /etc/resolv.conf to
 %%PREFIX%%/etc/resolvconf/run/resolv.conf
+EOM
+},
+{ type: remove
+  message: <<EOM
+===> post-deinstallation information for %%PORTNAME%%
+
+Please note that %%PORTNAME%% was not completely removed
+from this system:
+
+/etc/resolv.conf should now be changed to be a regular
+file and /var/run/resolvconf can be removed if openresolv
+will no longer be used.
+
 EOM
 }
 ]