# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=gwsocket
pkgver=0.4
pkgrel=0
pkgdesc="A simple, standalone, language-agnostic, RFC6455 compliant WebSocket Server"
url="http://gwsocket.io"
arch="all"
license="MIT"
makedepends="autoconf automake"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/allinurl/$pkgname/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	autoreconf -fiv
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	local ver_output=$(./gwsocket --version || true)
	[ "$ver_output" = "GWSocket $pkgver" ]
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f82085b11fc87598b5f766de19b350ccf5905c70de894d6e2d33346456a1afa6a3ff1dd108e4edbefafbcddfc75dd4c79a099caffa9adfd8311ebee1baafb491  gwsocket-0.4.tar.gz
"
