freebsd-ports/devel/py-virtualenvwrapper/Makefile
Nicola Vitale 1c47f032a3 - Update to 3.5
- Add add-plist-post target to fix pkg-plist when Python
  version is >= 3.2
- Add devel/py-virtualenv-clone to RUN_DEPENDS
- Convert to the new options framework
- Remove http://www.doughellmann.com/* from MASTER_SITES
2012-06-30 21:04:00 +00:00

56 lines
1.7 KiB
Makefile

# New ports collection makefile for: py-virtualenvwrapper
# Date created: 2010-05-06
# Whom: Nicola Vitale <nivit@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= virtualenvwrapper
PORTVERSION= 3.5
PORTREVISION= 0
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= nivit@FreeBSD.org
COMMENT= A set of extensions to Virtual Python Environment builder
RUN_DEPENDS= ${PKGNAMEPREFIX}virtualenv>=1.4.8:${PORTSDIR}/devel/py-virtualenv \
${PKGNAMEPREFIX}virtualenv-clone>=0.2.4:${PORTSDIR}/devel/py-virtualenv-clone
USE_PYDISTUTILS= easy_install
# Python3 ready
USE_PYTHON= yes
DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
OPTIONS_DEFINE= DOCS
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS}
post-install:
${MKDIR} ${DOCSDIR}
cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${DOCSDIR}
.endif
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} >= 320
# When Python version is 3.2+ we rewrite all the filenames
# of TMPPLIST that end with .py[co], so that they conform
# to PEP 3147 (see http://www.python.org/dev/peps/pep-3147/)
PYMAGICTAG= ${PYTHON_CMD} -c 'import imp; print(imp.get_tag())'
add-plist-post:
@${AWK} '\
/\.py[co]$$/ && !($$0 ~ "/" pc "/") {id = match($$0, /\/[^\/]+\.py[co]$$/); if (id != 0) {d = substr($$0, 1, RSTART - 1); dirs[d] = 1}; sub(/\.py[co]$$/, "." mt "&"); sub(/[^\/]+\.py[co]$$/, pc "/&"); print; next} \
/^@dirrm / {d = substr($$0, 8); if (d in dirs) {print $$0 "/" pc}; print $$0; next} \
{print} \
END {if (sp in dirs) {print "@dirrm " sp "/" pc}} \
' \
pc="__pycache__" mt="$$(${PYMAGICTAG})" sp="${PYTHON_SITELIBDIR:S,${PYTHONBASE}/,,g}" \
${TMPPLIST} > ${TMPPLIST}.pyc_tmp
@${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST}
.endif
.include <bsd.port.post.mk>