2023-03-05 09:52:17 +01:00
|
|
|
# Maintainer: nyyu <mail at nyyu dot dev>
|
|
|
|
|
|
|
|
pkgname=freebox-exporter
|
2023-03-17 19:47:14 +01:00
|
|
|
pkgver=r28.a4e2d54
|
2023-03-05 09:52:17 +01:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="Woodpecker is a community fork of the Drone CI system"
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://github.com/trazfr/freebox-exporter"
|
|
|
|
license=('MIT')
|
|
|
|
makedepends=('go' 'git')
|
|
|
|
options=('!lto')
|
|
|
|
source=(git+https://git.nyyu.dev/nyyu/freebox-exporter.git
|
|
|
|
'freebox-exporter.service')
|
|
|
|
sha256sums=('SKIP'
|
|
|
|
'361bfba272b7933af35eabb761f677008472c8e74d9fbcfc9f76e92b77bcedee')
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
cd "$pkgname"
|
|
|
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd "$pkgname"
|
|
|
|
|
|
|
|
go mod download
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$pkgname"
|
|
|
|
|
|
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
|
|
|
|
|
|
go build \
|
|
|
|
-trimpath \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=readonly \
|
|
|
|
-modcacherw \
|
|
|
|
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
|
|
|
|
.
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
package() {
|
|
|
|
|
|
|
|
# service
|
|
|
|
install -Dm644 freebox-exporter.service "$pkgdir/usr/lib/systemd/system/freebox-exporter.service"
|
|
|
|
|
|
|
|
cd "$pkgbase"
|
|
|
|
|
|
|
|
# binary
|
|
|
|
install -vDm755 freebox-exporter "$pkgdir/usr/bin/freebox-exporter"
|
|
|
|
}
|