aboutsummaryrefslogtreecommitdiffstats
path: root/testing/websocketd/APKBUILD
blob: dd633a32687ea18a8bfa85078451e4cf4c3d041d (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=websocketd
pkgver=0.2.10
pkgrel=1
pkgdesc="Full duplex messaging between web browsers and servers"
url="http://websocketd.com/"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends="$depends_dev go go-tools"
install=""
subpackages="$pkgname-doc"
options="!strip"
source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz"

_disturl="dev.alpinelinux.org:/archive/$pkgname/"
_gourl="github.com/joewalnes/websocketd"
_builddir="$srcdir"/src/$_gourl

snapshot() {
        abuild clean && abuild deps
        export GOPATH="$srcdir"
        msg "Checking out v${pkgver} tag"
        git clone -q --branch v${pkgver} https://$_gourl $_builddir || return 1
        cd $_builddir
        go get -v -d || return 1
        cd "$srcdir"
        tar zcf $pkgname-$pkgver.tar.gz src || return 1
        rsync --progress -La $pkgname-$pkgver.tar.gz \
                $_disturl || return 1
	cd $startdir && abuild undeps
}


prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
        cd "$_builddir" || return 1
        export GOPATH="$srcdir"
        go fix || return 1
        go build -v -ldflags "-X main.version $pkgver" || return 1
}

package() {
	cd "$_builddir"
	install -Dm 0755 $pkgname "$pkgdir"/usr/bin/$pkgname || return 1
	mkdir -p "$pkgdir"/usr/share/man/man8
	gzip -c release/websocketd.man > \
		"$pkgdir"/usr/share/man/man8/websocketd.man.gz || return 1
}

md5sums="226b6f6125a6cf8d747ecd5fb619913a  websocketd-0.2.10.tar.gz"
sha256sums="cecaf94886021f305db659fc2919cd2226ece6e382fc8182fc214c9c24deadc3  websocketd-0.2.10.tar.gz"
sha512sums="b02a5d4cc4e448571e370db0713ebab83c905beab5b38738aed812eefd4cd8bbe5f8454aa6d36e78295ebf1e995fba41b06fe1d78fb2e6d2eb1f31229bcdcc09  websocketd-0.2.10.tar.gz"