git: 5e056a3f1a8b - main - dns/dnscap: Use REINPLACE_CMD instead of patch files

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Mon, 25 Oct 2021 21:58:34 UTC
The branch main has been updated by sunpoet:

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

commit 5e056a3f1a8b3736c90dee49788203ee58c4a7ed
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2021-10-25 21:23:44 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2021-10-25 21:46:32 +0000

    dns/dnscap: Use REINPLACE_CMD instead of patch files
---
 dns/dnscap/Makefile                    |  3 ---
 dns/dnscap/files/patch-configure.ac    | 11 +++++++++++
 dns/dnscap/files/patch-src-config.h.in | 13 +++++++++++++
 dns/dnscap/files/patch-src-dump_cbor.c | 13 +++++++++++++
 dns/dnscap/files/patch-src-dump_cds.c  | 13 +++++++++++++
 5 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/dns/dnscap/Makefile b/dns/dnscap/Makefile
index 27871dd53cdd..76751d4557bd 100644
--- a/dns/dnscap/Makefile
+++ b/dns/dnscap/Makefile
@@ -32,9 +32,6 @@ CDS_CONFIGURE_OFF=	ac_cv_lib_tinycbor_cbor_parser_init=no
 CDS_LIB_DEPENDS=	libtinycbor.so:devel/tinycbor
 THREADS_CONFIGURE_ENABLE=	threads
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|\(HAVE_\)\(CBOR_CBOR_H\)|\1TINY\2|; s|cbor/cbor.h|tiny&|' ${WRKSRC}/configure.ac ${WRKSRC}/src/dump_cbor.c ${WRKSRC}/src/dump_cds.c
-
 post-patch-DOCS-off:
 	@${REINPLACE_CMD} -e '/^install-data-am: / s| install-dist_docDATA||' ${WRKSRC}/Makefile.am
 
diff --git a/dns/dnscap/files/patch-configure.ac b/dns/dnscap/files/patch-configure.ac
new file mode 100644
index 000000000000..719ed0ea6447
--- /dev/null
+++ b/dns/dnscap/files/patch-configure.ac
@@ -0,0 +1,11 @@
+--- configure.ac.orig	2021-03-11 15:59:57 UTC
++++ configure.ac
+@@ -112,7 +112,7 @@ AC_HEADER_RESOLV
+ AC_HEADER_TIME
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h])
+ AC_CHECK_HEADERS([sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h])
+-AC_CHECK_HEADERS([ldns/ldns.h arpa/nameser_compat.h cbor.h cbor/cbor.h])
++AC_CHECK_HEADERS([ldns/ldns.h arpa/nameser_compat.h cbor.h tinycbor/cbor.h])
+ AC_CHECK_HEADERS([sys/time.h])
+ AC_CHECK_HEADERS([zlib.h])
+ AC_CHECK_HEADERS([openssl/conf.h openssl/evp.h openssl/err.h])
diff --git a/dns/dnscap/files/patch-src-config.h.in b/dns/dnscap/files/patch-src-config.h.in
new file mode 100644
index 000000000000..5852ebecde71
--- /dev/null
+++ b/dns/dnscap/files/patch-src-config.h.in
@@ -0,0 +1,13 @@
+--- src/config.h.in.orig	2021-03-11 16:02:41 UTC
++++ src/config.h.in
+@@ -9,8 +9,8 @@
+ /* Define to 1 if you have the <arpa/nameser.h> header file. */
+ #undef HAVE_ARPA_NAMESER_H
+ 
+-/* Define to 1 if you have the <cbor/cbor.h> header file. */
+-#undef HAVE_CBOR_CBOR_H
++/* Define to 1 if you have the <tinycbor/cbor.h> header file. */
++#undef HAVE_TINYCBOR_CBOR_H
+ 
+ /* Define to 1 if you have the <cbor.h> header file. */
+ #undef HAVE_CBOR_H
diff --git a/dns/dnscap/files/patch-src-dump_cbor.c b/dns/dnscap/files/patch-src-dump_cbor.c
new file mode 100644
index 000000000000..cea1f8186640
--- /dev/null
+++ b/dns/dnscap/files/patch-src-dump_cbor.c
@@ -0,0 +1,13 @@
+--- src/dump_cbor.c.orig	2021-02-12 16:29:40 UTC
++++ src/dump_cbor.c
+@@ -60,8 +60,8 @@
+ #if HAVE_LIBTINYCBOR
+ 
+ #include <ldns/ldns.h>
+-#if HAVE_CBOR_CBOR_H
+-#include <cbor/cbor.h>
++#if HAVE_TINYCBOR_CBOR_H
++#include <tinycbor/cbor.h>
+ #endif
+ #if HAVE_CBOR_H
+ #include <cbor.h>
diff --git a/dns/dnscap/files/patch-src-dump_cds.c b/dns/dnscap/files/patch-src-dump_cds.c
new file mode 100644
index 000000000000..c54cefb95322
--- /dev/null
+++ b/dns/dnscap/files/patch-src-dump_cds.c
@@ -0,0 +1,13 @@
+--- src/dump_cds.c.orig	2021-02-12 16:29:40 UTC
++++ src/dump_cds.c
+@@ -42,8 +42,8 @@
+ #if HAVE_LIBTINYCBOR
+ 
+ #include <stdlib.h>
+-#if HAVE_CBOR_CBOR_H
+-#include <cbor/cbor.h>
++#if HAVE_TINYCBOR_CBOR_H
++#include <tinycbor/cbor.h>
+ #endif
+ #if HAVE_CBOR_H
+ #include <cbor.h>