summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 48c7204b90d3f7af4a90d7d6d41f7d9e4a752d13 (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
65
66
67
68
69
70
71
72
73
74
# Maintainer: Haruue Icymoon <i@haruue.moe>
# Contributor: Tim Diels <timdiels.m@gmail.com>

pkgname=electroneum-git
pkgver=0.11.0.0.r13.g2769728b
pkgrel=1
pkgdesc='Secure, private, mobile based cryptocurrency, git version'
arch=('any')
url='https://electroneum.com'
license=('custom')
makedepends=('cmake' 'git' 'boost' 'unbound' 'openssl-1.0')
depends=('openssl-1.0')
#checkdepends=('gtest')
optdepends=(
  'miniupnpc: NAT punching'
  'libunwind: stack traces'
  'ldns: SSL toolkit'
  'expat: XML parsing'
  'doxygen: documentation'
  'graphviz: documentation'
)
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}=$pkgver")
source=("electroneum"::"git+https://github.com/electroneum/electroneum.git"
        electroneumd.service
        0001-archlinux-openssl-1.0.patch)
md5sums=('SKIP'
         'f1f3fa56808e8baba7fd3319b23ceb1c'
         'ae1bcb862a92f9996a08a0025d828e0f')
#options=('!strip')
backup=('etc/electroneumd.conf')
install=electroneum.install

pkgver() {
  cd "${srcdir}/${pkgname%-git}"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${srcdir}/${pkgname%-git}"

  # compile against openssl-1.0 
  patch -Np1 -i ../0001-archlinux-openssl-1.0.patch
}

build() {
  cd "${srcdir}/${pkgname%-git}"
  # Note: plain make fails with undeclared DIFFICULTY_TARGET_V1
  # make release-static fails when compiling with e.g. -j8
  make -j1 release-static
}

# Tests always fail due to DIFFICULT_TARGET_V1 error, so we don't run them
#check() {
#    cd "$pkgname-$pkgver"
#    #make release-test
#}

package() {
  cd "${srcdir}/${pkgname%-git}"

  # Note: make has no install target. Static build means we don't need to
  # install lib.
  install -dm755 "$pkgdir/usr/bin/"
  install -Dm755 build/release/bin/* "$pkgdir/usr/bin/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE"

  # install conf file
  install -Dm644 utils/conf/electroneumd.conf "${pkgdir}/etc/electroneumd.conf"

  # using a modified service unit file to use another pid file path
  install -Dm644 "$srcdir/electroneumd.service" "${pkgdir}/usr/lib/systemd/system/electroneumd.service"
}