summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9842670559daae43b5880d6f3916a0219f8e0713 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: Donald Webster <fryfrog@gmail.com>

pkgname=trackarr
pkgver=1.8.3
pkgrel=1
pkgdesc="Send irc based tracker announcements to Sonarr, Radarr and/or Lidarr."
arch=('i686' 'x86_64' 'armv7h' 'armv6h' 'aarch64')
url="https://gitlab.com/cloudb0x/trackarr"
license=('GPL')
makedepends=(
  'go'
  'go.rice'
  'yarn'
)

source=(
  "https://gitlab.com/cloudb0x/trackarr/-/archive/v${pkgver}/trackarr-v${pkgver}.tar.bz2"
  'trackarr.tmpfiles'
  'trackarr.sysusers'
  'trackarr.service'
)
sha256sums=('edb4ed917babcbd2afeb9b9362fd825984a07d128239bf3976432af78303c54d'
            'ce3cf95823f61845cef3c266f9fcf686cf332c859ab7afffe7e5b7f765cba3fa'
            '3512f2f072b1945cf5809bf803cfc00871281bef83536aadac847f5542604c67'
            '7348fdd9e1bd48b8d5eb76abecd00fe621d64c27f211ca97d61dbbc4c71ffdea')

# Adapted from Makefile via `make -n`
prepare() {
  cd "${srcdir}/${pkgname}-v${pkgver}"
  go mod vendor

  cd "${srcdir}/${pkgname}-v${pkgver}/web/trackarr-ui" && yarn install && yarn build
  cd "${srcdir}/${pkgname}-v${pkgver}/web" && rice embed-go
}

build() {
  cd "${srcdir}/${pkgname}-v${pkgver}"
  go build -mod vendor -trimpath -ldflags "-extldflags $LDFLAGS -X main.buildVersion=${pkgver}" -o ${pkgname} .
}

package() {
  cd "${srcdir}/${pkgname}-v${pkgver}"
  install -D -m 0755 trackarr "${pkgdir}/usr/bin/trackarr"

  install -D -m 644 "${srcdir}/trackarr.sysusers" "${pkgdir}/usr/lib/sysusers.d/trackarr.conf"
  install -D -m 644 "${srcdir}/trackarr.service" "${pkgdir}/usr/lib/systemd/system/trackarr.service"
  install -D -m 644 "${srcdir}/trackarr.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/trackarr.conf"
}