python-olefile: Drop python2 package

This commit is contained in:
Alexey Pavlov
2019-12-18 08:22:49 +03:00
parent 9d47afed37
commit b1a787b8d0

View File

@@ -2,67 +2,39 @@
_realname=olefile
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgdesc="Python library to parse, read and write Microsoft OLE2 files (formerly OleFileIO_PL) (mingw-w64)"
pkgver=0.46
pkgrel=2
pkgrel=3
arch=('any')
license=('BSD')
url="https://www.decalage.info/olefile"
depends=()
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
depends=("${MINGW_PACKAGE_PREFIX}-python3")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
options=('staticlibs')
source=(${_realname}-${pkgver}.tar.gz::https://github.com/decalage2/olefile/archive/v${pkgver}.tar.gz)
sha256sums=('11d1a3810e50956c9360a4c76f1ecebf3e54f9d8406f75127bd0d296638488f4')
prepare() {
cd ${srcdir}
cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}"
rm -rf python3-build-${CARCH} | true
cp -r "${_realname}-${pkgver}" "python3-build-${CARCH}"
}
package_python3-olefile() {
pkgdesc="Python3 library to parse, read and write Microsoft OLE2 files (formerly OleFileIO_PL) (mingw-w64)"
depends+=("${MINGW_PACKAGE_PREFIX}-python3")
build() {
msg "Python 3 build for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py build
}
package() {
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
local _py3basever=$(${MINGW_PREFIX}/bin/python3 -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
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=0
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX#\/} --root="${pkgdir}/" --optimize=0 --skip-build
install -Dm644 doc/LICENSE.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
install -Dm644 README.md doc/* -t "${pkgdir}${MINGW_PREFIX}/share/doc/python3-${_realname}/README"
}
package_python2-olefile() {
pkgdesc="Python2 library to parse, read and write Microsoft OLE2 files (formerly OleFileIO_PL) (mingw-w64)"
depends+=("${MINGW_PACKAGE_PREFIX}-python2")
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
local _py2basever=$(${MINGW_PREFIX}/bin/python2 -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
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=0
install -Dm644 doc/LICENSE.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
install -Dm644 README.md doc/* -t "${pkgdir}${MINGW_PREFIX}/share/doc/python2-${_realname}/README"
}
package_mingw-w64-i686-python2-olefile() {
package_python2-olefile
}
package_mingw-w64-i686-python3-olefile() {
package_python3-olefile
}
package_mingw-w64-x86_64-python2-olefile() {
package_python2-olefile
}
package_mingw-w64-x86_64-python3-olefile() {
package_python3-olefile
}