diff --git a/mingw-w64-python2-backports.ssl_match_hostname/PKGBUILD b/mingw-w64-python2-backports.ssl_match_hostname/PKGBUILD new file mode 100644 index 0000000000..6636c992cc --- /dev/null +++ b/mingw-w64-python2-backports.ssl_match_hostname/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: J. Peter Mugaas + +_realname=backports.ssl_match_hostname +pkgbase=mingw-w64-python2-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}") +pkgver=3.5.0.1 +pkgrel=1 +pkgdesc="The ssl.match_hostname() function from Python 3.5 (mingw-w64)" +arch=('any') +url='https://pypi.python.org/pypi/backports.ssl_match_hostname' +license=('PSF') +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools") +depends=("${MINGW_PACKAGE_PREFIX}-python2-backports") +optdepends=("${MINGW_PACKAGE_PREFIX}-python2-ipaddress: for IPAddress ServerAltnames support") +options=('staticlibs' 'strip' '!debug') +source=("https://pypi.python.org/packages/source/b/backports.ssl_match_hostname/backports.ssl_match_hostname-$pkgver.tar.gz") +sha256sums=('502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2') + +prepare() { + cd "${srcdir}" + rm backports.ssl_match_hostname-$pkgver/backports/__init__.py + rm -rf python2-build-${CARCH} | true + cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}" + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver +} + +build() { + msg "Python 2 build for ${CARCH}" + cd "${srcdir}/python2-build-${CARCH}" + ${MINGW_PREFIX}/bin/python2 setup.py build +} + +package() { + cd "${srcdir}/python2-build-${CARCH}" + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \ + --root="${pkgdir}" --optimize=1 --skip-build +}