aboutsummaryrefslogtreecommitdiffstats
path: root/testing/go-ipfs/APKBUILD
blob: cae9574d99a596abcd77e30eb831763fa509b34e (plain) (blame)
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
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=go-ipfs
pkgver=0.4.21
pkgrel=0
pkgdesc="Inter Platnetary File System (IPFS), a peer-to-peer hypermedia distribution protocol"
url="https://ipfs.io/"
arch="x86_64 x86"
license="MIT Apache-2.0"
pkgusers="ipfs"
pkggroups="ipfs"
options="!check" # No test suite from upstream
makedepends="make go bash git gx gx-go"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc $pkgname-openrc $pkgname-bash-completion:bashcomp:noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/ipfs/go-ipfs/archive/v$pkgver.tar.gz
	ipfs.initd
	ipfs.confd"
builddir="$srcdir/src/github.com/ipfs/go-ipfs"

prepare() {
	export GOPATH="$srcdir"

	mkdir -p  "$(dirname $builddir)"
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/

	default_prepare
}

build() {
	export GOPATH="$srcdir"
	export GOBIN="$GOPATH/bin"

	make build
}

package() {
	install -m755 -D cmd/ipfs/ipfs \
		"$pkgdir"/usr/bin/ipfs

	install -m644 -D -t "$pkgdir/usr/share/doc/$pkgname" README.md

	install -m755 -D "$srcdir"/ipfs.initd \
		"$pkgdir"/etc/init.d/ipfs
	install -m644 -D "$srcdir"/ipfs.confd \
		"$pkgdir"/etc/conf.d/ipfs

	install -dm750 -o ipfs -g ipfs "$pkgdir"/var/lib/ipfs
	install -dm755 "$pkgdir"/var/log/ipfs
}

bashcomp() {
	depends=""
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm 644 "$builddir"/misc/completion/ipfs-completion.bash \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

cleanup_srcdir() {
	[ -d src ] && chmod -R +w src; go clean -modcache;

	default_cleanup_srcdir
}

sha512sums="570ea2c126538b88264242bac961cabfed5bf964e3e4ff294978f96aaf931a3df9d5a82659255cefbeedc00b748b8933a28d9862a233760e35d4ae9993e18dad  go-ipfs-0.4.21.tar.gz
3e51e9a3dca1b991e8549f8354f7c2cfd1bb9b73d7a59557878d5c9ab4189988676d789172af3ba1fd57193ec48ca9125919507b0de7d0400ce0d6166622e556  ipfs.initd
c55afeb3efe381d18258ddf00f58325b77156375cf223fb2daa049df056efe22e9139cce0f81dc4c73759dad5097af5f3201414beb5950bd894df9ae8c7c4ed1  ipfs.confd"