# $Id: PKGBUILD 138116 2015-08-08 07:35:33Z alucryd $
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Adrian Sampson <adrian@radbox.org>

pkgname=beets
pkgver=1.3.14
pkgrel=2
pkgdesc='Flexible music library manager and tagger'
arch=('any')
url='http://beets.radbox.org/'
license=('MIT')
depends=('mutagen' 'python2-enum34' 'python2-jellyfish' 'python2-munkres'
         'python2-musicbrainzngs' 'python2-setuptools' 'python2-unidecode'
         'python2-yaml')
optdepends=('bash-completion: Bash completion'
            'gst-plugins-bad: ReplayGain plugin'
            'gst-plugins-good: ReplayGain plugin'
            'gst-plugins-ugly: ReplayGain plugin'
            'gst-libav: ReplayGain plugin'
            'gst-python: ReplayGain plugin'
            'gstreamer0.10-bad-plugins: Chromaprint/Acoustid/BPD plugins'
            'gstreamer0.10-good-plugins: Chromaprint/Acoustid/BPD plugins'
            'gstreamer0.10-ugly-plugins: Chromaprint/Acoustid/BPD plugins'
            'gstreamer0.10-ffmpeg: Chromaprint/Acoustid/BPD plugins'
            'gstreamer0.10-python: Chromaprint/Acoustid/BPD plugins'
            'imagemagick: Thumbnails plugin'
            'python2-flask: Web plugin'
            'python2-gobject: ReplayGain plugin'
            'python2-pathlib: Thumbnails plugin'
            'python2-pyacoustid: Chromaprint/Acoustid plugin'
            'python2-pylast: LastGenre plugin'
            'python2-requests: FetchArt plugin'
            'python2-xdg: Thumbnails plugin')
source=("https://github.com/sampsyo/beets/releases/download/v${pkgver}/beets-${pkgver}.tar.gz"
        'https://raw.githubusercontent.com/sampsyo/beets/master/extra/_beet'
        'beet')
sha256sums=('9edf3da761fdebabdff7adc5258e47416249481bb450acd403cb52e7487563c2'
            '51c23b07ae5b4d67bd3d9f1c6ec3187a04b18d805e0b198951c6b63c67d34715'
            'b081285b202f82d09802ebca73d28bbf1902179ad3a820e4c0157f80bf959d89')

build() {
  cd beets-${pkgver}

  python2 setup.py build
}

package() {
  cd beets-${pkgver}

  python2 setup.py install --root="${pkgdir}" --optimize='1'

  install -dm 755 "${pkgdir}"/etc/bash_completion.d
  install -m 644 ../beet "${pkgdir}"/etc/bash_completion.d/
  install -dm 755 "${pkgdir}"/usr/share/zsh/site-functions
  install -m 644 ../_beet "${pkgdir}"/usr/share/zsh/site-functions/

  install -dm 755 "${pkgdir}"/usr/share/man/man{1,5}
  install -m 644 man/beet.1 "${pkgdir}"/usr/share/man/man1/
  install -m 644 man/beetsconfig.5 "${pkgdir}"/usr/share/man/man5/

  install -dm 755 "${pkgdir}"/usr/share/licenses/beets
  install -m 644 LICENSE "${pkgdir}"/usr/share/licenses/beets/
}

# vim: ts=2 sw=2 et:
