Annotation of pkgsrc/lang/python/egg.mk, revision 1.22
1.22 ! richard 1: # $NetBSD: egg.mk,v 1.21 2016/04/10 16:39:28 joerg Exp $
1.1 joerg 2: #
3: # Common logic to handle Python Eggs
4: #
1.8 joerg 5: .include "../../mk/bsd.fast.prefs.mk"
1.14 drochner 6: .include "../../lang/python/pyversion.mk"
1.1 joerg 7:
1.11 gdt 8: # This file should be included to package python "distributions" which
1.13 gdt 9: # use setuptools to create an egg. Some distributions use distutils,
10: # which creates an egg-info file; those should use distutils.mk
1.11 gdt 11:
1.20 wiz 12: EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
1.18 rodent 13: EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
1.6 epg 14:
1.1 joerg 15: PYDISTUTILSPKG= yes
16: PY_PATCHPLIST= yes
17:
1.13 gdt 18: # True eggs always have an egg-info directory, and thus there is no
19: # PLIST conditional (as in distutils.mk for old versions of python).
20: # Note that we substitute EGG_INFODIR rather than EGG_FILE, because
21: # the egg information in an egg comprises multiple files in an
22: # egg-info directory.
23:
1.18 rodent 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
26: # packages to understand other examples of this feature in non-python
27: # packages.
1.13 gdt 28:
1.2 joerg 29: PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
1.18 rodent 30: PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR}
1.5 epg 31: PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \
32: "$${EGG_INFODIR}") }
33: PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
34: "$${EGG_NAME}-nspkg.pth") }
1.1 joerg 35:
36: _PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed
37:
1.19 wiz 38: DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools
1.1 joerg 39:
40: INSTALLATION_DIRS+= ${PYSITELIB}
41:
1.22 ! richard 42: privileged-install-hook: fixup-egg-info
! 43: .PHONY: fixup-egg-info
! 44: fixup-egg-info: # ensure egg-info directory contents are always 644
! 45: ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}" && \
! 46: ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \
! 47: -exec ${CHMOD} ${SHAREMODE} '{}' +
! 48:
1.1 joerg 49: .include "../../lang/python/extension.mk"
CVSweb <webmaster@jp.NetBSD.org>