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

pkgname=bootstrap-dht-git
pkgver=r131.g679c661
pkgrel=2
pkgdesc="Bittorrent DHT bootstrap server"
arch=('i686' 'x86_64')
url="https://github.com/bittorrent/bootstrap-dht"
license=('MIT')
depends=('gcc-libs' 'boost-libs')
makedepends=('git' 'boost')
provides=("bootstrap-dht=$pkgver")
conflicts=('bootstrap-dht')
source=("git+https://github.com/bittorrent/bootstrap-dht.git"
        "0001-Fix-compilation-with-boost-1.86.patch::https://github.com/bittorrent/bootstrap-dht/commit/a928a42298c8f088b8fbd729074874fd33043a08.patch"
        "0002-Remove-non-existent-header.patch::https://github.com/bittorrent/bootstrap-dht/commit/ec453c1115aae78a28d392f948a87cb0d1be575b.patch")
sha256sums=('SKIP'
            '485369fae20e6c358a5e72a9d681b1d7063bef64c6ee045723d4b4ebfc30c3d8'
            'a3c61ac5930fc5d3f5d640cc3eb58a4c49057c442ca623896c2cc70406dde646')


prepare() {
  cd "bootstrap-dht"

  patch -Np1 -i "$srcdir/0001-Fix-compilation-with-boost-1.86.patch"
  patch -Np1 -i "$srcdir/0002-Remove-non-existent-header.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,torture} -t "$pkgdir/usr/bin"
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/bootstrap-dht"
}