summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian2023-09-23 20:39:04 +0200
committerSebastian2023-09-23 20:39:04 +0200
commit00048872bc1d3536ed48d55a7bdcd867c1ab7836 (patch)
tree1860fd8c702e3ba537a41fab453033922ca3ad1f
parent9417c568ed5f18b4d563e072f93eefb8adac11fe (diff)
downloadaur-00048872bc1d3536ed48d55a7bdcd867c1ab7836.tar.gz
incorporated changes from user dreieck <oid-maps@seznam.cz>
-rw-r--r--PKGBUILD33
1 files changed, 26 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index fc01c959ff29..1d585996f477 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,19 +1,32 @@
# Maintainer: Sebastian Meßlinger <sebastian.messlinger@posteo.de>
pkgname=dnslookup-git
-pkgver=r10.ae36d05
-pkgrel=2
+pkgver=1.10.0.r75.20230921.0acf48e
+pkgrel=1
pkgdesc="Simple command line utility to make DNS lookups to the specified server"
arch=('any')
url="https://github.com/ameshkov/dnslookup"
license=('GPL3')
depends=()
makedepends=('go' 'git')
-source=('git://github.com/ameshkov/dnslookup.git')
+provides=("dnslookup=${pkgver}")
+conflicts=("dnslookup")
+source=('git+https://github.com/ameshkov/dnslookup.git')
sha1sums=('SKIP')
pkgver() {
- cd "${srcdir}/dnslookup"
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ cd "${srcdir}/dnslookup"
+
+ _ver="$(git describe --tags | sed 's|^[vV]||' | sed 's|-g[0-9a-fA-F]*$||' | tr '-' '+')"
+ _rev="$(git rev-list --count HEAD)"
+ _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
+ _hash="$(git rev-parse --short HEAD)"
+
+ if [ -z "${_ver}" ]; then
+ error "Version could not be determined."
+ return 1
+ else
+ printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
+ fi
}
build(){
@@ -24,6 +37,12 @@ build(){
}
package(){
- mkdir -p $pkgdir/usr/bin
- install $srcdir/gopath/bin/dnslookup $pkgdir/usr/bin/dnslookup
+ mkdir -p "${pkgdir}/usr/bin"
+
+ if [ -v GOBIN ]; then
+ _binpath="${GOBIN}"
+ else
+ _binpath="${srcdir}/gopath/bin"
+ fi
+ install "${_binpath}/dnslookup" "${pkgdir}/usr/bin/dnslookup"
}