aboutsummaryrefslogtreecommitdiff
path: root/dns/py-dnspython/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'dns/py-dnspython/Makefile')
-rw-r--r--dns/py-dnspython/Makefile47
1 files changed, 35 insertions, 12 deletions
diff --git a/dns/py-dnspython/Makefile b/dns/py-dnspython/Makefile
index 26b0e378831a..52025d31d042 100644
--- a/dns/py-dnspython/Makefile
+++ b/dns/py-dnspython/Makefile
@@ -4,38 +4,61 @@
PORTNAME= dnspython
PORTVERSION= 1.10.0
CATEGORIES= dns python
-MASTER_SITES= http://www.dnspython.org/kits/${PORTVERSION}/
+MASTER_SITES= http://www.dnspython.org/kits${PORTVERSIONSUFFIX}/${PORTVERSION}/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+DISTNAME= ${PORTNAME}${PORTVERSIONSUFFIX}-${PORTVERSION}
MAINTAINER= rm@FreeBSD.org
-COMMENT= A DNS toolkit for Python
+COMMENT= DNS toolkit for Python
-USE_PYTHON= -2.7
-USE_PYDISTUTILS=yes
+USE_PYTHON= yes
+USE_PYDISTUTILS= yes
+PYDISTUTILS_PKGNAME= ${PORTNAME}${PORTVERSIONSUFFIX}
+PYDISTUTILS_NOEGGINFO= yes
OPTIONSFILE= ${PORT_DBDIR}/${PORTNAME}/options
OPTIONS_DEFINE= PYCRYPTO
PYCRYPTO_DESC= Enable pycrypto (part of dnssec needs it)
PORTDOCS= ChangeLog README
-EXAMPLE_FILES= ddns.py e164.py mx.py name.py reverse.py reverse_name.py xfr.py \
- zonediff.py
+DOCSDIR= ${PREFIX}/share/doc/${PYTHON_PKGNAMEPREFIX}${PORTNAME}
-.include <bsd.port.options.mk>
+EXAMPLE_FILES= ddns.py e164.py mx.py name.py reverse.py reverse_name.py \
+ xfr.py zonediff.py
+EXAMPLESDIR= ${PREFIX}/share/examples/${PYTHON_PKGNAMEPREFIX}${PORTNAME}
+
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_MAJOR_VER} < 3
+PORTVERSIONSUFFIX=
+PLIST= ${PKGDIR}/pkg-plist-py2
+.else
+PORTVERSIONSUFFIX=3
+PLIST= ${PKGDIR}/pkg-plist-py3
+EXAMPLESDIR:= ${EXAMPLESDIR}3
+.endif
+
+PLIST_SUB+= PORTVERSION=${PORTVERSION} PYTHON_VER=${PYTHON_VER}
+
+post-patch:
+ for example in ${EXAMPLE_FILES} ; \
+ do ${REINPLACE_CMD} -e 's|python3|${PYTHON_VERSION}|1' \
+ ${WRKSRC}/examples/$${example} ; \
+ done
post-install:
# docs
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${DOCSDIR}
-.for file in ${PORTDOCS}
- @${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
+.for docfile in ${PORTDOCS}
+ @${INSTALL_DATA} ${WRKSRC}/${docfile} ${DOCSDIR}
.endfor
.endif
# examples
.if ${PORT_OPTIONS:MEXAMPLES}
@${MKDIR} ${EXAMPLESDIR}
-.for file in ${EXAMPLE_FILES}
- @${INSTALL_DATA} ${WRKSRC}/examples/${file} ${EXAMPLESDIR}
+.for docfile in ${EXAMPLE_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/examples/${docfile} ${EXAMPLESDIR}
.endfor
.endif
# permission safeness
@@ -46,4 +69,4 @@ post-install:
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pycrypto>0:${PORTSDIR}/security/py-pycrypto
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>