summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 911f2427d4ca86438e3b1d730d7aabf80d9fe61c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Maintainer: Ethan Lerner <ethanlerners@gmail.com>
# Contributor: Ethan Lerner <ethanlerners@gmail.com>

_pkgname=gogle
pkgname=${_pkgname}-git
pkgver=1.0.r2.b7eaa43
pkgrel=1
pkgdesc="Simple utility for quickly getting a Google search URL pasted to your clipboard."
arch=('i686' 'x86_64')
url="https://github.com/miapolis/${_pkgname}"
license=('MIT')
makedepends=('cargo' 'git')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("git+${url}.git")
md5sums=('SKIP')

pkgver() {
  cd $_pkgname
  printf "1.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_pkgname
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd $_pkgname
  export RUSTFLAGS="-C target-cpu=native"
  cargo build --frozen --release
}

package() {
  target="target/release"
  cd $_pkgname
  install -Dm755 "$target/$_pkgname" -t "$pkgdir/usr/bin"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
  install -Dm644 README.md "${pkgdir}/usr/share/doc/${_pkgname}/README.md"
}