summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorJavier Domingo Cansino2017-05-10 03:48:18 +0200
committerJavier Domingo Cansino2017-05-10 03:48:18 +0200
commit4e6f66bd9d469b93c7278eb1a348996e973afbfe (patch)
tree15198619d9dd5cf65f32d5d1809c2b567d065cec /PKGBUILD
downloadaur-4e6f66bd9d469b93c7278eb1a348996e973afbfe.tar.gz
Git package created, systemd service left out on purpose
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD44
1 files changed, 44 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..416442534f4
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: Javier Domingo Cansino <javierdo1@gmail.com>
+
+_pkgname=sawyer
+pkgname=${_pkgname}-git
+pkgver=v0.0.1.r0.g7d842d5
+pkgrel=1
+pkgdesc="Sawyer is a background changer"
+url='https://github.com/txomon/sawyer/'
+arch=('i686' 'x86_64')
+license=('MPL')
+makedepends=('go' 'git')
+conflicts=('sawyer-bin')
+_gourl=github.com/txomon
+source=(${pkgname}::"git+https://${_gourl}/${_pkgname}.git#branch=master")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "${srcdir}/../$pkgname"
+ git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ mkdir -p "${srcdir}/src/${_gourl}"
+ rm -rf "${srcdir}/src/${_gourl}/${_pkgname}"
+ mv -f "${pkgname}" "${srcdir}/src/${_gourl}/${_pkgname}"
+ msg2 "Fetching dependencies"
+ cd "${srcdir}/src/${_gourl}/${_pkgname}"
+ GOPATH="${srcdir}" ./go-get-deps.sh
+}
+
+build() {
+ msg2 "Build program"
+ cd "${srcdir}/src/${_gourl}/${_pkgname}"
+ GOPATH="${srcdir}" PATH="${srcdir}/bin:${PATH}" go build -o sawyer.bin
+}
+
+package() {
+ cd "${srcdir}/src/${_gourl}/${_pkgname}"
+ install -Dm755 sawyer.bin "${pkgdir}/usr/bin/sawyer"
+
+ cd "${srcdir}/.."
+ # Zsh completion
+ install -Dm755 config.json $pkgdir/etc/sawyer/config.json
+} \ No newline at end of file