makedeb


buf 1.6.0-1


A new way of working with Protocol Buffers

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for buf.

# Maintainer: hiddeninthesand <hiddeninthesand at pm dot me>

# AUR Maintainer: Buf <bot@buf.build>
# AUR Contributor: Alexander Menzhinsky <amenzhinsky@gmail.com>
pkgname="buf"
_gitname="buf"
pkgver='1.6.0'
pkgrel='1'
pkgdesc="A new way of working with Protocol Buffers"
arch=("any")
url="https://buf.build"
license=('Apache')
makedepends=('golang-go')
sha256sums=('SKIP')
source=("git+https://github.com/bufbuild/buf.git#tag=v${pkgver}")
conflicts=("${_gitname}-git" "${_gitname}-bin")

build() {
	cd ${_gitname}
	go build -trimpath -buildmode=pie -mod=readonly -modcacherw -o . ./cmd/{buf,protoc-gen-buf-lint,protoc-gen-buf-breaking}
	./buf completion bash >completion.bash
	./buf completion zsh >completion.zsh
	./buf completion fish >completion.fish
	mkdir -p manpages
	./buf manpages manpages
}

package() {
    cd ${_gitname}
	install -Dm755 "${_gitname}" "${pkgdir}/usr/bin/buf"
	install -Dm755 "protoc-gen-buf-lint" "${pkgdir}/usr/bin/protoc-gen-buf-lint"
	install -Dm755 "protoc-gen-buf-breaking" "${pkgdir}/usr/bin/protoc-gen-buf-breaking"
	install -Dm644 "completion.bash" "${pkgdir}/etc/bash_completion.d/buf"
	install -Dm644 "completion.zsh" "${pkgdir}/usr/share/zsh/site-functions/_buf"
	install -Dm644 "completion.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/buf.fish"
	install -Dm644 "manpages/${_gitname}"* -t "${pkgdir}/usr/share/man/man1/"
}