aboutsummaryrefslogtreecommitdiffstats
path: root/community/go-ipfs/APKBUILD
blob: ad5317a2e1df832ac54920ce03bfe6e1d5751691 (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
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=go-ipfs
pkgver=0.5.0
pkgrel=0
pkgdesc="Inter Platnetary File System (IPFS), a peer-to-peer hypermedia distribution protocol"
url="https://ipfs.io/"
arch="x86_64 x86 aarch64 armhf armv7"
license="MIT Apache-2.0"
pkgusers="ipfs"
pkggroups="ipfs"
options="chmod-clean !check" # No test suite from upstream
makedepends="make go bash binutils-gold git"
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
}

sha512sums="2ce1c281552df656376a9a0600eaa106651a9fca4c452aac9995cf28ad592aa2851b223c55f03cf71a4ed9b12adcceb2fad274d50b2764a219936724b94b23de  go-ipfs-0.5.0.tar.gz
3e51e9a3dca1b991e8549f8354f7c2cfd1bb9b73d7a59557878d5c9ab4189988676d789172af3ba1fd57193ec48ca9125919507b0de7d0400ce0d6166622e556  ipfs.initd
c55afeb3efe381d18258ddf00f58325b77156375cf223fb2daa049df056efe22e9139cce0f81dc4c73759dad5097af5f3201414beb5950bd894df9ae8c7c4ed1  ipfs.confd"