# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-em-websocket
_gemname=em-websocket
pkgver=0.5.3
pkgrel=3
pkgdesc="EventMachine based WebSocket server"
url="https://github.com/igrigorik/em-websocket"
arch="noarch"
license="MIT"
depends="ruby ruby-eventmachine ruby-http_parser.rb"
source="https://github.com/igrigorik/em-websocket/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # FIXME: tests require additional dependencies

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions
}

sha512sums="
28d5cf042899319f50ff0d3b140d75fb281b7e0635118a63df243151c4f442dbabf7dbe15b26b44167d925ed00819b01eeeef110107e4058d8a534f84913b232  ruby-em-websocket-0.5.3.tar.gz
a6cf238ae0c4f51d39b7ede1318da615721618d1d2561d1a6774a4fe9f3fe61452e2e7ca711a7e2caedc8bd3bddd5a17fc212ffac60f2bc6924665cddc089af0  gemspec.patch
"
