makedeb


overture 1.8-2


A DNS upstream switcher written in Go in order to purify DNS records

Click here to go back to the commit logs for overture.

Commit:


Hash: 9ae6b6398ec818923f3ec7c18c342d6ee87c947c

Message: Fetch latest version from AUR automatically

Diff


diff --git a/.SRCINFO b/.SRCINFO
index d058b70..16a32d3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,7 +2,7 @@ generated-by = makedeb
 pkgname = overture
 pkgbase = overture
 pkgdesc = A DNS upstream switcher written in Go in order to purify DNS records
-pkgrel = 1
+pkgrel = 2
 pkgver = 1.8
 url = https://github.com/shawn1m/overture
 arch = any
@@ -12,7 +12,7 @@ backup = /etc/overture/china_ip_list.txt
 backup = /etc/overture/gfwlist.txt
 license = MIT
 makedepends = golang-go>=1.12
-source = git+https://github.com/shawn1m/overture.git#tag=v1.8
+source = aur::git+https://aur.archlinux.org/overture.git
 source = config.yml
 source = hosts
 source = domain_ttl
diff --git a/PKGBUILD b/PKGBUILD
index 40e42f7..a924cfb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgname=overture
 pkgver=1.8
-pkgrel=1
+pkgrel=2
 pkgdesc="A DNS upstream switcher written in Go in order to purify DNS records"
 arch=(any)
 url="https://github.com/shawn1m/overture"
@@ -12,7 +12,7 @@ makedepends=("golang-go>=1.12")
 backup=("/etc/overture/config.json" "/etc/overture/hosts" "/etc/overture/china_ip_list.txt" "/etc/overture/gfwlist.txt")
 
 _gourl=github.com/shawn1m/${pkgname}
-source=("git+https://github.com/shawn1m/${pkgname}.git#tag=v${pkgver}"
+source=("aur::git+https://aur.archlinux.org/overture.git"
         "config.yml"
         "hosts"
         "domain_ttl"
@@ -34,10 +34,19 @@ sha256sums=("SKIP"
 
 _goroot="/usr/lib/go"
 
+pkgver() {
+  (source "${srcdir}/aur/PKGBUILD" >/dev/null && echo ${pkgver})
+}
+
+prepare() {
+  git clone ${url} ${srcdir}/${pkgname}
+}
+
 build() {
   GOROOT=${_goroot}
   msg2 "Building overture"
   cd ${srcdir}/${pkgname}
+  git checkout v${pkgver}
   [ ! -d ${srcdir}/${pkgname}/out ] && mkdir ${srcdir}/${pkgname}/out
   CGO_ENABLED=1 go build -ldflags="-w -s -X main.version=${pkgver}" -trimpath -o out/${pkgname} main/main.go
 }