summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f739871b11a720f3ac6d425b70a25d851d77014f (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
42
43
44
45
46
47
48
49
# Maintainer: Fernandez Ludovic <lfernandez dot dev at gmail dot com>

pkgname='godownloader-git'
_pkgname="${pkgname%-git}"
pkgver=r289.3ce8d45
pkgrel=1
pkgdesc='Download Go binaries as fast and easily as possible.'
url='https://install.goreleaser.com/'
arch=('x86_64' 'i686')
license=('MIT')
provides=("${_pkgname}")
conflicts=("${_pkgname}" "${pkgname}")

_url='https://github.com/goreleaser/godownloader'
_goreleaserpath=github.com/goreleaser
_godownloaderpath="${_goreleaserpath}/godownloader"

depends=()
# makedepends=('git')
makedepends=('git' 'go')

source=("git+${_url}.git")
sha512sums=('SKIP')

prepare() {
  # setup go env vars
  export GO111MODULE=on

  mkdir -p "${srcdir}/${_goreleaserpath}/" && cd $_
  mv ${srcdir}/${_pkgname} .
}

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

build() {
  cd "${srcdir}/${_godownloaderpath}"
  go build .
}

package() {
  # Bin
  install -Dm755  "${srcdir}/${_godownloaderpath}/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"

  # License
  install -Dm644 "${srcdir}/${_godownloaderpath}/LICENSE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}