summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6a42dd8b6868de3db181cfec29616b988db93b4 (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
# Maintainer: James An <james@jamesan.ca>

pkgname=git-subrepo-git
_pkgname=${pkgname%-git}
pkgver=0.3.0.r72.g1e79595
pkgrel=1
pkgdesc="Git command is an improvement from git-submodule and git-subtree."
arch=('any')
url="https://github.com/ingydotnet/$_pkgname"
license=('GPL')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname"::"git+$url.git"
        make-destdir.patch)
md5sums=('SKIP'
         'ee9d7137bb4fe4b0cc7da8f669e26ddf')

pkgver() {
  cd "$_pkgname"
  (
    set -o pipefail
    git describe --long --tag | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd "$_pkgname"

  patch -p1 < ../make-destdir.patch
}

check() {
  cd "$_pkgname"

  make test
}

package() {
  cd "$_pkgname"

  make DESTDIR="$pkgdir" PREFIX=/usr install
}