[BACK]Return to pypi.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk / fetch

Annotation of pkgsrc/mk/fetch/pypi.mk, Revision 1.2

1.2     ! rodent      1: # $NetBSD: pypi.mk,v 1.1 2015/07/01 00:55:34 rodent Exp $
1.1       rodent      2: #
                      3: # pypi.python.org master site handling
                      4: #
                      5: # To use, set in the pkgsrc Makefile:
                      6: #
                      7: # DISTNAME=    pyfoo-1.0.0
                      8: # MASTER_SITES=        ${MASTER_SITE_PYPI}
                      9: #
                     10: # Then, PKGNAME and HOMEPAGE will be set automatically (can be overridden).
                     11: #
                     12: # Keywords: pypi python
                     13:
                     14: .if defined(MASTER_SITES) && !empty(MASTER_SITES:C,^https:\/\/pypi.python.org\/packages\/source\/$,match,:Mmatch)
                     15: _USE_PYPI=             YES
                     16: .endif
                     17:
                     18: .if defined(_USE_PYPI) && !defined(DISTNAME)
                     19: PKG_FAIL_REASON+=      "DISTNAME must be set when MASTER_SITES = MASTER_SITE_PYPI."
                     20: .endif
                     21:
                     22: .if defined(_USE_PYPI) && !empty(_USE_PYPI:MYES)
                     23: _PYPI_DEFAULT_DISTFILES=       ${DISTNAME}${EXTRACT_SUFX}
                     24:
                     25: # For: https://pypi.python.org/packages/source/p/pyfoo/
                     26: _PYPI_PACKAGE_PATH=            ${DISTNAME:S/-${PKGVERSION_NOREV}//1}
                     27:
                     28: # For: https://pypi.python.org/packages/source/p/
                     29: _PYPI_PATH_INDEX=              ${_PYPI_PACKAGE_PATH:C/^([[:alnum:]]{1}).*$/\1/1}
                     30:
                     31: SITES.${_PYPI_DEFAULT_DISTFILES}=      ${MASTER_SITES:=${_PYPI_PATH_INDEX}/${_PYPI_PACKAGE_PATH}/}
                     32:
                     33: # Lets us override PKGNAME in the pkgsrc Makefile if necessary.
                     34: # No need to sacrifice convenience otherwise.
                     35: .if defined(PKGNAME) && ${PKGNAME} == ${DISTNAME}
                     36: PKGNAME=                       ${PYPKGPREFIX}-${DISTNAME}
                     37: .endif
                     38:
                     39: # Makes: https://pypi.python.org/pypi/pyfoo/1.0.0 and saves an HTTP redirect.
1.2     ! rodent     40: HOMEPAGE?=                     https://pypi.python.org/pypi/${_PYPI_PACKAGE_PATH}
1.1       rodent     41: .endif

CVSweb <webmaster@jp.NetBSD.org>