summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6096dab37edc5863acdd1b5b2e1b8620e6194f60 (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: Elias Werberich <elias@werberich.de>

pkgname=changie
pkgver=1.8.0
pkgrel=1
epoch=0
pkgdesc="Automated changelog tool for preparing releases with lots of customization options."
arch=('x86_64')
url="https://github.com/miniscruff/changie"
license=('MIT')
depends=()
makedepends=('go')
conflicts=()
source=("git+https://github.com/miniscruff/changie#tag=v$pkgver")
sha256sums=('SKIP')

prepare() {
    mkdir -p "src/github.com/miniscruff"
    mv "changie" "src/github.com/miniscruff/changie"
    case $CARCH in
        "x86_64")
            _GOARCH="amd64"
            ;;
        *)
            echo "Selected architecture is unsupported."
            exit 1
            ;;
    esac
}

build() {
    cd "$srcdir/src/github.com/miniscruff/changie"
    GOOS=linux \
    GOARCH=${_GOARCH} \
    GOARM=${_GOARM} \
    CGO_ENABLED=0 \
    GOPATH="$srcdir" \
    go build \
        -modcacherw \
        -o "$srcdir/changie" \
        -gcflags "all=-trimpath=$srcdir" \
        -asmflags "all=-trimpath=$srcdir" \
        -ldflags "-extldflags ${LDFLAGS} -X main.version=$pkgver" \
        "github.com/miniscruff/changie"
}

package() {
    install -Dm0755 "$srcdir/changie" "$pkgdir/usr/bin/changie"
}