freebsd-ports/devel/py-backports/Makefile
Nikolai Lifanov 1ff674eb16 add devel/py-backports - namespace shim for Python backports
Currently, all py-backports.* ports conflict with each other
over a file that has the same contents.

This creates a port that installs the shared file and py-backports.*
ports should depend on this one and remove the shared file from their
own pkg-plist. It's the same approach as the one taken by OpenBSD.

Some ports are already converted as an example:
- security/py-backports.ssl_match_hostname
- devel/py-backports.functools_lru_cache
- devel/py-backports.shutil_get_terminal_size

The last two conversions and the fix to work with FLAVORS were submitted
by antoine. Thank you!

Reviewed by:	antoine
Approved by:	portmgr (antoine)
Differential Revision:	https://reviews.freebsd.org/D11095
2017-12-05 15:00:03 +00:00

38 lines
1.2 KiB
Makefile

# $FreeBSD$
PORTNAME= backports
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
PORTVERSION= 1
CATEGORIES= devel python
DISTFILES=
MAINTAINER= lifanov@FreeBSD.org
COMMENT= Shared namespace shim for py-backports.* ports
LICENSE= MIT
NO_FETCH= yes
NO_BUILD= yes
NO_ARCH= yes
USES= python
USE_PYTHON= flavors
.include <bsd.port.pre.mk>
.if ${PYTHON_MAJOR_VER} == 2
PLIST_FILES= ${PYTHON_SITELIBDIR}/backports/__init__.py \
${PYTHON_SITELIBDIR}/backports/__init__.pyc \
${PYTHON_SITELIBDIR}/backports/__init__.${PYTHON_PYOEXTENSION}
.else
PLIST_FILES= ${PYTHON_SITELIBDIR}/backports/__init__.py \
${PYTHON_SITELIBDIR}/backports/__pycache__/__init__.cpython-${PYTHON_SUFFIX}.pyc \
${PYTHON_SITELIBDIR}/backports/__pycache__/__init__.cpython-${PYTHON_SUFFIX}.${PYTHON_PYOEXTENSION}
.endif
do-install:
${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/backports
${ECHO_CMD} "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__init__.py
${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
.include <bsd.port.post.mk>