summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD18
2 files changed, 11 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d7b5c3743277..69a8b4af3c0d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,13 +2,12 @@ pkgbase = nginx-vts-exporter
pkgdesc = Prometheus exporter for Nginx vts stats
pkgver = 0.10.8
pkgrel = 3
- url = https://github.com/hnlq715/nginx-vts-exporter
+ url = https://github.com/sysulq/nginx-vts-exporter
arch = x86_64
arch = aarch64
license = MIT
makedepends = go
- options = !lto
- source = https://github.com/hnlq715/nginx-vts-exporter/archive/v0.10.8.tar.gz
+ source = https://github.com/sysulq/nginx-vts-exporter/archive/v0.10.8.tar.gz
source = nginx-vts-exporter.service
sha256sums = 2fc964f1129f732beaf10722380d61754c4f0744c48a2ab11028428eff45ce11
sha256sums = 7838c08b3299d2d6d5bb0b6c281f1fcee8f9dc254bfb5e1a8d59699e52495f06
diff --git a/PKGBUILD b/PKGBUILD
index e7a4d6b302ca..3cac54373a0b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,8 +6,7 @@ pkgver='0.10.8'
pkgrel='3'
pkgdesc='Prometheus exporter for Nginx vts stats'
arch=('x86_64' 'aarch64')
-options=(!lto)
-_uri='github.com/hnlq715'
+_uri='github.com/sysulq'
url="https://${_uri}/${pkgname}"
license=('MIT')
makedepends=('go')
@@ -17,7 +16,6 @@ sha256sums=('2fc964f1129f732beaf10722380d61754c4f0744c48a2ab11028428eff45ce11'
'7838c08b3299d2d6d5bb0b6c281f1fcee8f9dc254bfb5e1a8d59699e52495f06')
prepare() {
- cd "${pkgname}-${pkgver}"
export GOPATH="${srcdir}/gopath"
export GOBIN="${GOPATH}/bin"
mkdir -p "${GOPATH}/src/${_uri}"
@@ -26,20 +24,22 @@ prepare() {
build() {
cd "${GOPATH}/src/${_uri}/${pkgname}"
+ eval "$(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")"
+ GOOS="${GOHOSTOS}" GOARCH="${GOHOSTARCH}" BUILDTAGS="netgo static_build" \
go build -x \
-buildmode="pie" \
-trimpath \
-mod="readonly" \
-modcacherw \
- -ldflags "-linkmode external -extldflags ${LDFLAGS} \
+ -ldflags "-linkmode external -extldflags '${LDFLAGS}' \
-X github.com/prometheus/common/version.Version=${pkgver} \
- -X github.com/prometheus/common/version.Revision=$(git rev-parse HEAD) \
- -X github.com/prometheus/common/version.Branch=$(git describe --all --contains --dirty HEAD) \
+ -X github.com/prometheus/common/version.Revision=${pkgrel} \
+ -X github.com/prometheus/common/version.Branch=tarball \
-X github.com/prometheus/common/version.BuildUser=$(whoami)@$(hostnamectl hostname) \
- -X github.com/prometheus/common/version.BuildDate=$(date -d@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)"
+ -X github.com/prometheus/common/version.BuildDate=$(date -u '+%Y%m%d-%H:%M:%S' --date=@${SOURCE_DATE_EPOCH})"
}
package() {
- install -Dm755 "${GOPATH}/src/${_uri}/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
- install -Dm644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
+ install -Dm0755 "${GOPATH}/src/${_uri}/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm0644 "${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
}