summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff6e128b6c21bc5eef960ff76803c8051ec0ae06 (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
# Maintainer: Tony Lambiris <tony@libpcap.net>

pkgname=chigo-git
pkgver=1.4.0.r2.gb3cb538
pkgrel=2
pkgdesc='Lolcat port for Golang'
url="https://github.com/UltiRequiem/chigo"
arch=('x86_64' 'i686')
license=('MIT')
makedepends=('git' 'go')
source=("${pkgname}::git+${url}")
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/${pkgname}"

	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

prepare() {
	cd "${srcdir}/${pkgname}"

	install -m755 -d "${srcdir}/go/src/github.com/UltiRequiem/"
	ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/UltiRequiem/chigo"
}

build() {
	cd "${srcdir}/go/src/github.com/UltiRequiem/chigo"

	mkdir -p build

	export GOPATH="${srcdir}/go"
	go build \
		-trimpath -modcacherw -ldflags "-s -w " \
		-o build/chigo
}

package() {
	cd "${srcdir}/go/src/github.com/UltiRequiem/chigo"

	install -Dm755 "build/chigo" "${pkgdir}/usr/bin/chigo"
	install -Dm644 "license" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}