summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3d92ca6bc3d552c2d8f782b1faf1a8beb004dd00 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=bootstrap-dht-git
pkgver=r131.g679c661
pkgrel=1
pkgdesc="Bittorrent DHT bootstrap server"
arch=('i686' 'x86_64')
url="https://github.com/bittorrent/bootstrap-dht"
license=('MIT')
depends=('glibc' 'boost-libs')
makedepends=('git' 'boost')
provides=("bootstrap-dht=$pkgver")
conflicts=('bootstrap-dht')
source=("git+https://github.com/bittorrent/bootstrap-dht.git"
        "boost.patch::https://github.com/bittorrent/bootstrap-dht/commit/131e4d2caccc227afa62837899123f424dccb296.patch")
sha256sums=('SKIP'
            '2984970318c71910e1e23093564f5048f9311ed0d4d16d1ef5623e9f9b86f331')


prepare() {
  cd "bootstrap-dht"

  patch -Np1 -i "$srcdir/boost.patch"
}

pkgver() {
  cd "bootstrap-dht"

  _rev=$(git rev-list --count --all)
  _hash=$(git rev-parse --short HEAD)
  printf "r%s.g%s" "$_rev" "$_hash"
}

build() {
  cd "bootstrap-dht"

  b2 \
    cflags="$CFLAGS" \
    cxxflags="$CXXFLAGS" \
    linkflags="$LDFLAGS" \
    release
}

check() {
  cd "bootstrap-dht/tests"

  b2 \
    cflags="$CFLAGS" \
    cxxflags="$CXXFLAGS" \
    linkflags="$LDFLAGS" \
    release
}

package() {
  cd "bootstrap-dht"

  install -Dm755 "dht-bootstrap" -t "$pkgdir/usr/bin"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/bootstrap-dht"
}