git: 60abf2a4fd7b - main - mail/queue-repair: fix patch and refactor

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Tue, 09 May 2023 08:32:31 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=60abf2a4fd7b6dce1a7447259e2145cd3a243c8b

commit 60abf2a4fd7b6dce1a7447259e2145cd3a243c8b
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-05-08 12:55:50 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-09 08:27:49 +0000

    mail/queue-repair: fix patch and refactor
    
     - remove stray shebang, (q)nofiles changes from patch file
       (I ran makepatch, which picked up REINPLACE_CMD changes)
     - replace homegrown REINPLACE_CMD with USES=shebangfix
     - set NO_ARCH=yes, NO_BUILD=yes
     - express options-dependent commands in more declarative manner
    
    Fixes:          809ff8bfc9d4b3221ed5c5329d70d40ba3c8e900
    Reported by:    danfe
    Approved by:    portmgr (build fix, infrastructure blanket)
    MFH:            2023Q2
---
 mail/queue-repair/Makefile                     | 24 +++++++++++-------------
 mail/queue-repair/files/patch-queue__repair.py | 15 ---------------
 2 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/mail/queue-repair/Makefile b/mail/queue-repair/Makefile
index 451c4b9f79fe..11b4937f5e53 100644
--- a/mail/queue-repair/Makefile
+++ b/mail/queue-repair/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	queue-repair
 PORTVERSION=	0.9.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail python
 MASTER_SITES=	http://pyropus.ca/software/${PORTNAME}/
 
@@ -10,7 +10,11 @@ WWW=		http://pyropus.ca/software/queue-repair/
 
 LICENSE=	GPLv2
 
-USES=		python
+USES=		python shebangfix
+SHEBANG_FILES=	queue_repair.py
+
+NO_ARCH=	yes
+NO_BUILD=	yes
 
 OPTIONS_DEFINE=		DOCS QMAIL_PORT
 OPTIONS_DEFAULT=	QMAIL_PORT
@@ -18,25 +22,19 @@ QMAIL_PORT_DESC=	Depend on qmail port
 
 QMAIL_PORT_USES=	qmail:run
 
-.include <bsd.port.options.mk>
-
 PLIST_FILES=	bin/queue-repair
 PORTDOCS=	BLURB CHANGELOG TODO
 
-do-build:
-	${REINPLACE_CMD} -e 's,^#!/usr/bin/python,#!${PYTHON_CMD},' \
-		${WRKSRC}/queue_repair.py
-.if ${PORT_OPTIONS:MQMAIL_PORT}
+do-configure-QMAIL_PORT-on:
 	${REINPLACE_CMD} -e 's,nofiles,qnofiles,' ${WRKSRC}/queue_repair.py
-.endif
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/queue_repair.py ${STAGEDIR}${PREFIX}/bin/queue-repair
-.if ${PORT_OPTIONS:MDOCS}
+
+do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-. for f in ${PORTDOCS}
+.for f in ${PORTDOCS}
 	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
-. endfor
-.endif
+.endfor
 
 .include <bsd.port.mk>
diff --git a/mail/queue-repair/files/patch-queue__repair.py b/mail/queue-repair/files/patch-queue__repair.py
index e6bbfde3be65..28da582a4410 100644
--- a/mail/queue-repair/files/patch-queue__repair.py
+++ b/mail/queue-repair/files/patch-queue__repair.py
@@ -2,21 +2,6 @@ https://bz-attachments.freebsd.org/attachment.cgi?id=242009
 
 --- queue_repair.py.orig	2003-10-22 15:54:13 UTC
 +++ queue_repair.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/local/bin/python3.9
- '''queue_repair.py - qmail tools in Python.
- Copyright (C) 2001 Charles Cazabon <pqt @ discworld.dyndns.org>
- 
-@@ -58,7 +58,7 @@ users = {
- 
- groups = {
-     'qmail' : None,
--    'nofiles' : None,
-+    'qnofiles' : None,
- }
- 
- dirs = {
 @@ -66,24 +66,24 @@ dirs = {
      #   key: pathname - all paths are relative to conf-qmail
      #   data: (user, group, mode, split)