git: 696a89a3ba4f - main - converters/dumpasn1: restore and update dumpasn1 port

From: Alex Dupre <ale_at_FreeBSD.org>
Date: Thu, 20 Jan 2022 08:53:31 UTC
The branch main has been updated by ale:

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

commit 696a89a3ba4fa7f2e4705c9d431f06de294f07e3
Author:     Alex Dupre <ale@FreeBSD.org>
AuthorDate: 2022-01-20 08:52:52 +0000
Commit:     Alex Dupre <ale@FreeBSD.org>
CommitDate: 2022-01-20 08:53:25 +0000

    converters/dumpasn1: restore and update dumpasn1 port
---
 MOVED                                      |  1 -
 converters/Makefile                        |  1 +
 converters/dumpasn1/Makefile               | 30 ++++++++++++++++++++++++++++++
 converters/dumpasn1/distinfo               |  5 +++++
 converters/dumpasn1/files/patch-dumpasn1.c | 16 ++++++++++++++++
 converters/dumpasn1/pkg-descr              |  7 +++++++
 converters/dumpasn1/pkg-plist              |  2 ++
 7 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/MOVED b/MOVED
index c25ce4ad63f2..a8bbe08d4ac7 100644
--- a/MOVED
+++ b/MOVED
@@ -14490,7 +14490,6 @@ comms/ath3k-firmware||2020-05-05|Has expired: Broken for more than 6 months
 comms/geoid||2020-05-05|Has expired: Broken for more than 6 months
 comms/jerm||2020-05-05|Has expired: Broken for more than 6 months
 comms/yaac||2020-05-05|Has expired: Broken for more than 6 months
-converters/dumpasn1||2020-05-05|Has expired: Broken for more than 6 months
 databases/elixir-exredis||2020-05-05|Has expired: Broken for more than 6 months
 databases/hamsterdb||2020-05-05|Has expired: Broken for more than 6 months
 databases/memcacheq||2020-05-05|Has expired: Broken for more than 6 months
diff --git a/converters/Makefile b/converters/Makefile
index 03e6e5d628fa..b8ef910b8a2b 100644
--- a/converters/Makefile
+++ b/converters/Makefile
@@ -22,6 +22,7 @@
     SUBDIR += convmv
     SUBDIR += dosunix
     SUBDIR += drg2sbg
+    SUBDIR += dumpasn1
     SUBDIR += enca
     SUBDIR += erlang-base64url
     SUBDIR += fconv
diff --git a/converters/dumpasn1/Makefile b/converters/dumpasn1/Makefile
new file mode 100644
index 000000000000..4d73c84f7e95
--- /dev/null
+++ b/converters/dumpasn1/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	dumpasn1
+PORTVERSION=	20210212
+CATEGORIES=	converters security
+MASTER_SITES=	https://www.cs.auckland.ac.nz/~pgut001/
+DISTFILES=	dumpasn1.c dumpasn1.cfg
+DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}
+EXTRACT_ONLY=	yes
+
+MAINTAINER=	ale@FreeBSD.org
+COMMENT=	Dumps the contents of an ASN.1 encoded file, e.g. an SSL certificate
+
+LICENSE=	DUMPASN1
+LICENSE_NAME=	dumpasn1 license
+LICENSE_TEXT=	You can use this code in whatever way you want, as long as you don't try to claim you wrote it
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+do-extract:
+	@${MKDIR} ${WRKSRC}
+	@${CP} ${DISTDIR}/${DIST_SUBDIR}/dumpasn1.c ${WRKSRC}
+
+do-build:
+	cd ${WRKSRC} && \
+	${CC} ${CFLAGS} -DCONFIG_NAME=\"${PREFIX}/share/dumpasn1/dumpasn1.cfg\" -o dumpasn1 dumpasn1.c
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/dumpasn1
+	${INSTALL_PROGRAM} ${WRKSRC}/dumpasn1 ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/dumpasn1.cfg ${STAGEDIR}${PREFIX}/share/dumpasn1
+
+.include <bsd.port.mk>
diff --git a/converters/dumpasn1/distinfo b/converters/dumpasn1/distinfo
new file mode 100644
index 000000000000..4763ca21ca96
--- /dev/null
+++ b/converters/dumpasn1/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1642600501
+SHA256 (dumpasn1-20210212/dumpasn1.c) = 319a85af8d75f95f16ecb6fd8a9b59aef22a0e3798e84c830027d1bead9adaeb
+SIZE (dumpasn1-20210212/dumpasn1.c) = 105725
+SHA256 (dumpasn1-20210212/dumpasn1.cfg) = 1d02cfea8fa556281aed3911f96db517a50017eaaaded562fe6683d008bd1fac
+SIZE (dumpasn1-20210212/dumpasn1.cfg) = 251987
diff --git a/converters/dumpasn1/files/patch-dumpasn1.c b/converters/dumpasn1/files/patch-dumpasn1.c
new file mode 100644
index 000000000000..88dc047b3670
--- /dev/null
+++ b/converters/dumpasn1/files/patch-dumpasn1.c
@@ -0,0 +1,16 @@
+--- dumpasn1.c.orig	2022-01-19 14:05:40 UTC
++++ dumpasn1.c
+@@ -382,11 +382,13 @@ static OIDINFO *oidList = NULL;
+    beginning with a '$' uses the appropriate environment variable.  In
+    addition under Unix we also walk down $PATH looking for it */
+ 
++#ifndef CONFIG_NAME
+ #ifdef __TANDEM_NSK__
+   #define CONFIG_NAME		"asn1cfg"
+ #else
+   #define CONFIG_NAME		"dumpasn1.cfg"
+ #endif /* __TANDEM_NSK__ */
++#endif
+ 
+ #if defined( __TANDEM_NSK__ )
+ 
diff --git a/converters/dumpasn1/pkg-descr b/converters/dumpasn1/pkg-descr
new file mode 100644
index 000000000000..e4885eed2ec8
--- /dev/null
+++ b/converters/dumpasn1/pkg-descr
@@ -0,0 +1,7 @@
+dumpasn1 is an ASN.1 parser which dumps the contents of an ASN.1-encoded
+file, as well as interpreting the OIDs contained in the file into
+human-readable format. Dumpasn1 is intended for examining the contents
+of PKI certificates and comes with a full list of security-related OIDs,
+but can be easily extended to parse other OIDs as well.
+
+WWW: http://www.cs.auckland.ac.nz/~pgut001/
diff --git a/converters/dumpasn1/pkg-plist b/converters/dumpasn1/pkg-plist
new file mode 100644
index 000000000000..315d6ebda84b
--- /dev/null
+++ b/converters/dumpasn1/pkg-plist
@@ -0,0 +1,2 @@
+bin/dumpasn1
+%%DATADIR%%/dumpasn1.cfg