summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7499d34471b68afe5375edc887a3f5e426aadb4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Maintainer:  Oliver Jaksch <arch-aur@com-in.de>

pkgname=emulationstation-autoscraper
pkgver=1.4.5
pkgrel=2
pkgdesc="An auto-scraper for EmulationStation written in Go using hashes"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h')
url="https://github.com/sselph/scraper"
license=('custom')
makedepends=('git' 'go')

source=("https://github.com/sselph/scraper/archive/v${pkgver}.tar.gz")
sha256sums=('5e7496b7634126f5be81fdd88a20fe108f40d4a8a0089b2d07ae82ea2cea812c')

scraperdir="scraper-${pkgver}"

build() {
  # echo $arch # for later use on different arches
  mkdir -p "github.com/sselph"
  ln -s "${srcdir}/${scraperdir}" "${srcdir}/github.com/sselph/scraper"
  GOPATH="$(pwd)" && export GOPATH=$(echo ${GOPATH%src})
  echo $(go build github.com/sselph/scraper)
}

package() {
  cd "${srcdir}"
  strip "scraper"
  install -Dm755 "${srcdir}/scraper" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 "${srcdir}/${scraperdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
  for LIC in $(find "${srcdir}/${scraperdir}/vendor/github.com" -name LICENSE); do
    PKGNAME="$(echo ${LIC} | awk -F "/" '{print $(NF-1)}')"
    install -Dm644 "${LIC}" "${pkgdir}/usr/share/licenses/${pkgname}/license.${PKGNAME}"
  done
}