Fixup fromcvs/togit conversion
[pkgsrcv2.git] / lang / python / egg.mk
1 # $NetBSD: egg.mk,v 1.13 2011/12/16 12:57:17 gdt Exp $
2 #
3 # Common logic to handle Python Eggs
4 #
5 .include "../../mk/bsd.fast.prefs.mk"
6 .include "../../lang/python/pyversion.mk"
7
8 # This file should be included to package python "distributions" which
9 # use setuptools to create an egg.  Some distributions use distutils,
10 # which creates an egg-info file; those should use distutils.mk
11
12 EGG_NAME?=      ${DISTNAME}
13
14 PYDISTUTILSPKG= yes
15 PY_PATCHPLIST=  yes
16
17 # True eggs always have an egg-info directory, and thus there is no
18 # PLIST conditional (as in distutils.mk for old versions of python).
19 # Note that we substitute EGG_INFODIR rather than EGG_FILE, because
20 # the egg information in an egg comprises multiple files in an
21 # egg-info directory.
22
23 # XXX The PLIST substitution of EGG_NAME does not appear to be
24 # necessary.  Either it should be removed or a comment added
25 # explaining why it is necessary.
26
27 PLIST_SUBST+=   EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
28 PLIST_SUBST+=   EGG_INFODIR=${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
29 PRINT_PLIST_AWK+=       { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \
30                                "$${EGG_INFODIR}") }
31 PRINT_PLIST_AWK+=       { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
32                                "$${EGG_NAME}-nspkg.pth") }
33
34 _PYSETUPTOOLSINSTALLARGS=       --single-version-externally-managed
35 .if ${_USE_DESTDIR} == "no"
36 _PYSETUPTOOLSINSTALLARGS+=      --root=/
37 .endif
38
39 .if ${_PYTHON_VERSION} == "31" || ${_PYTHON_VERSION} == "32"
40 DEPENDS+=       ${PYPKGPREFIX}-distribute-[0-9]*:../../devel/py-distribute
41 .else
42 DEPENDS+=       ${PYPKGPREFIX}-setuptools>=0.6c9:../../devel/py-setuptools
43 .endif
44
45 INSTALLATION_DIRS+=     ${PYSITELIB}
46
47 .include "../../lang/python/extension.mk"