summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorLorenzo Fontana2018-05-11 14:07:17 +0200
committerLorenzo Fontana2018-05-11 14:07:17 +0200
commit3933260e5d8d785314f581138e03afdbf9a0ede4 (patch)
tree1031750636a578d674705d0921198471057c45a8 /PKGBUILD
parent1baafbb0030554d86c0cb6d4f55ab88a665bd884 (diff)
downloadaur-3933260e5d8d785314f581138e03afdbf9a0ede4.tar.gz
Fix build from source project giving a specific GOPATH
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD18
1 files changed, 14 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6fba73b1c0e..89cda4639fc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,6 @@
# Maintainer: Lorenzo Fontana <lo@linux.com>
pkgname=coredns
+gopkgname='github.com/coredns/coredns'
pkgver=v1.1.2
pkgrel=1
pkgdesc="CoreDNS is a DNS server that chains plugins"
@@ -9,7 +10,7 @@ arch=('i686' 'x86_64')
url="https://github.com/coredns/coredns"
license=('Apache')
provides=('coredns')
-source=(coredns::https://github.com/coredns/${pkgname}/archive/${pkgver}.tar.gz
+source=(coredns.tar.gz::https://github.com/coredns/${pkgname}/archive/${pkgver}.tar.gz
https://raw.githubusercontent.com/coredns/deployment/39c9f7ed7640f86fa0fb6ba06a88e9afa830b306/systemd/coredns.service
https://raw.githubusercontent.com/coredns/deployment/39c9f7ed7640f86fa0fb6ba06a88e9afa830b306/systemd/coredns-sysusers.conf)
@@ -18,13 +19,22 @@ sha256sums=('8715d41d43adacd3cf9db0a9f6599de4d3024a1808a8029bf4c0d0931397ce35'
'947b4838af48212ecd8e565155c97ca61ff7d408d0b8622499925b6e232656c4'
'178c632fd855a5a35ae69e13ab554d5abad696cf75d23c6b6b37f0ace3b4b0f2')
+prepare() {
+ export GOPATH="$srcdir/build"
+ rm -rf "$GOPATH/src/$gopkgname"
+ mkdir --parents `dirname "$GOPATH/src/$gopkgname"`
+ mv -Tv "$srcdir/$pkgname-${pkgver//v/}" "$GOPATH/src/$gopkgname"
+}
+
build() {
- cd "$pkgname-${pkgver//v/}"
- make
+ export GOPATH="$srcdir/build"
+ cd $GOPATH/src/$gopkgname
+ make GOPATH=$GOPATH godeps
+ make GOPATH=$GOPATH
}
package() {
- install -Dm755 "$srcdir/coredns-${pkgver//v/}/coredns" "$pkgdir/usr/bin/coredns"
+ install -Dm755 "$srcdir/build/src/$gopkgname/coredns" "$pkgdir/usr/bin/coredns"
install -Dm644 "$srcdir/coredns.service" "$pkgdir/usr/lib/systemd/system/coredns.service"
install -Dm644 "$srcdir/coredns-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/coredns.conf"
install -d "${pkgdir}/etc/coredns"