summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoses Narrow2019-09-09 16:49:21 -0500
committerMoses Narrow2019-09-09 16:49:21 -0500
commit2b5839aadcf69fd026d615b0345e074cbc76f36c (patch)
tree76404a0a96533122b3d4ff7c57a9174467e24bb0
downloadaur-2b5839aadcf69fd026d615b0345e074cbc76f36c.tar.gz
add PKGBUILD & .SRCINFO
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD58
2 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..209418143e93
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,12 @@
+pkgbase = goyacc
+ pkgdesc = Goyacc is a version of yacc generating Go parsers. https://godoc.org/modernc.org/goyacc
+ pkgver = autogenerated
+ pkgrel = 1
+ url = https://gitlab.com/cznic/goyacc
+ arch = any
+ depends = go
+ source = git+https://gitlab.com/cznic/goyacc.git
+ sha256sums = SKIP
+
+pkgname = goyacc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..55a58f945017
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,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}/
+}