pkgsrc/lang/python/extension.mk
joerg e616abfb19 With the advent of Apache module prefixes the Python package prefix
might not the first component of PKGNAME_REQD. Change this to match
either py[0-9][0-9] or the same string after a hyphen.
2007-10-31 00:59:52 +00:00

42 lines
1.2 KiB
Makefile

# $NetBSD: extension.mk,v 1.17 2007/10/31 00:59:52 joerg Exp $
# derive a python version from the package name if possible
# optionally handled quoted package names
.if defined(PKGNAME_REQD)
PYTHON_VERSION_REQD?= ${PKGNAME_REQD:C/(^.*-|^)py([0-9][0-9])-.*/\2/}
.endif
.include "../../lang/python/pyversion.mk"
.if defined(PYBINMODULE)
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "vax"
PKG_FAIL_REASON+= "${PKGNAME} needs dynamic loading"
.endif
.endif
.if defined(PYDISTUTILSPKG)
.include "../../mk/bsd.prefs.mk"
PYSETUP?= setup.py
PYSETUPBUILDARGS?= #empty
PYSETUPINSTALLARGS?= #empty
PYSETUPOPTARGS?= -c -O1
_PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS}
.if ${_USE_DESTDIR} != "no"
_PYSETUPINSTALLARGS+= --root=${DESTDIR:Q}
.endif
PY_PATCHPLIST?= yes
PYSETUPSUBDIR?= #empty
do-build:
(cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \
${PYSETUP} build ${PYSETUPBUILDARGS})
do-install:
(cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \
${PYSETUP} "install" ${_PYSETUPINSTALLARGS})
.endif
.if defined(PY_PATCHPLIST)
PLIST_SUBST+= PYINC=${PYINC} PYSITELIB=${PYSITELIB}
.endif