blob: 0afb5676cac72120eb588e67fb8bec32d77b5d09 (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# Maintainer: Egor Kovetskiy <e.kovetskiy@office.ngs.ru>
pkgname=gtm
pkgver=${PKGVER:-autogenerated}
pkgrel=${PKGREL:-1}
pkgdesc="git time metrics"
arch=('i686' 'x86_64')
license=('GPL')
depends=(
)
makedepends=(
'go'
'git'
)
source=(
"git2go::git://github.com/git-time-metric/git2go#branch=next"
"gtm::git://github.com/git-time-metric/gtm#branch=${BRANCH:-master}"
)
md5sums=(
'SKIP'
'SKIP'
)
backup=(
)
pkgver() {
if [[ "$PKGVER" ]]; then
echo "$PKGVER"
return
fi
cd "$srcdir/$pkgname"
local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
local count=$(git rev-list --count HEAD)
local commit=$(git rev-parse --short HEAD)
echo "$date.${count}_$commit"
}
build() {
export GOPATH="$srcdir/.go"
mkdir -p "$GOPATH/src/github.com/git-time-metric/"
mv "$srcdir/git2go" "$GOPATH/src/github.com/git-time-metric/"
mv "$srcdir/gtm" "$GOPATH/src/github.com/git-time-metric/"
cd "$GOPATH/src/github.com/git-time-metric/git2go"
echo ":: git2go: switching next branch..."
git checkout next
echo ":: git2go: initializing submodules..."
git submodule update --init
echo ":: git2go: go get..."
go get -t -d ./...
echo ":: git2go: making..."
make install
cd "$GOPATH/src/github.com/git-time-metric/gtm"
echo ":: gtm: go get..."
go get -t -v ./...
echo ":: gtm: go build..."
go build -v \
-gcflags "-trimpath $GOPATH/src" \
-ldflags "-X main.Version=${pkgver}"
}
package() {
find "$srcdir/.go/bin/" -type f -executable | while read filename; do
install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
done
}
|