Files
MINGW-packages/mingw-w64-python-ldap/PKGBUILD
2018-10-19 07:31:39 +03:00

101 lines
2.8 KiB
Bash

# Maintainer: Smo <smo@xpra.org>
_realname=ldap
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=3.1.0
pkgrel=1
pkgdesc="LDAP client API for Python (mingw-w64)"
arch=('any')
url='https://github.com/python-ldap/python-ldap'
license=('LICENSE')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-openldap")
options=('staticlibs' 'strip' '!debug')
source=("https://github.com/python-ldap/python-ldap/archive/python-${_realname}-${pkgver}.tar.gz")
sha512sums=('9296dd334271374241946ac888649364e62af5ff57b2f62aa23eb8aec45c085c8b697010fda7682ac784c1f0b76d614550d0559758a039aefe6cff51639e8b07')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}
prepare() {
cd "${srcdir}"
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "python-${_realname}-python-${_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} setup.py check
done
}
package_python3-ldap() {
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 LICENCE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
}
package_python2-ldap() {
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 LICENCE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING"
}
package_mingw-w64-i686-python2-ldap() {
package_python2-ldap
}
package_mingw-w64-i686-python3-ldap() {
package_python3-ldap
}
package_mingw-w64-x86_64-python2-ldap() {
package_python2-ldap
}
package_mingw-w64-x86_64-python3-ldap() {
package_python3-ldap
}