2022-05-22 19:25:35 +00:00
|
|
|
# Maintainer: MedzikUser <nivua1fn@duck.com>
|
|
|
|
pkgname='cloudflared'
|
2023-07-11 20:17:01 +00:00
|
|
|
pkgver="2023.7.0"
|
2022-05-22 19:25:35 +00:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc='Cloudflare Tunnel client (formerly Argo Tunnel)'
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://github.com/cloudflare/cloudflared"
|
|
|
|
license=('Apache')
|
|
|
|
depends=('glibc')
|
|
|
|
makedepends=('go')
|
2022-05-22 19:38:53 +00:00
|
|
|
source=("${url}/archive/${pkgver}.tar.gz")
|
2023-07-11 20:17:01 +00:00
|
|
|
sha256sums=('9cd1a2dd60bc5de88430214578c1c2b06d48548c569e144d1b995d57ccb8a0d5')
|
2022-05-22 19:25:35 +00:00
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "${pkgname}-${pkgver}"
|
|
|
|
|
|
|
|
local _flags
|
|
|
|
_flags=(
|
|
|
|
-X main.Version="$pkgver"
|
|
|
|
-X main.BuildTime="$(date -u -d "@${SOURCE_DATE_EPOCH}" +'%FT%TZ')"
|
|
|
|
)
|
|
|
|
|
|
|
|
export CGO_CPPFLAGS="$CPPFLAGS"
|
|
|
|
export CGO_CFLAGS="$CFLAGS"
|
|
|
|
export CGO_CXXFLAGS="$CXXFLAGS"
|
|
|
|
export CGO_LDFLAGS="$LDFLAGS"
|
|
|
|
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -modcacherw"
|
|
|
|
|
|
|
|
go build \
|
|
|
|
-v \
|
|
|
|
-ldflags "${_flags[*]}" \
|
|
|
|
-o bin/$pkgname \
|
|
|
|
./cmd/$pkgname
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd "${pkgname}-${pkgver}"
|
|
|
|
install -Dm 755 bin/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
|
|
|
|
install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
|
|
}
|