summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9d92c020e9c54937157f5093e9b49a72a11a032e (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
# Maintainer: Noel Kuntze <noel@familie-kuntze.de>
pkgname=bsearch
pkgver=1.0.2
pkgrel=2
pkgdesc="Utility for binary searching a sorted file for lines that start with the search key"
arch=('x86_64')
url="https://github.com/jamesridgway/bsearch"
license=('MIT')
makedepends=(go)
source=("$pkgname-$pkgver.tar.gz::https://github.com/jamesridgway/bsearch/archive/${pkgver}.tar.gz")
sha256sums=('4520918349e6f82d8f0c1586d2fdf3dfe9b1300a6f7d68faa5180454739d53f7')

prepare() {
	cd "$pkgname-$pkgver"
    export GOPATH="${srcdir}/fakegopath"

    mkdir -p "${GOPATH}/src/github.com/jamesridgway/bsearch/"
    cp -R "${srcdir}/${pkgname}-${pkgver}/"* "${GOPATH}/src/github.com/jamesridgway/bsearch/"
    
}

build() {
	cd "$pkgname-$pkgver"
    export GOPATH="${srcdir}/fakegopath"

    go get -v github.com/jamesridgway/bsearch
    cd "${GOPATH}"/src/github.com/jamesridgway/bsearch
    go build -pkgdir "${pkgdir}"
}

check() {
	cd "$pkgname-$pkgver"
    export GOPATH="${srcdir}/fakegopath"
    cd "${GOPATH}"/src/github.com/jamesridgway/bsearch
    go test
}

package() {
	cd "$pkgname-$pkgver"
    export GOPATH="${srcdir}/fakegopath"
    go build -o out/bsearch

	mkdir -p "${pkgdir}/usr/share/man/man1/" "${pkgdir}/usr/bin/"
	cp "bsearch.1" "${pkgdir}/usr/share/man/man1/bsearch.1"
	cp "out/bsearch" "${pkgdir}/usr/bin/"
}