summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2022-06-13 21:06:54 +1200
committerGeorge Rawlinson2022-06-13 21:06:54 +1200
commitcf6023ac70b5243352c98e7f0c94a5e7608f2752 (patch)
treee60d3d3a7190b66cc2405c2f99ba19fe0c12efe7
downloadaur-cf6023ac70b5243352c98e7f0c94a5e7608f2752.tar.gz
addpkg: sake 0.1.7-1
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD84
2 files changed, 99 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5232c1552cf7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = sake
+ pkgdesc = CLI tool that enables you to run commands on servers via ssh
+ pkgver = 0.1.7
+ pkgrel = 1
+ url = https://sakecli.com
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
+ depends = glibc
+ options = !lto
+ source = sake::git+https://github.com/alajmo/sake#commit=9c91062b3c69cc07450bbfb9f321ab56349283d9
+ b2sums = SKIP
+
+pkgname = sake
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..eaf26103decb
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
+
+pkgname=sake
+pkgver=0.1.7
+pkgrel=1
+pkgdesc='CLI tool that enables you to run commands on servers via ssh'
+arch=('x86_64')
+url='https://sakecli.com'
+license=('MIT')
+depends=('glibc')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='9c91062b3c69cc07450bbfb9f321ab56349283d9'
+source=("$pkgname::git+https://github.com/alajmo/sake#commit=$_commit")
+b2sums=('SKIP')
+
+pkgver() {
+ cd "$pkgname"
+
+ git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+ cd "$pkgname"
+
+ # create directory for build output
+ mkdir build
+
+ # download dependencies
+ go mod download
+}
+
+build() {
+ cd "$pkgname"
+
+ # set Go flags
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+
+ go build -v \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags ${LDFLAGS} \
+ -X github.com/alajmo/sake/cmd.version=$pkgver \
+ -X github.com/alajmo/sake/cmd.commit=$_commit \
+ -X github.com/alajmo/sake/cmd.date=$(date -d@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
+ -o build \
+ .
+
+ # create shell completions
+ for shell in bash fish zsh; do
+ ./build/sake completion "$shell" > "build/$shell-completions"
+ done
+}
+
+check() {
+ cd "$pkgname"
+
+ go test -v ./...
+}
+
+package() {
+ cd "$pkgname"
+
+ # binary
+ install -vDm755 -t "$pkgdir/usr/bin" build/sake
+
+ # documentation
+ install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
+
+ # man page
+ install -vDm644 -t "$pkgdir/usr/share/man/man1" core/sake.1
+
+ # shell auto-completions
+ install -vDm644 build/bash-completions "$pkgdir/usr/share/bash-completion/completions/sake"
+ install -vDm644 build/fish-completions "$pkgdir/usr/share/fish/vendor_completions.d/sake.fish"
+ install -vDm644 build/zsh-completions "$pkgdir/usr/share/zsh/site-functions/_sake"
+
+ # license
+ install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
+}