python-ndg-httpsclient: Drop python2 package

This commit is contained in:
Alexey Pavlov
2019-12-17 14:18:44 +03:00
parent 6932d83745
commit 7493c7c31c
3 changed files with 10 additions and 89 deletions

View File

@@ -3,41 +3,32 @@
_pyname=ndg_httpsclient
_realname=ndg-httpsclient
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.5.1
pkgrel=3
pkgrel=4
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")
depends=("${MINGW_PACKAGE_PREFIX}-python3-pyopenssl"
"${MINGW_PACKAGE_PREFIX}-python3-pyasn1")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
install=${_realname}3-${CARCH}.install
source=("${_realname}-${pkgver}.tar.gz"::"https://files.pythonhosted.org/packages/source/n/${_realname}/${_pyname}-${pkgver}.tar.gz")
sha256sums=('d72faed0376ab039736c2ba12e30695e2788c4aa569c9c3e3d72131de2592210')
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
msg "Python 3 build for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py build
}
package_python3-ndg-httpsclient() {
depends=("${MINGW_PACKAGE_PREFIX}-python3-pyopenssl"
"${MINGW_PACKAGE_PREFIX}-python3-pyasn1")
package() {
cd ${srcdir}/python3-build-${CARCH}
${MINGW_PREFIX}/bin/python3 setup.py build
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
@@ -48,45 +39,3 @@ package_python3-ndg-httpsclient() {
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
}

View File

@@ -1,14 +0,0 @@
post_install() {
cd mingw32
local _prefix=$(pwd -W)
cd -
local _it
for _it in ndg_httpclient2; do
sed -e "s|/mingw32|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}

View File

@@ -1,14 +0,0 @@
post_install() {
cd mingw64
local _prefix=$(pwd -W)
cd -
local _it
for _it in ndg_httpclient2; do
sed -e "s|/mingw64|${_prefix}|g" \
-i ${_prefix}/bin/${_it}-script.py
done
}
post_upgrade() {
post_install
}