git » aubio.git » commit b7dccd1

Upgrading to 0.4.6. Splitting python modules out into python{,2}-aubio packages.

author David Runge
2018-02-11 14:46:26 UTC
committer David Runge
2018-02-11 14:46:26 UTC
parent 129073f6301b740078cd5036d90b6c63ca96096a

Upgrading to 0.4.6. Splitting python modules out into python{,2}-aubio packages.

.contrib +0 -2
PKGBUILD +62 -26

diff --git a/.contrib b/.contrib
deleted file mode 100644
index 08c232f..0000000
--- a/.contrib
+++ /dev/null
@@ -1,2 +0,0 @@
-# Contributor: Peter Baldwin <bald_pete@hotmail.com>
-# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>
diff --git a/PKGBUILD b/PKGBUILD
index aea7b65..856a5dc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,43 +1,79 @@
+# Maintainer: David Runge <dave@sleepmap.de>
 # Maintainer: Ray Rashif <schiv@archlinux.org>
 # Contributor: Tobias Kieslich tobias [funnychar] archlinux org
-# Contributor: see .contrib
 
-pkgname=aubio
-pkgver=0.4.2
-pkgrel=2
+pkgbase=aubio
+pkgname=('aubio' 'python-aubio' 'python2-aubio')
+pkgver=0.4.6
+pkgrel=1
 pkgdesc="A tool for extracting annotations from audio signals"
 arch=('x86_64')
-url="http://aubio.org/"
-license=('GPL')
-depends=('fftw' 'jack' 'ffmpeg')
-makedepends=('python2-numpy' 'python2-setuptools')
-optdepends=('python2-numpy: Python 2.x interface')
-source=("http://aubio.org/pub/$pkgname-$pkgver.tar.bz2")
-md5sums=('c0f6d8355e92669722501c3a762ba548')
+url="https://aubio.org/"
+license=('GPL3')
+makedepends=('doxygen' 'ffmpeg' 'fftw' 'jack' 'libsamplerate' 'libsndfile'
+'python-numpy' 'python-setuptools' 'python-sphinx' 'python2-numpy'
+'python2-setuptools' 'python2-sphinx' 'txt2man')
+source=("https://${pkgname}.org/pub/${pkgname}-${pkgver}.tar.bz2")
+sha512sums=('0e5cab0c88d51f2fb70c0d85e1c067a7b3758fbffdbd5026686726379aa36203adb63ed3f8e40c83ea02930e0ffc4e6c246803f1d518d448d47a01984678e77d')
 
 prepare() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  # python2 compat (for python interface)
-  sed -i 's:bin/env python:bin/env python2:' \
-      "$srcdir/$pkgname-$pkgver/python/lib/aubio/__init__.py"
+  cp -av "${pkgname[0]}-${pkgver}" "${pkgname[1]}-${pkgver}"
+  cp -av "${pkgname[0]}-${pkgver}" "${pkgname[2]}-${pkgver}"
+  cd "${pkgname[2]}-${pkgver}"
+  # python2 shebang
+  sed -e '1s/python/&2/' -i "python/lib/${pkgname}/"{__init__,cmd,cut}.py -i "python/tests/"*.py
 }
 
 build() {
-  cd "$srcdir/$pkgname-$pkgver"
-
-  python2 waf configure --prefix=/usr --enable-fftw3f --libdir=/usr/lib
-  python2 waf build $MAKEFLAGS
-  (cd python && python2 setup.py build) # python interface
+  cd "${pkgname[0]}-${pkgver}"
+  python2 waf configure --prefix=/usr \
+    --enable-fftw3 \
+    --htmldir=/usr/share/doc/${pkgname} \
+    --docdir=/usr/share/doc/${pkgname} \
+    --libdir=/usr/lib
+  python2 waf build
+  cd ../"${pkgname[1]}-${pkgver}"
+  python setup.py build
+  cd ../"${pkgname[2]}-${pkgver}"
+  python2 setup.py build
 }
 
-package() {
-  cd "$srcdir/$pkgname-$pkgver"
+package_aubio() {
+  depends=('ffmpeg' 'fftw' 'jack' 'libsamplerate' 'libsndfile')
+  optdepends=('python2-numpy: Python 2.x interface'
+              'python-numpy: Python 3.x interface')
+  cd "${pkgname[0]}-${pkgver}"
+  python2 waf --destdir="${pkgdir}" install
+  # move doc, as waf configure doesn't honor the htmldir and docdir settings
+  mv -v "${pkgdir}/usr/share/doc/lib${pkgname}-doc" \
+    "${pkgdir}/usr/share/doc/${pkgname}"
+  install -t "${pkgdir}/usr/share/doc/${pkgname}/" \
+    -vDm644 {AUTHORS,ChangeLog,README.md}
+}
 
-  python2 waf --destdir="$pkgdir" install
+package_python-aubio() {
+  depends=('aubio' 'python-numpy')
+  cd "${pkgname[1]}-${pkgver}"
+  python setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
+  install -t "${pkgdir}/usr/share/doc/${pkgname}/" \
+    -vDm644 {AUTHORS,ChangeLog,README.md}
+}
 
-  # python interface
-  (cd python && python2 setup.py install --root="$pkgdir" --optimize=1)
+package_python2-aubio() {
+  depends=('aubio' 'python2-numpy')
+  cd "${pkgname[2]}-${pkgver}"
+  python2 setup.py install --skip-build \
+    --optimize=1 \
+    --prefix=/usr \
+    --root="${pkgdir}"
+  install -t "${pkgdir}/usr/share/doc/${pkgname}/" \
+    -vDm644 {AUTHORS,ChangeLog,README.md}
+  # move duplicates
+  mv -v ${pkgdir}/usr/bin/aubio ${pkgdir}/usr/bin/aubio2
+  mv -v ${pkgdir}/usr/bin/aubiocut ${pkgdir}/usr/bin/aubiocut2
 }
 
 # vim:set ts=2 sw=2 et: