| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: egg.mk,v 1.23 2016/06/01 09:44:52 wiz Exp $ | | 1 | # $NetBSD: egg.mk,v 1.24 2016/08/28 09:40:35 richard Exp $ |
2 | # | | 2 | # |
3 | # Common logic to handle Python Eggs | | 3 | # Common logic to handle Python Eggs |
4 | # | | 4 | # |
5 | .include "../../mk/bsd.fast.prefs.mk" | | 5 | .include "../../mk/bsd.fast.prefs.mk" |
6 | .include "../../lang/python/pyversion.mk" | | 6 | .include "../../lang/python/pyversion.mk" |
7 | | | 7 | |
8 | # This file should be included to package python "distributions" which | | 8 | # This file should be included to package python "distributions" which |
9 | # use setuptools to create an egg. Some distributions use distutils, | | 9 | # use setuptools to create an egg. Some distributions use distutils, |
10 | # which creates an egg-info file; those should use distutils.mk | | 10 | # which creates an egg-info file; those should use distutils.mk |
11 | | | 11 | |
12 | EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} | | 12 | EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} |
13 | EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info | | 13 | EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info |
14 | | | 14 | |
| @@ -22,26 +22,28 @@ PY_PATCHPLIST= yes | | | @@ -22,26 +22,28 @@ PY_PATCHPLIST= yes |
22 | # egg-info directory. | | 22 | # egg-info directory. |
23 | | | 23 | |
24 | # The PLIST substitution of EGG_NAME is not necessary. However, it | | 24 | # The PLIST substitution of EGG_NAME is not necessary. However, it |
25 | # is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem | | 25 | # is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem |
26 | # packages to understand other examples of this feature in non-python | | 26 | # packages to understand other examples of this feature in non-python |
27 | # packages. | | 27 | # packages. |
28 | | | 28 | |
29 | PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX} | | 29 | PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX} |
30 | PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR} | | 30 | PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR} |
31 | PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \ | | 31 | PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \ |
32 | "$${EGG_INFODIR}") } | | 32 | "$${EGG_INFODIR}") } |
33 | PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \ | | 33 | PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \ |
34 | "$${EGG_NAME}-nspkg.pth") } | | 34 | "$${EGG_NAME}-nspkg.pth") } |
| | | 35 | PRINT_PLIST_AWK+= { gsub(/${PYVERSSUFFIX}/, \ |
| | | 36 | "$${PYVERSSUFFIX}") } |
35 | | | 37 | |
36 | _PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed | | 38 | _PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed |
37 | | | 39 | |
38 | DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools | | 40 | DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools |
39 | | | 41 | |
40 | INSTALLATION_DIRS+= ${PYSITELIB} | | 42 | INSTALLATION_DIRS+= ${PYSITELIB} |
41 | | | 43 | |
42 | privileged-install-hook: fixup-egg-info | | 44 | privileged-install-hook: fixup-egg-info |
43 | .PHONY: fixup-egg-info | | 45 | .PHONY: fixup-egg-info |
44 | fixup-egg-info: # ensure egg-info directory contents are always 644 | | 46 | fixup-egg-info: # ensure egg-info directory contents are always 644 |
45 | if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \ | | 47 | if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \ |
46 | ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \ | | 48 | ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \ |
47 | -exec ${CHMOD} ${SHAREMODE} '{}' +; \ | | 49 | -exec ${CHMOD} ${SHAREMODE} '{}' +; \ |