python{2,3}-magic split, rm & update to 5.18

This commit is contained in:
Manuel UtG 2014-06-05 16:37:34 +00:00
parent 6b38dd2704
commit a9735a9bbf
3 changed files with 41 additions and 30 deletions

41
python-magic/PKGBUILD Normal file
View File

@ -0,0 +1,41 @@
# Maintainer: Manuel 'UtG' <utg[dot]chakra.linux[at]gmail[dot]com>
pkgbase=python-magic
pkgname=(python2-magic python3-magic)
pkgver=5.18
pkgrel=1
pkgdesc="Python bindings to the magic library"
arch=('x86_64')
url='http://darwinsys.com/file/'
license=('custom')
makedepends=('python2' 'python3' 'python2-setuptools' 'python3-setuptools')
source=("ftp://ftp.astron.com/pub/file/file-${pkgver}.tar.gz")
md5sums=('d420d8f2990cd344673acfbf8d76ff5a')
install=$pkgbase.install
prepare() {
cp -r file-${pkgver} python2-file-${pkgver}
}
package_python3-magic() {
depends=('python3' 'file')
cd "${srcdir}/file-${pkgver}/python"
python3 setup.py install --root="${pkgdir}" --optimize=1
install -Dm0644 "${srcdir}/file-${pkgver}/COPYING" \
"${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
package_python2-magic() {
depends=('python2' 'file')
cd "${srcdir}/python2-file-${pkgver}/python"
#mkdir -p "${pkgdir}/usr/lib/python2.7/lib-dynload"
#cp build/lib/magic.py "${pkgdir}/usr/lib/python2.7/lib-dynload/"
python2 setup.py install --root="${pkgdir}" --optimize=1
install -Dm0644 "${srcdir}/python2-file-${pkgver}/COPYING" \
"${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}

View File

@ -1,30 +0,0 @@
# Maintainer: Ernesto Manríquez <alejandronova@gmail.com>
pkgname=python2-magic
pkgver=5.14
pkgrel=1
pkgdesc='Python bindings to allow you to access the libmagic api.'
arch=('i686' 'x86_64')
url='http://darwinsys.com/file/'
license=('custom')
depends=('file' 'python2')
conflicts=('python-magic')
replaces=('python-magic')
provides=('python-magic')
install=$pkgname.install
source=("ftp://ftp.astron.com/pub/file/file-${pkgver}.tar.gz")
md5sums=('c26625f1d6773ad4bc5a87c0e315632c')
build() {
cd "file-${pkgver}/python"
sed -i 's@/usr/bin/python@/usr/bin/python2@' ../magic/Magdir/python
python2 setup.py build
}
package() {
cd "file-${pkgver}/python"
mkdir -p "${pkgdir}/usr/lib/python2.7/lib-dynload"
cp build/lib/magic.py "${pkgdir}/usr/lib/python2.7/lib-dynload/"
install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm644 "${srcdir}/file-${pkgver}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}