summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 60924c4eade47ca985e8b3ab98c87a35168bfee6 (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
# Maintainer: rany <rany at i2pmail dot org>

pkgname=popura-git
_pkgname="popura"
pkgver=0.3.15+popura2
pkgrel=2
pkgdesc="Popura ポプラ: alternative Yggdrasil network client"
arch=('i686' 'x86_64' 'armv7h' 'armv6h' 'aarch64')
url="https://github.com/popura-network/Popura"
license=('LGPLv3')
conflicts=('popura' 'yggdrasil' 'yggdrasil-git' 'yggdrasil' 'yggdrasil-openrc')
depends=('glibc')
makedepends=('git' 'go')
source=("popura::git+https://github.com/popura-network/Popura.git"
	'popura.sysusers')
sha512sums=('SKIP'
	'b78d1f5efeeba184588ba7bdb2249d976aec160daa59742e032983da1aedad062d15c7c97cba3eba69412a0f7904ee123d98b58f859892d71188c25624295c32')

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

build() {
	cd "${srcdir}/${_pkgname}"
	PKGNAME="${pkgname}" PKGVER="${pkgver}" \
		CGO_LDFLAGS="${LDFLAGS}" \
		GOFLAGS="-trimpath -buildmode=pie -mod=readonly" \
		./build -l "-linkmode external -extldflags \"${LDFLAGS}\""
}

package() {
	cd "${srcdir}/${_pkgname}"
	install -Dm755 "yggdrasil" "${pkgdir}/usr/bin/yggdrasil"
	install -Dm755 "yggdrasilctl" "${pkgdir}/usr/bin/yggdrasilctl"
	install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}"
	install -Dm644 "${srcdir}/popura.sysusers" "${pkgdir}/usr/lib/sysusers.d/popura.conf"
	install -Dm644 -t "${pkgdir}/usr/lib/systemd/system" \
		contrib/systemd/yggdrasil.service \
		contrib/systemd/yggdrasil-default-config.service
}