pkgsrc/lang/python/egg.mk

46 lines
1.6 KiB
Makefile
Raw Normal View History

# $NetBSD: egg.mk,v 1.18 2014/12/06 15:17:08 rodent Exp $
#
# Common logic to handle Python Eggs
#
2009-02-17 18:32:38 +01:00
.include "../../mk/bsd.fast.prefs.mk"
.include "../../lang/python/pyversion.mk"
# This file should be included to package python "distributions" which
2011-12-16 13:57:17 +01:00
# use setuptools to create an egg. Some distributions use distutils,
# which creates an egg-info file; those should use distutils.mk
EGG_NAME?= ${DISTNAME}
EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
PYDISTUTILSPKG= yes
PY_PATCHPLIST= yes
2011-12-16 13:57:17 +01:00
# True eggs always have an egg-info directory, and thus there is no
# PLIST conditional (as in distutils.mk for old versions of python).
# Note that we substitute EGG_INFODIR rather than EGG_FILE, because
# the egg information in an egg comprises multiple files in an
# egg-info directory.
# The PLIST substitution of EGG_NAME is not necessary. However, it
# is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem
# packages to understand other examples of this feature in non-python
# packages.
2011-12-16 13:57:17 +01:00
2007-08-09 15:25:31 +02:00
PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR}
2008-09-10 18:33:38 +02:00
PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \
"$${EGG_INFODIR}") }
PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
"$${EGG_NAME}-nspkg.pth") }
_PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed
.if ${_USE_DESTDIR} == "no"
_PYSETUPTOOLSINSTALLARGS+= --root=/
.endif
DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.6c9:../../devel/py-setuptools
INSTALLATION_DIRS+= ${PYSITELIB}
.include "../../lang/python/extension.mk"