summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7890e992b28b49548b4291cd23c8c95bb74c1dee (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
# Maintainer: Jah Way <jahway603 at protonmail dot com>

pkgname=libbtc-git
_pkgname=libbtc
pkgver=r526.0793399
pkgrel=1
pkgdesc='Tiny Bitcoin Library written in C with bitcointool CLI tool'
url='https://github.com/libbtc/libbtc'
arch=('x86_64')
license=('MIT')
makedepends=('git')
depends=('glibc' 'libevent')
provides=('libbtc')
conflicts=('libbtc')
source=("git+$url.git"
        "https://raw.githubusercontent.com/jahway603/libbtc/master/LICENSE")
sha256sums=('SKIP'
            '521d039fe41ccb983129b3a1d307ed7e413b4c4eb3d3c7616edd42633b588a11')

# https://wiki.archlinux.org/title/VCS_package_guidelines
pkgver() {
  cd "$srcdir/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  cd ${_pkgname}
  echo "starting autogen..."
  ./autogen.sh
  echo "starting configure..."
  ./configure
  echo "starting compile..."
  make -j$(nproc)
}

package() {
  install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"
  install -Dm755 "$srcdir/${_pkgname}/bitcoin-send-tx" "$pkgdir/opt/${_pkgname}/bitcoin-send-tx"
  install -Dm755 "$srcdir/${_pkgname}/bitcoin-spv" "$pkgdir/opt/${_pkgname}/bitcoin-spv"
  install -Dm755 "$srcdir/${_pkgname}/bitcointool" "$pkgdir/opt/${_pkgname}/bitcointool"

  install -d "$pkgdir/usr/bin"
  ln -s /opt/${_pkgname}/bitcoin-send-tx "$pkgdir/usr/bin"
  ln -s /opt/${_pkgname}/bitcoin-spv "$pkgdir/usr/bin"
  ln -s /opt/${_pkgname}/bitcointool "$pkgdir/usr/bin"
}