summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 575094cceaf3fe467decdcc5d23b624c06c9cc34 (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
# Maintainer: Keiran <keiran@keircn.com>
pkgname=prefine
pkgver=0.2.0
pkgrel=1
pkgdesc="CLI tool designed to optimize various file types commonly found in web development projects"
arch=('x86_64')
url="https://github.com/priory-io/prefine"
license=('MIT')
depends=()
makedepends=('go')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
    cd "$pkgname-$pkgver"
    
    export CGO_ENABLED=0
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external"
    export GOPATH="$srcdir/gopath"
    export GO111MODULE=on
    
    go mod download
    go build -ldflags="-w -s -X 'github.com/priory-io/prefine/cmd.Version=v$pkgver'" -o build/$pkgname ./cmd/prefine
}

check() {
    cd "$pkgname-$pkgver"
}

package() {
    cd "$pkgname-$pkgver"
    
    install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
    
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}