94 lines
3.3 KiB
Bash
94 lines
3.3 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
|
|
_pyname=ndg_httpsclient
|
|
_realname=ndg-httpsclient
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=0.5.0
|
|
pkgrel=2
|
|
pkgdesc="Provides enhanced HTTPS support for httplib and urllib2 using PyOpenSSL (mingw-w64)"
|
|
url='https://pypi.python.org/pypi/ndg-httpsclient'
|
|
license=('BSD')
|
|
arch=('any')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-pyasn1"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-pyasn1"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-pyopenssl"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-pyopenssl")
|
|
#_dtoken="6c/dd/4d4f1ad1158830b364beee70cb59f651018f36de24da80e52e47f80bc19f"
|
|
source=("${_realname}-${pkgver}.tar.gz"::"https://files.pythonhosted.org/packages/source/n/${_realname}/${_pyname}-${pkgver}.tar.gz")
|
|
sha256sums=('c009f5430790936b3a97eaf9f968516664d97e146ab2bda991f0caadb7cc088b')
|
|
|
|
prepare() {
|
|
cd ${srcdir}
|
|
cp -r ${_pyname}-${pkgver} python2-build-${CARCH}
|
|
cp -r ${_pyname}-${pkgver} python3-build-${CARCH}
|
|
}
|
|
|
|
build() {
|
|
cd "${srcdir}"
|
|
for pver in {2,3}; do
|
|
msg "Python ${pver} build for ${CARCH}"
|
|
cd "${srcdir}/python${pver}-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python${pver} setup.py build
|
|
done
|
|
}
|
|
|
|
package_python3-ndg-httpsclient() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python3-pyopenssl"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-pyasn1")
|
|
|
|
cd ${srcdir}/python3-build-${CARCH}
|
|
${MINGW_PREFIX}/bin/python3 setup.py build
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1
|
|
# fix python command in files
|
|
local PREFIX_WIN=$(cygpath -am ${MINGW_PREFIX})
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
|
|
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
|
|
done
|
|
}
|
|
|
|
package_python2-ndg-httpsclient() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python2-pyopenssl"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-pyasn1")
|
|
|
|
cd ${srcdir}/python2-build-${CARCH}
|
|
${MINGW_PREFIX}/bin/python2 setup.py build
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1
|
|
|
|
mv "${pkgdir}${MINGW_PREFIX}"/bin/ndg_httpclient{,2}.exe
|
|
mv "${pkgdir}${MINGW_PREFIX}"/bin/ndg_httpclient{,2}-script.py
|
|
if [ -e ${pkgdir}${MINGW_PREFIX}/bin/ndg_httpclient.exe.manifest ]
|
|
then
|
|
mv "${pkgdir}${MINGW_PREFIX}"/bin/ndg_httpclient{,2}.exe.manifest
|
|
fi
|
|
# fix python command in files
|
|
local PREFIX_WIN=$(cygpath -am ${MINGW_PREFIX})
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
|
|
sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
|
|
done
|
|
}
|
|
|
|
package_mingw-w64-i686-python2-ndg-httpsclient() {
|
|
install=${_realname}2-${CARCH}.install
|
|
package_python2-ndg-httpsclient
|
|
}
|
|
|
|
package_mingw-w64-i686-python3-ndg-httpsclient() {
|
|
install=${_realname}3-${CARCH}.install
|
|
package_python3-ndg-httpsclient
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python2-ndg-httpsclient() {
|
|
install=${_realname}2-${CARCH}.install
|
|
package_python2-ndg-httpsclient
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python3-ndg-httpsclient() {
|
|
install=${_realname}3-${CARCH}.install
|
|
package_python3-ndg-httpsclient
|
|
}
|