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:		809ff8bfc9
Reported by:	danfe
Approved by:	portmgr (build fix, infrastructure blanket)
MFH:		2023Q2
This commit is contained in:
Robert Clausecker
2023-05-09 10:27:49 +02:00
parent 9ee6f739e9
commit 60abf2a4fd
2 changed files with 11 additions and 28 deletions
+11 -13
View File
@@ -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>
@@ -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)