summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2af95cae6608bcc6605bd2692c62f449dc7d7700 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: txtsd <aur.archlinux@ihavea.quest>

pkgname=extracker-git
_pkgname="${pkgname%-git}"
__pkgname=ExTracker
pkgver=r191.face96f
pkgrel=1
pkgdesc='A highly parallel bittorrent tracker made in Elixir'
arch=(x86_64)
url='https://github.com/Dahrkael/ExTracker'
license=('Apache-2.0')
depends=(
  bash
  gcc-libs
  glibc
  ncurses
  openssl
  zlib
)
makedepends=(
  elixir
  erlang-asn1
  erlang-public_key
  erlang-sasl
  erlang-ssl
  git
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
options=(!debug)
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${__pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${__pkgname}"
  mix local.hex --force && mix local.rebar --force
  mix deps.get
}

build() {
  cd "${__pkgname}"
  mix deps.compile
  mix compile
  mix release ${_pkgname}
}

check() {
  cd "${__pkgname}"
  mix test
}

package() {
  cd "${__pkgname}"

  install -dm755 "${pkgdir}/usr/bin"
  install -dm755 "${pkgdir}/opt/${_pkgname}"
  cp -r "_build/dev/rel/extracker" "${pkgdir}/opt"
  ln -s "/opt/${_pkgname}/bin/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
}