aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby-ox
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2018-02-18 03:11:35 +0100
committerJakub Jirutka <jakub@jirutka.cz>2018-02-18 03:11:35 +0100
commita22a3c39e87dcda66b1718318d97bb5ee054e732 (patch)
treeee491ef15ecb506d2094223863f508c4105b1036 /community/ruby-ox
parenta1fea74ed3d013128a95296086c73b3ab89a2304 (diff)
downloadaports-a22a3c39e87dcda66b1718318d97bb5ee054e732.tar.bz2
aports-a22a3c39e87dcda66b1718318d97bb5ee054e732.tar.xz
community/ruby-ox: move from testing
Diffstat (limited to 'community/ruby-ox')
-rw-r--r--community/ruby-ox/APKBUILD53
-rw-r--r--community/ruby-ox/gemspec.patch20
2 files changed, 73 insertions, 0 deletions
diff --git a/community/ruby-ox/APKBUILD b/community/ruby-ox/APKBUILD
new file mode 100644
index 0000000000..c644c0c750
--- /dev/null
+++ b/community/ruby-ox/APKBUILD
@@ -0,0 +1,53 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=ruby-ox
+_gemname=${pkgname#ruby-}
+pkgver=2.8.2
+pkgrel=1
+pkgdesc="A fast XML parser and object serializer for Ruby"
+url="https://github.com/ohler55/ox"
+arch="all"
+license="MIT"
+depends="ruby-bigdecimal"
+checkdepends="ruby ruby-test-unit"
+makedepends="ruby-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/ohler55/$_gemname/archive/v$pkgver.tar.gz
+ gemspec.patch"
+builddir="$srcdir/$_gemname-$pkgver"
+
+build() {
+ cd "$builddir"
+
+ gem build $_gemname.gemspec
+ gem install --local \
+ --install-dir dist \
+ --ignore-dependencies \
+ --no-document \
+ --verbose \
+ $_gemname
+
+ # Needed for tests.
+ cp -l dist/extensions/*/*/$_gemname-*/*.so ext/$_gemname/
+}
+
+check() {
+ cd "$builddir"
+
+ ./test/tests.rb
+ ./test/sax/sax_test.rb
+}
+
+package() {
+ local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
+ cd "$builddir"/dist
+
+ mkdir -p "$gemdir"
+ cp -r extensions gems specifications "$gemdir"/
+
+ # Remove unnecessary and duplicated files.
+ cd "$gemdir"/gems/$_gemname-$pkgver
+ rm -r ext/ lib/*.so || true
+}
+
+sha512sums="18a887db70962a1dd1c6ea18461eca0efbcffdb231f934c3603e63537e9911e820465ce5e4ab86cbedd65b396a9a12b0ad7e60ea7ae687c4ebe8436e0c37988c ruby-ox-2.8.2.tar.gz
+37b5033258b81efea4c3883b448cc996cd3c287336e66eb6a424d1cdb6c6db0470fe7eba02325adac3dc539ce7e75afaf0a290c57df21870b1ff53cfca917756 gemspec.patch"
diff --git a/community/ruby-ox/gemspec.patch b/community/ruby-ox/gemspec.patch
new file mode 100644
index 0000000000..925b9ba078
--- /dev/null
+++ b/community/ruby-ox/gemspec.patch
@@ -0,0 +1,20 @@
+--- a/ox.gemspec
++++ b/ox.gemspec
+@@ -18,15 +18,14 @@
+ serialization. }
+
+ s.licenses = ['MIT']
+- s.files = Dir["{lib,ext}/**/*.{rb,h,c}"] + ['LICENSE', 'README.md', 'CHANGELOG.md']
++ s.files = Dir["{lib,ext}/**/*.{rb,h,c}"]
+
+ s.extensions = ["ext/ox/extconf.rb"]
+ # s.executables = []
+
+- s.require_paths = ["lib", "ext"]
++ s.require_paths = ["lib"]
+
+ s.has_rdoc = true
+- s.extra_rdoc_files = ['README.md', 'CHANGELOG.md']
+ s.rdoc_options = ['--main', 'README.md', '--title', 'Ox Documentation', '--exclude', 'extconf.rb']
+
+ s.rubyforge_project = 'ox'