summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 55a58f94501743c23670ed5add353e6feaa847ed (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
# Maintainer: Moses Narrow <moe_narrow@use.startmail.com>
pkgname=goyacc
pkgname1=goyacc
pkgdesc="Goyacc is a version of yacc generating Go parsers. https://godoc.org/modernc.org/goyacc"
pkgver='autogenerated'
pkgrel=1
arch=('any')
pkggopath="gitlab.com/cznic/goyacc"
url="https://${pkggopath}"
license=()
depends=(go)
source=("git+${url}.git")
#actually the source is fetched with go get
sha256sums=('SKIP')

case "$CARCH" in
x86)      export GOARCH="386" GO386="387" ;;
x86_64)   export GOARCH="amd64" ;;
arm*)     export GOARCH="arm" ;;
armel)    export GOARCH="arm" GOARM="5" ;;
armhf)    export GOARCH="arm" GOARM="6" ;;
armv7)    export GOARCH="arm" GOARM="7" ;;
armv8)    export GOARCH="arm64" ;;
aarch64)  export GOARCH="arm64" ;;
mips)     export GOARCH="mips" ;;
mips64)   export GOARCH="mips64" ;;
mips64el) export GOARCH="mips64le" ;;
mipsel)   export GOARCH="mipsle" ;;
*)        return 1 ;;
	esac

	pkgver() {
	cd "${srcdir}/${pkgname1}"
	local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
	local count=$(git rev-list --count HEAD)
	local commit=$(git rev-parse --short HEAD)
	echo "${date}.${count}_${commit}"
	}

build() {
  mkdir -p ${srcdir}/go/bin
  export GOPATH=${srcdir}/go #${srcdir}/${pkgname}
  export GOBIN=${srcdir}/go/bin
  #cd ${srcdir}/go
  go get ${pkggopath}
}

package() {
#create dir structure
mkdir -p ${pkgdir}/usr/bin/
mkdir -p ${pkgdir}/usr/lib/${pkgname}/bin/
#putting the sources in /usr/lib/nbxplorer
cp -b ${srcdir}/go/bin/${pkgname} ${pkgdir}/usr/lib/${pkgname}/bin/${pkgname}
#symlinking run.sh to /usr/bin/nbxplorer
ln -rTsf ${pkgdir}/usr/lib/${pkgname}/bin/${pkgname} ${pkgdir}/usr/bin/${pkgname}
chmod 755 ${pkgdir}/usr/bin/${pkgname}
cp -r ${srcdir}/${pkgname}/ ${pkgdir}/usr/lib/${pkgname}/
}