summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 907828c1b830ddefc8c7a4dd24a2a72aca2a8d37 (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
50
51
# Maintainer: Salamandar <felix at piedallu dot me>

_pkgname=git-sizer
pkgname=${_pkgname}-git
pkgver=1.1.0_1_g2e9a30f
pkgrel=1
pkgdesc="Compute various size metrics for a Git repository, flagging those that might cause problems (git version)"
license=('MIT')
arch=('any')

makedepends=(
  'go'
)
depends=(
  'git'
)
conflicts=( "${_pkgname}" "${_pkgname}-bin" )

url="https://github.com/github/${_pkgname}"

source=( "git+${url}" )
sha256sums=('SKIP')


pkgver() {
  cd "${srcdir}/${_pkgname}"
  git describe | sed 's/^v//g'  | sed 's/-/_/g'
}

build() {
  cd "${srcdir}/${_pkgname}"

  ./script/bootstrap
  make
}

check() {
  cd "${srcdir}/${_pkgname}"

  make test
}

package() {
  cd "${srcdir}/${_pkgname}"

  install -Dm755 bin/git-sizer  "${pkgdir}/usr/bin/git-sizer"
  install -Dm644 README.md      "${pkgdir}/usr/share/doc/${pkgname}/README.md"
  install -Dm644 LICENSE.md     "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 vendor/github.com/spf13/pflag/LICENSE \
                                "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-spf13-pflag"
}