mirror of
https://github.com/built-aur/packages
synced 2024-08-14 23:01:15 +00:00
41 lines
1 KiB
Bash
41 lines
1 KiB
Bash
# Maintainer: MedzikUser <nivua1fn@duck.com>
|
|
pkgname='cloudflared'
|
|
pkgver="2022.5.3"
|
|
pkgrel=1
|
|
pkgdesc='Cloudflare Tunnel client (formerly Argo Tunnel)'
|
|
arch=('x86_64')
|
|
url="https://github.com/cloudflare/cloudflared"
|
|
license=('Apache')
|
|
depends=('glibc')
|
|
makedepends=('go')
|
|
source=("${url}/archive/${pkgver}.tar.gz")
|
|
sha256sums=('d5d55a143afb918dad279490bc36e4d3537c2b862cdecfcd5dfe5bb52af63e7e')
|
|
|
|
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"
|
|
}
|