diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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" } |