83 lines
2.7 KiB
Bash
83 lines
2.7 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
|
|
_realname=ukpostcodeparser
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=1.1.2
|
|
pkgrel=2
|
|
pkgdesc="UK Postcode parser (mingw-w64)"
|
|
arch=('any')
|
|
url='https://github.com/hamstah/ukpostcodeparser'
|
|
license=('MIT')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
|
|
"${MINGW_PACKAGE_PREFIX}-python3"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_realname}-$pkgver.tar.gz"::"https://github.com/hamstah/ukpostcodeparser/archive/v$pkgver.tar.gz")
|
|
sha512sums=('8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
for builddir in python{2,3}-build-${CARCH}; do
|
|
rm -rf ${builddir} | true
|
|
cp -r "${_realname}-${pkgver}" "${builddir}"
|
|
done
|
|
# Set version for setuptools_scm
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
|
|
}
|
|
|
|
build() {
|
|
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
|
|
}
|
|
|
|
check() {
|
|
for pver in {2,3}; do
|
|
msg "Python ${pver} test for ${CARCH}"
|
|
cd "${srcdir}/python${pver}-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python${pver} -m unittest discover -s ukpostcodeparser/test -p '*.py' || warning "Tests failed"
|
|
done
|
|
}
|
|
|
|
package_python3-ukpostcodeparser() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python3")
|
|
|
|
cd "${srcdir}/python3-build-${CARCH}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
|
|
--root="${pkgdir}" --optimize=1 --skip-build
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
|
|
}
|
|
|
|
package_python2-ukpostcodeparser() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python2")
|
|
|
|
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
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
|
|
}
|
|
|
|
package_mingw-w64-i686-python2-ukpostcodeparser() {
|
|
package_python2-ukpostcodeparser
|
|
}
|
|
|
|
package_mingw-w64-i686-python3-ukpostcodeparser() {
|
|
package_python3-ukpostcodeparser
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python2-ukpostcodeparser() {
|
|
package_python2-ukpostcodeparser
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python3-ukpostcodeparser() {
|
|
package_python3-ukpostcodeparser
|
|
}
|