git: c6cdeed14b62 - main - textproc/code2html: adopt and improve this useful port

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Tue, 29 Apr 2025 20:33:22 UTC
The branch main has been updated by danfe:

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

commit c6cdeed14b625d3d589c44ab7d0485d1e8422dac
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2025-04-29 20:31:28 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2025-04-29 20:31:28 +0000

    textproc/code2html: adopt and improve this useful port
    
    - Undeprecate: the author is aware that there probably are other
      syntax highlighters around that are faster and more versatile
      these days, but then, if it works, why look for something else?
    - Define LICENSE (MIT), do not hardcode GZIP_CMD in sed(1) call
    - Install available documentation files (subject to DOCS option)
---
 textproc/code2html/Makefile | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/textproc/code2html/Makefile b/textproc/code2html/Makefile
index 3ac4ed0fb765..085878ef0ec7 100644
--- a/textproc/code2html/Makefile
+++ b/textproc/code2html/Makefile
@@ -5,12 +5,12 @@ CATEGORIES=	textproc
 MASTER_SITES=	SF \
 		http://www.palfrader.org/code2html/all/
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	Sourcecode to HTML converter
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Source code to HTML converter
 WWW=		https://www.palfrader.org/code2html/
 
-DEPRECATED=	Obsolete utility, last activity upstream in 2002
-EXPIRATION_DATE=2025-04-30
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 NO_BUILD=	yes
 USES=		perl5 shebangfix
@@ -18,18 +18,25 @@ USE_PERL5=	run
 SHEBANG_FILES=	code2html
 
 PLIST_FILES=	bin/code2html share/man/man1/code2html.1.gz
+PORTDOCS=	CREDITS ChangeLog README
 
-do-configure:
+OPTIONS_DEFINE=	DOCS
+
+post-patch:
 	@${REINPLACE_CMD} \
 		-e 's|/usr/bin/bzip2|${BZIP2_CMD}|' \
-		-e 's|/bin/gzip|/usr/bin/gzip|' \
-		-e 's|/etc/|${PREFIX}/etc/|' \
+		-e 's|/bin/gzip|${GZIP_CMD:[1]}|' \
+		-e 's|/etc/|${PREFIX}&|' \
 		${WRKSRC}/code2html
-	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|' \
+	@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}&|' \
 		${WRKSRC}/code2html.1
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKSRC}/code2html ${STAGEDIR}${PREFIX}/bin
 	${INSTALL_MAN} ${WRKSRC}/code2html.1 ${STAGEDIR}${PREFIX}/share/man/man1
 
+do-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
+
 .include <bsd.port.mk>