# $Id: PKGBUILD 314530 2018-04-05 22:37:21Z jgc $
# Maintainer: David Runge <dave@sleepmap.de>
# Contributor: speps <speps at aur dot archlinux dot org>
# Contributor: breakdown <breakdown(at)archlinux(dot)us>

pkgname=plowshare
pkgver=2.1.7
pkgrel=3
pkgdesc="Command-line downloader and uploader for Rapidshare, Mediafire and other file sharing websites."
arch=('any')
url="https://github.com/mcrapet/plowshare"
license=('GPL3')
depends=('curl' 'recode' 'js52' 'git')
optdepends=('bash-completion: enable bash auto completion'
            'imagemagick: X11 picture viewer for captchas'
            'sxiv: X11 picture viewer for captchas'
            'feh: X11 picture viewer for captchas'
            'qiv: X11 picture viewer for captchas'
            'fbida: framebuffer picture viewer for captchas'
            'libcaca: framebuffer ascii picture viewer for captchas')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha512sums=('7fe91d3756c55ffc1daf9275bfd2413f2644accd8fa69f2b1064696e1435f9b8be9515907c8249ffde85436dc6966f1d42bad94ccfbde93ae584dcc0d642c215')

prepare() {
  cd "${pkgname}-${pkgver}"
  # rename js executable to reflect js package
  sed -e 's|-js}|-js52}|' -i src/core.sh
  # force release version
  export PLOWSHARE_FORCE_VERSION="${pkgver}"
}

package() {
  cd "${pkgname}-${pkgver}"
  make install DESTDIR="${pkgdir}/" PREFIX=/usr
}
