aboutsummaryrefslogtreecommitdiffstats
path: root/community/ruby2.2
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-18 00:18:57 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-18 00:18:57 +0200
commitbd50328a639335a45341dee13d58afb54c1e30b7 (patch)
tree8066a0925f049e423b38880702263b9d8db9116b /community/ruby2.2
parent29b1a74db71505db76b6dc137b0127666654496b (diff)
downloadaports-bd50328a639335a45341dee13d58afb54c1e30b7.tar.bz2
aports-bd50328a639335a45341dee13d58afb54c1e30b7.tar.xz
community/ruby2.2: improve abuild
Diffstat (limited to 'community/ruby2.2')
-rw-r--r--community/ruby2.2/APKBUILD97
1 files changed, 46 insertions, 51 deletions
diff --git a/community/ruby2.2/APKBUILD b/community/ruby2.2/APKBUILD
index 48a94508ab..882144cd7f 100644
--- a/community/ruby2.2/APKBUILD
+++ b/community/ruby2.2/APKBUILD
@@ -2,10 +2,10 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby2.2
_pkgname=ruby
-pkgver=2.2.5
+_majorver=${pkgname#ruby}
+pkgver="$_majorver.5"
_pkgver=${pkgver/_/-}
-_suffix=${pkgname#ruby}
-_abi=2.2.0
+_abiver="$_majorver.0"
pkgrel=0
pkgdesc="An object-oriented language for quick and easy programming"
url="http://www.ruby-lang.org/en/"
@@ -24,18 +24,19 @@ source="ftp://ftp.ruby-lang.org/pub/ruby/${pkgver%.*}/$_pkgname-$_pkgver.tar.bz2
options="!fhs"
builddir="$srcdir/$_pkgname-$_pkgver"
-_gemdir="/usr/lib/ruby/gems/$_abi"
-_rubydir="/usr/lib/ruby/$_abi"
+_gemdir="/usr/lib/ruby/gems/$_abiver"
+_rubydir="/usr/lib/ruby/$_abiver"
+_chost="${CHOST/-alpine-/-}"
-_arch=$CARCH
-case $CARCH in
- x86) _arch=i386;;
+case "$CARCH" in
+ x86) _arch="i386";;
+ *) _arch="$CARCH";;
esac
prepare() {
- cd "$builddir"
-
default_prepare || return 1
+
+ cd "$builddir"
autoconf
}
@@ -67,7 +68,7 @@ build() {
--disable-rpath \
--enable-shared \
--with-mantype=man \
- --program-suffix=$_suffix \
+ --program-suffix=$_majorver \
--with-soname=$pkgname \
|| return 1
make || return 1
@@ -78,6 +79,7 @@ package() {
cd "$builddir"
make DESTDIR="$pkgdir" install || return 1
+
if [ -d "$pkgdir"/usr/local ]; then
local f=$(cd "$pkgdir" ; find usr/local -type f)
if [ -n "$f" ]; then
@@ -86,48 +88,16 @@ package() {
return 1
fi
fi
- install -Dm644 COPYING \
- "${pkgdir}/usr/share/licenses/$pkgname"/COPYING
-}
-
-_mv() {
- local i
- for i in "$@"; do
- mkdir -p "$subpkgdir"/${i%/*}
- mv "$pkgdir"/${i} "$subpkgdir"/${i%/*}/ || return 1
- done
-}
-
-_mvgem() {
- cd "$pkgdir"
- for i in ./$_rubydir/${1}.rb \
- ./$_rubydir/${1} \
- ./$_rubydir/${CHOST/-alpine-/-}/${1} \
- ./$_gemdir/gems/${1}-* \
- ./$_gemdir/specifications/default/${1}-* ; do
- [ -e "$pkgdir"/$i ] || continue
- _mv "$i"
- done
-}
-
-_rmgem() {
- cd "$pkgdir"
- for i in ./$_rubydir/${1}.rb \
- ./$_rubydir/${1} \
- ./$_rubydir/${CHOST/-alpine-/-}/${1} \
- ./$_gemdir/gems/${1}-* \
- ./$_gemdir/specifications/default/${1}-* ; do
- [ -e "$pkgdir"/$i ] && rm -r "$pkgdir/$i"
- done
- return 0
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
rake() {
pkgdesc="Ruby based make-like utility"
depends="$pkgname"
arch="noarch"
+
_mvgem rake || return 1
- _mv usr/bin/rake$_suffix
+ _mv usr/bin/rake$_majorver
}
irb() {
@@ -135,24 +105,27 @@ irb() {
replaces="$pkgname"
depends="$pkgname"
arch="noarch"
+
cd "$pkgdir"
- _mv usr/bin/irb$_suffix \
- usr/lib/ruby/$_abi/irb*
+ _mv usr/bin/irb$_majorver \
+ usr/lib/ruby/$_abiver/irb*
}
rdoc() {
pkgdesc="Ruby documentation tool"
depends="$pkgname $pkgname-json"
arch="noarch"
+
_mvgem rdoc || return 1
- _mv usr/bin/ri$_suffix \
- usr/bin/rdoc$_suffix
+ _mv usr/bin/ri$_majorver \
+ usr/bin/rdoc$_majorver
}
bigdecimal() {
pkgdesc="Ruby arbitrary-precision floating point decimal arithmetic"
depends="$pkgname"
arch="noarch"
+
_mvgem bigdecimal
}
@@ -160,30 +133,52 @@ io_console() {
pkgdesc="Ruby simple console IO library"
depends="$pkgname"
_mvgem io-console
+
_mv $_rubydir/io \
- $_rubydir/${CHOST/-alpine-/-}/io/console.so
+ $_rubydir/$_chost/io/console.so
}
minitest() {
pkgdesc="Ruby suite of testing facilities"
depends="$pkgname"
arch="noarch"
+
_mvgem minitest
}
json() {
pkgdesc="JSON implementation as a Ruby extension in C"
depends="$pkgname"
+
_mvgem json
}
libs() {
pkgdesc="Libraries necessary to run Ruby"
depends=""
+
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
}
+_mv() {
+ local i; for i in "$@"; do
+ mkdir -p "$subpkgdir"/${i%/*}
+ mv "$pkgdir"/${i} "$subpkgdir"/${i%/*}/ || return 1
+ done
+}
+
+_mvgem() {
+ cd "$pkgdir"
+ local path; for path in ./$_rubydir/${1}.rb \
+ ./$_rubydir/${1} \
+ ./$_rubydir/$_chost/${1} \
+ ./$_gemdir/gems/${1}-* \
+ ./$_gemdir/specifications/default/${1}-* ; do
+ [ -e "$pkgdir/$path" ] && _mv "$path"
+ done
+}
+
md5sums="0c7edd1ff3650c3b74da2efaf641bf34 ruby-2.2.5.tar.bz2"
sha256sums="22f0c6f34c0024e0bcaaa8e6831b7c0041e1ef6120c781618b833bde29626700 ruby-2.2.5.tar.bz2"
sha512sums="d3224814361c297bc36646c2e40f63c461ccf5a77fea5a3acdcb2c7ad1705bb229ac6abbd7ad1ae61cbe0fefd7a008c6102568d11366ad3107179302cd3e734e ruby-2.2.5.tar.bz2"