From dd79edaf88e0f329fdf6d96010d2490269945939 Mon Sep 17 00:00:00 2001
From: Yasuhiro Kimura <yasu@FreeBSD.org>
Date: Sat, 24 Oct 2020 05:41:56 +0900
Subject: [PATCH] dns/py-dnspython: Update to 2.1.0 for Python 3

While updating this port to 2.1.0 fixes runtime error "AttributeError:
module 'base64' has no attribute 'decodestring'" with python 3.9 or
later, it isn't compatible with Python 2.7. So update to 2.1.0 only
for Python 3.

ChangeLog:	https://github.com/rthalley/dnspython/blob/v2.1.0/doc/whatsnew.rst
---
 dns/py-dnspython/Makefile | 8 +++++++-
 dns/py-dnspython/distinfo | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dns/py-dnspython/Makefile b/dns/py-dnspython/Makefile
index ed72b3ffa45a..ba52900816d1 100644
--- a/dns/py-dnspython/Makefile
+++ b/dns/py-dnspython/Makefile
@@ -24,9 +24,15 @@ PYCRYPTODOME_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pycryptodome>=0:security/py-pyc
 PORTEXAMPLES=	ddns.py e164.py mx.py name.py reverse.py reverse_name.py \
 		xfr.py zonediff.py
 
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_MAJOR_VER} == 3
+PORTVERSION=	2.1.0
+.endif
+
 post-install-EXAMPLES-on:
 # examples
 	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
 	${INSTALL_DATA} ${PORTEXAMPLES:S,^,${WRKSRC}/examples/,} ${STAGEDIR}${EXAMPLESDIR}
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/dns/py-dnspython/distinfo b/dns/py-dnspython/distinfo
index 811b8c0e68c1..a4ae58940da3 100644
--- a/dns/py-dnspython/distinfo
+++ b/dns/py-dnspython/distinfo
@@ -1,3 +1,5 @@
-TIMESTAMP = 1547728483
+TIMESTAMP = 1613064959
 SHA256 (dnspython-1.16.0.zip) = 36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01
 SIZE (dnspython-1.16.0.zip) = 266364
+SHA256 (dnspython-2.1.0.zip) = e4a87f0b573201a0f3727fa18a516b055fd1107e0e5477cded4a2de497df1dd4
+SIZE (dnspython-2.1.0.zip) = 389021
-- 
2.34.1