Files
fritz-tls-pkg/PKGBUILD

62 lines
1.7 KiB
Bash

# Maintainer: Markus Pesch <markus.pesch plus apps at cryptic.systems>
pkgname=fritz-tls
pkgver=0.26.1 # renovate: datasource=github-releases depName=tisba/fritz-tls
pkgrel=1
pkgdesc="Automate TLS certificate installation for AVM FRITZ!Box "
arch=('armv7h' 'aarch64' 'x86_64')
url="https://github.com/tisba/$pkgname"
license=('MIT')
makedepends=('go')
source=(
${pkgname}-v${pkgver}.zip::"$url/archive/refs/tags/v${pkgver}.zip"
)
sha512sums=('a0a2eaabd8e6c37584318ddc1386926284fe153f0736bdf141f9a36bdae4908314814ebd5f38831a20f9c31f46f7371aaf3efce37c2fcf69db10250a0ee18443')
b2sums=('700e0d61767eda9e7d2c27e4a03d11a6db187c680dfa2bdda8508908a8299c52191b29edf9cde8081d3e6accce62c04c6890999f586882058e8f1e1929fea6bb')
prepare() {
cd ${pkgname}-${pkgver}
export GONOSUMDB="${GONOSUMDB}"
export GOPATH="${srcdir}"
export GOPROXY="${GOPROXY}"
env | sort | grep -E '^C?GO'
go mod download -modcacherw
}
build() {
cd "$pkgname-$pkgver"
# https://wiki.archlinux.org/title/Go_package_guidelines
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GONOSUMDB="${GONOSUMDB}"
export GOPATH="${srcdir}"
export GOPROXY="${GOPROXY}"
env | sort | grep -E '^C?GO'
go build -v \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
-o $pkgname \
.
}
package() {
# binary
install -D --mode 0755 --target-directory "$pkgdir/usr/bin" "$pkgname-$pkgver/$pkgname"
# license
install -D --mode 0755 --target-directory "$pkgdir/usr/share/licenses/$pkgname" "$pkgname-$pkgver/LICENSE"
}