aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-hpricot/APKBUILD
blob: a776c698e4b5e7995aff0d94b1257e63184b6c71 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
# Note: This project is dead, but it's needed for some packages.
pkgname=ruby-hpricot
_gemname=hpricot
pkgver=0.8.6
pkgrel=1
pkgdesc="A swift, liberal HTML parser with a fantastic library (legacy)"
url="https://github.com/hpricot/hpricot"
arch="all"
license="MIT"
checkdepends="ruby-test-unit"
makedepends="ruby-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/hpricot/$_gemname/archive/$pkgver.tar.gz
	rakefile.patch"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	cd "$builddir"

	gem build $_gemname.gemspec
	gem install --local \
		--install-dir dist \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname
}

check() {
	cd "$builddir"

	local file; for file in test/test_*.rb; do
		ruby -I dist/gems/$_gemname-$pkgver/lib -I test $file
	done
}

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

	mkdir -p "$gemdir"
	cp -r extensions gems specifications "$gemdir"/

	# Remove unnecessary files and rubbish...
	find "$gemdir"/extensions/ -name mkmf.log -delete
	cd "$gemdir"/gems/$_gemname-$pkgver
	rm -r ext/ lib/*.so test/ CHANGELOG* COPYING README* Rakefile
}

sha512sums="0b35295745d36483fbd0c0ea7751c9e9672efdc3738145991a4799e3e2f75ec05cc833b28eacb45631a805b760b6f83a179bbbd830a3b30ea25749d243f527d7  ruby-hpricot-0.8.6.tar.gz
3e6c479302af5964a036ca2c9a9616f3e65f5c0dc60aaf11d3ea5eae2016babd0fd88dfbc6c914a56fd85a2641f6d9ec1b75099bebe0599da530f35e81f26df0  rakefile.patch"