summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 11a47b2ad87198cd378115e1346826fa2fb0f818 (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
# Maintainer: Jeffrey Zhang zhang.lei.fly@gmail.com
pkgname=assh-git
_pkgname=assh
pkgver=2.16.0.r0.g869f9789
pkgrel=1
pkgdesc='make your ssh client smarter https://manfred.life/assh'
arch=('any')
url='https://github.com/moul/assh.git'
license=('MIT')
depends=()
makedepends=('git' 'go')
conflicts=()
provides=('assh')
source=("git+https://github.com/moul/assh.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${srcdir}/${_pkgname}"
    version=$(git describe --tags --always)
    vcs_ref=$(git rev-parse --short HEAD)
    GOPATH=${srcdir} \
        GO111MODULE=on \
        go build \
        --ldflags "-X moul.io/assh/v2/pkg/version.Version=$version -X moul.io/assh/v2/pkg/version.VcsRef=$vcs_ref" \
        -modcacherw -o assh
}

package() {
    cd ${srcdir}/${_pkgname}
    install -Dm755 assh ${pkgdir}/usr/bin/assh
    install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE
}