# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-jekyll-watch
_gemname=jekyll-watch
pkgver=2.2.1
pkgrel=5
pkgdesc="Rebuild your Jekyll site when a file changes with the --watch switch"
url="https://github.com/jekyll/jekyll-watch"
arch="noarch"
license="MIT"
depends="ruby ruby-listen~3"
source="https://github.com/jekyll/jekyll-watch/archive/v$pkgver/$_gemname-$pkgver.tar.gz
	gemspec.patch
	"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # circular dependency with jekyll

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="
55867bedf0f453aad7df267d21cc2a49857916b51ed70e727718c9ed18dedd474bc45c446abcbc803ab4b8b26f8afb1f0e05e6655441186788fbace869c74b6d  jekyll-watch-2.2.1.tar.gz
f58c5008f521878eb0e6a65a00812e7a8cdfad814c1d88b5b50c8e4712c82705e38a91bc34601b3d2aef801b3fd3a6666d5b863512f757c7c19e4da76c9ec118  gemspec.patch
"
