summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cf0a05430e5e5d407a1ae7c5df6b7911d268e1cb (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
75
76
77
78
# Maintainer: Louis Holbrook <dev@holbrook.no>
pkgname=go-swarm
pkgver=0.5.7
pkgrel=1
epoch=
pkgdesc="Censorship resistant storage and communication infrastructure for a truly sovereign digital society"
arch=('x86_64')
url="https://swarm.ethereum.org"
license=('LGPL3')
groups=(eth-swarm)
depends=()
makedepends=('go>=1.10.0' 'git')
checkdepends=()
optdepends=('python-scrypt' 'python-ecdsa' 'python-pycryptodome' 'go-ethereum' 'systemd')
provides=('go-swarm')
conflicts=()
replaces=()
backup=()
options=()
install=${pkgname}.install
changelog="CHANGELOG_v0.5.6"
source=("https://github.com/ethersphere/swarm/archive/v${pkgver}.tar.gz"
	"v${pkgver}.tar.gz.sig"
	"swarm-resources.tar.gz"
	"swarm-resources.tar.gz.sig"
	"README")
noextract=()
md5sums=("e2252e28aa4ff45ea1d3466f3643b835"
	"SKIP"
	"2fa858d7e4cb420ee9cdf53a33bf0a67"
	"SKIP"
	"02f48077fb06278a5b9eed4950b2ce3e")
validpgpkeys=("0826EDA1702D1E87C6E2875121D2E7BB88C2A746")
_pythonwalletdepends=1

prepare() {
	for m in ${optdepends[@]}; do
		if [ ! pacman -Qi $m &> /dev/null ]; then
			if [ $m =~ /^python-/ ]; then
				_pythonwalletdepends=0
			fi
		fi
	done

	export GOPATH=${srcdir}/go
	export SWARMPATH=${GOPATH}/src/github.com/ethersphere
	if [ -d "$GOPATH" ]; then
		rm -vrf "$GOPATH"
	fi
	if [ ! -d "${srcdir}/build" ]; then
		mkdir -vp "${srcdir}/build"
	fi
	if [ ! -d "$SWARMPATH" ]; then
		mkdir -vp "$SWARMPATH"
	fi
	mv -v ${srcdir}/swarm-${pkgver} ${SWARMPATH}/swarm
	
}

build() {
	msg "Building the swarm binary"
	msg2 "using gopath $GOPATH"
	go build -o build/swarm -v ${SWARMPATH}/swarm/cmd/swarm

}

check() {
	warning "still need to add checks"
}

package() {
	install -v -D -m0755 build/swarm ${pkgdir}/usr/local/bin/swarm
	install -v -D -m0644 systemd/swarm.service ${pkgdir}/usr/lib/systemd/system/swarm.service
	install -v -D -m0644 systemd/swarm.conf ${pkgdir}/usr/lib/sysusers.d/swarm.conf
	if [ ${_pythonwalletdepends} -eq 1 ]; then
		install -v -D -m0700 swarm-genkey.py ${pkgdir}/usr/local/bin/swarm-genkey
	fi
}