diff options
author | Chocobo1 | 2023-05-27 15:41:24 +0800 |
---|---|---|
committer | Chocobo1 | 2023-05-27 15:59:43 +0800 |
commit | d6635150d7e1c0c226f8c61750ee2c20cab3c706 (patch) | |
tree | 6e5726589ee4505e8c7697b9e244c5e3a82e9355 /PKGBUILD | |
download | aur-d6635150d7e1c0c226f8c61750ee2c20cab3c706.tar.gz |
newpkg: upterm-git 0.10.0.r14.g9f907d4-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..182e1c77268a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net> + +pkgname=upterm-git +pkgver=0.10.0.r14.g9f907d4 +pkgrel=1 +pkgdesc="Secure terminal sharing" +arch=('i686' 'x86_64') +url="https://upterm.dev/" +license=('Apache') +depends=('glibc') +makedepends=('git' 'go') +provides=("upterm=$pkgver") +conflicts=('upterm') +source=("git+https://github.com/owenthereal/upterm.git") +sha256sums=('SKIP') + + +export CGO_CPPFLAGS="${CPPFLAGS}" +export CGO_CFLAGS="${CFLAGS}" +export CGO_CXXFLAGS="${CXXFLAGS}" +export CGO_LDFLAGS="${LDFLAGS}" +export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw" + +pkgver() { + cd "upterm" + + _tag=$(git tag -l --sort -v:refname | grep -E '^v?[0-9\.]+$' | head -n1) + _rev=$(git rev-list --count $_tag..HEAD) + _hash=$(git rev-parse --short HEAD) + printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//' +} + +build() { + cd "upterm" + + make build docs +} + +check() { + cd "upterm" + + go test \ + ./... +} + +package() { + cd "upterm" + + GOBIN="$pkgdir/usr/bin" \ + go install ./cmd/... + rm "$pkgdir/usr/bin/gendoc" + + mkdir -p "$pkgdir/usr/share/man" + cp -a "etc/man/." "$pkgdir/usr/share/man" + install -Dm644 "etc/completion/upterm.bash_completion.sh" "$pkgdir/usr/share/bash-completion/completions/upterm" + install -Dm644 "etc/completion/upterm.zsh_completion" "$pkgdir/usr/share/zsh/site-functions/_upterm" + install -Dm644 "systemd/uptermd.service" -t "$pkgdir/usr/lib/systemd/system" +} |