Commit ca7ca73c authored by Jakub Jirutka's avatar Jakub Jirutka

community/jruby: add simple check and modernize abuild

parent 14253acf
......@@ -41,28 +41,36 @@ prepare() {
rm -r win32 Win32API.rb
# Remove useless native binaries from JARs.
zip -qd jline/jline/*/jline-*.jar META-INF/native/* || return 1
zip -qd jline/jline/*/jline-*.jar META-INF/native/*
zip -qd "$builddir"/lib/jruby.jar jni/*
}
check() (
cd "$srcdir"
export JRUBY_HOME="$builddir"
sh jruby --version
sh jruby -e 'puts "Hello, world!"'
)
package() {
cd "$builddir"
install -m644 -D "$builddir"/lib/jruby.jar \
"$pkgdir"$_destdir/lib/jruby.jar || return 1
"$pkgdir"$_destdir/lib/jruby.jar
install -m755 -D "$srcdir"/jruby "$pkgdir"$_bindir/jruby || return 1
install -m755 -D "$srcdir"/jruby "$pkgdir"$_bindir/jruby
# Some of the below copied files will be moved to subpackages by split functions.
install -dm755 "$pkgdir"$_rubydir
cp -r lib/ruby/gems lib/ruby/stdlib "$pkgdir"$_destdir/lib/ruby/ || return 1
cp -r lib/ruby/gems lib/ruby/stdlib "$pkgdir"$_destdir/lib/ruby/
cp bin/* "$pkgdir"$_bindir/ || return 1
cp bin/* "$pkgdir"$_bindir/
install -dm755 "$pkgdir"/usr/bin
local file; for file in jgem jirb jruby jrubyc; do
ln -sf $_bindir/$file "$pkgdir"/usr/bin/$file || return 1
ln -sf $_bindir/$file "$pkgdir"/usr/bin/$file
done
install -m644 -D COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
......@@ -108,7 +116,7 @@ rake() {
pkgdesc="Ruby based make-like utility."
depends="$pkgname"
_mvgem rake || return 1
_mvgem rake
_mv $_bindir/rake
}
......@@ -116,7 +124,7 @@ rdoc() {
pkgdesc="Ruby documentation tool"
depends="$pkgname $pkgname-irb"
_mvgem rdoc || return 1
_mvgem rdoc
_mv $_bindir/rdoc $_bindir/ri
}
......@@ -124,7 +132,7 @@ readline() {
pkgdesc="Readline support for JRuby"
depends="$pkgname java-jansi-native"
_mv $_stdlibdir/jline || return 1
_mv $_stdlibdir/jline
mv "$pkgdir"$_stdlibdir/readline* "$subpkgdir"$_stdlibdir/
}
......@@ -132,7 +140,7 @@ test_unit() {
pkgdesc="Legacy xUnit family unit testing framework for JRuby"
depends="$pkgname $pkgname-power_assert"
_mvgem test-unit || return 1
_mvgem test-unit
_mv $_stdlibdir/test $_bindir/testrb
}
......@@ -147,7 +155,7 @@ libs() {
_mv() {
local path; for path in "$@"; do
mkdir -p "$subpkgdir"/${path%/*}
mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/ || return 1
mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
done
}
......@@ -161,7 +169,7 @@ _mvgem() {
./$_gemdir/gems/$name-* \
./$_gemdir/specifications/default/$name-*; do
[ -e "$pkgdir"/$file ] || continue
_mv "$file" || return 1
_mv "$file"
done
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment