diff options
author | Mamoru Komachi <usata@gentoo.org> | 2003-11-14 23:48:13 +0000 |
---|---|---|
committer | Mamoru Komachi <usata@gentoo.org> | 2003-11-14 23:48:13 +0000 |
commit | 51aad48302b13608e28721a364e5c300b87e72e5 (patch) | |
tree | 54866fb9ff1b8143886f26342feed95269341001 /dev-lang | |
parent | Added ruby-config. Fixed erb symlink path for ruby 1.8. (diff) | |
download | gentoo-2-51aad48302b13608e28721a364e5c300b87e72e5.tar.gz gentoo-2-51aad48302b13608e28721a364e5c300b87e72e5.tar.bz2 gentoo-2-51aad48302b13608e28721a364e5c300b87e72e5.zip |
Added ruby-config. Fixed erb symlink path for ruby 1.8.
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/ruby/ChangeLog | 9 | ||||
-rw-r--r-- | dev-lang/ruby/Manifest | 10 | ||||
-rw-r--r-- | dev-lang/ruby/files/digest-ruby-1.6.8-r3 | 1 | ||||
-rw-r--r-- | dev-lang/ruby/files/digest-ruby-1.8.0-r2 | 1 | ||||
-rw-r--r-- | dev-lang/ruby/files/digest-ruby-1.8.1_pre2-r1 | 1 | ||||
-rw-r--r-- | dev-lang/ruby/files/ruby-config | 116 | ||||
-rw-r--r-- | dev-lang/ruby/ruby-1.6.8-r3.ebuild | 99 | ||||
-rw-r--r-- | dev-lang/ruby/ruby-1.8.0-r2.ebuild | 127 | ||||
-rw-r--r-- | dev-lang/ruby/ruby-1.8.1_pre2-r1.ebuild | 127 |
9 files changed, 485 insertions, 6 deletions
diff --git a/dev-lang/ruby/ChangeLog b/dev-lang/ruby/ChangeLog index b7ebddc843d1..4b31e4607f9e 100644 --- a/dev-lang/ruby/ChangeLog +++ b/dev-lang/ruby/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-lang/ruby # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.39 2003/11/12 18:05:40 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ChangeLog,v 1.40 2003/11/14 23:48:08 usata Exp $ + +*ruby-1.8.1_pre2-r1 (15 Nov 2003) + + 15 Nov 2003; Mamoru KOMACHI <usata@gentoo.org> ruby-1.6.8-r3.ebuild, + ruby-1.8.0-r2.ebuild, ruby-1.8.1_pre2-r1.ebuild, files/ruby-config: + Added ruby-config. Fixed erb symlink path in ruby-1.8.0-r1.ebuild + and ruby-1.8.1_pre2.ebuild. 12 Nov 2003; Aron Griffis <agriffis@gentoo.org> ruby-1.8.0-r1.ebuild: Mark this version stable on all arches since we've had almost-complete diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest index 83d90243e48d..c6774ec9d505 100644 --- a/dev-lang/ruby/Manifest +++ b/dev-lang/ruby/Manifest @@ -1,20 +1,20 @@ -MD5 e18df96a1a1ba31dd83388e49213a60c ChangeLog 5484 +MD5 f0188553f0a0b29c9092759787186076 ChangeLog 5756 MD5 3eec9f3fe48b51f49dbc1f171a3b026f metadata.xml 157 -MD5 c45d3b73f57d8f66d30a26ee0040f03b ruby-1.6.8-r3.ebuild 2782 +MD5 8b9c740ec07526f5136c171d83bc64b4 ruby-1.6.8-r3.ebuild 2782 MD5 bff60050f38ea67025c965e1f04638eb ruby-1.6.8.ebuild 749 MD5 747c313a6aa5cd0b128efc5391193c3f ruby-1.6.8-r1.ebuild 878 -MD5 aa84e61924e048481f95ee4a70daf868 ruby-1.8.0-r2.ebuild 3702 +MD5 11457bde2a5c75df9e6805b209a4132d ruby-1.8.0-r2.ebuild 3699 MD5 518ad06bdd3bd5fec8923d53765caee0 ruby-1.8.0.ebuild 1746 MD5 8f07d3db7881f79ac5fc69de93dde954 ruby-1.8.1_pre2.ebuild 3555 MD5 bbaa912ac925892e8913dd9f6119319f ruby-1.6.8-r2.ebuild 2619 MD5 543221297a32fa3465cf1b33f7d328dd ruby-1.8.0-r1.ebuild 3555 -MD5 fbf5f82fe5fc552a283fd97d37c16881 ruby-1.8.1_pre2-r1.ebuild 3690 +MD5 3b61e033e030e6a4facc9d8f8f9274f7 ruby-1.8.1_pre2-r1.ebuild 3693 MD5 11702b3cb52c88daf5d3934e3a0c2e2a files/digest-ruby-1.6.8 63 MD5 11702b3cb52c88daf5d3934e3a0c2e2a files/digest-ruby-1.6.8-r1 63 MD5 11702b3cb52c88daf5d3934e3a0c2e2a files/digest-ruby-1.6.8-r2 63 MD5 e1c6eac35da8ce7f11bab66795de0b80 files/digest-ruby-1.8.0-r1 63 MD5 d003e00078f32c4b70af60291c2acef9 files/digest-ruby-1.8.1_pre2 72 -MD5 21080e1997614dc921bf9e74b243344d files/ruby-config 2658 +MD5 d90083c78cc085c05cf293b2ca19051d files/ruby-config 2751 MD5 11702b3cb52c88daf5d3934e3a0c2e2a files/digest-ruby-1.6.8-r3 63 MD5 e1c6eac35da8ce7f11bab66795de0b80 files/digest-ruby-1.8.0-r2 63 MD5 d003e00078f32c4b70af60291c2acef9 files/digest-ruby-1.8.1_pre2-r1 72 diff --git a/dev-lang/ruby/files/digest-ruby-1.6.8-r3 b/dev-lang/ruby/files/digest-ruby-1.6.8-r3 new file mode 100644 index 000000000000..0b9291d168d1 --- /dev/null +++ b/dev-lang/ruby/files/digest-ruby-1.6.8-r3 @@ -0,0 +1 @@ +MD5 bf48d49dbd94b5c0eda5f75b3bfbac16 ruby-1.6.8.tar.gz 1023403 diff --git a/dev-lang/ruby/files/digest-ruby-1.8.0-r2 b/dev-lang/ruby/files/digest-ruby-1.8.0-r2 new file mode 100644 index 000000000000..6bc2df5cd820 --- /dev/null +++ b/dev-lang/ruby/files/digest-ruby-1.8.0-r2 @@ -0,0 +1 @@ +MD5 582a65e52598a4a1e9fce523e16e67d6 ruby-1.8.0.tar.gz 1979070 diff --git a/dev-lang/ruby/files/digest-ruby-1.8.1_pre2-r1 b/dev-lang/ruby/files/digest-ruby-1.8.1_pre2-r1 new file mode 100644 index 000000000000..9368af3be691 --- /dev/null +++ b/dev-lang/ruby/files/digest-ruby-1.8.1_pre2-r1 @@ -0,0 +1 @@ +MD5 067deb137b70d6ca046f6d7e9a84e198 ruby-1.8.1-preview2.tar.gz 2459891 diff --git a/dev-lang/ruby/files/ruby-config b/dev-lang/ruby/files/ruby-config new file mode 100644 index 000000000000..a816301fbc47 --- /dev/null +++ b/dev-lang/ruby/files/ruby-config @@ -0,0 +1,116 @@ +#!/bin/bash + +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/files/ruby-config,v 1.1 2003/11/14 23:48:08 usata Exp $ + +# Author: Mamoru KOMACHI <usata@gentoo.org> + +if [ -z "${PORTDIR}" ] ; then + [ -r /etc/make.conf ] && source /etc/make.conf + if [ -z "${PORTDIR}" ] ; then + [ -r /etc/make.globals ] && source /etc/make.globals + fi +fi + +if [ -r /etc/init.d/functions.sh ] ; then + source /etc/init.d/functions.sh +else + echo "Could not find /etc/init.d/functions.sh" + exit 1 +fi + +#dummy function +EXPORT_FUNCTIONS() { :; } + +if [ -r ${PORTDIR:-/usr/portage}/eclass/alternatives.eclass ] ; then + source ${PORTDIR:-/usr/portage}/eclass/alternatives.eclass +else + echo "Could not find ${PORTDIR:-/usr/portage}/bin/ebuild.sh" + exit 1 +fi + +usage() { +cat << "USAGE_END" +Usage: ruby-config [Option] [Ruby Profile] +Change the current ruby profile, or give info about profiles. + +Options: + + -c, --get-current-profile + Print current used ruby profile. + -h, --show-help + Print this help. + +The profile name is either ruby16 or ruby18. + +USAGE_END +exit 1 +} + +if [ "$#" -lt 1 ] ; then + usage +fi + +switch_profile() { + if [ "$EUID" != 0 ] ; then + eerror "You need root privilege to switch profile." + exit 1 + fi + if [ "$1" = ruby16 ] ; then + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{16,18} + alternatives_makesym /usr/bin/irb /usr/bin/irb{16,18} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{16,18}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{16,18}.1.gz + elif [ "$1" = ruby18 ] ; then + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{18,16} + alternatives_makesym /usr/bin/irb /usr/bin/irb{18,16} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{18,16}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{18,16}.1.gz + else + eerror "Unsupported profile." + fi +} + +get_current_profile() { + if [ ! -L /usr/bin/ruby ] ; then + eerror "Your ruby doesn't seem to support SLOT." + exit 1 + fi + if [ `readlink /usr/bin/ruby` = ruby18 ] ; then + einfo "Your current profile refers to ruby18." + elif [ `readlink /usr/bin/ruby` = ruby16 ] ; then + einfo "Your current profile refers to ruby16." + else + eerror "Unknown profile." + fi +} + +for x in $* ; do + if [ "$#" -gt 1 ] ; then + eerror "ruby-config accepts only one argument." + eerror "Run $0 -h for help." + exit 1 + fi + case "${x}" in + -c|--get-current-profile) + get_current_profile + ;; + -h|--show-help) + usage + ;; + -*) + eerror "Invalid option. Run $0 -h for help." + exit 1 + ;; + *) + switch_profile $* + ;; + esac + + exit 0 +done diff --git a/dev-lang/ruby/ruby-1.6.8-r3.ebuild b/dev-lang/ruby/ruby-1.6.8-r3.ebuild new file mode 100644 index 000000000000..b6a95b3cd953 --- /dev/null +++ b/dev-lang/ruby/ruby-1.6.8-r3.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.6.8-r3.ebuild,v 1.1 2003/11/14 23:48:08 usata Exp $ + +IUSE="ruby18" + +inherit flag-o-matic alternatives eutils +filter-flags -fomit-frame-pointer + +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="http://www.ruby-lang.org/" +SRC_URI="mirror://ruby/${PV%.*}/${P/_pre/-preview}.tar.gz" + +LICENSE="Ruby" +SLOT="1.6" +KEYWORDS="x86 alpha ppc sparc hppa amd64 -ia64" + +DEPEND=">=sys-libs/glibc-2.1.3 + >=sys-libs/gdbm-1.8.0 + >=sys-libs/readline-4.1 + >=sys-libs/ncurses-5.2" + +pkg_setup() { + + ewarn + ewarn "If you have installed <dev-lang/ruby-1.6.8-r2 (ruby-1.6 branch) or" + ewarn "<dev-lang/ruby-1.8.0-r1 (ruby-1.8 branch) please unmerge them first." + ewarn "SLOT supports >=ruby-1.6.8-r2 and >=ruby-1.8.0-r1 only." + ewarn + einfo + einfo "Also if you want to use ruby-1.8 by default you need to set" + einfo "\tUSE=\"ruby18\"" + einfo "otherwise ruby-1.6 will be used." + einfo + + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + sleep 8 +} + +src_unpack() { + unpack ${A} + cd ${S} + use amd64 && epatch ${FILESDIR}/ruby-1.6.8-fix-x86_64.patch +} + +src_compile() { + econf --program-suffix=16 --enable-shared || die + emake || die +} + +src_install() { + make DESTDIR=${D} install || die + + dosym /usr/lib/libruby16.so.${PV} /usr/lib/libruby.so.${PV%.*} + dosym /usr/lib/libruby16.so.${PV} /usr/lib/libruby.so.${PV} + + dobin ${FILESDIR}/ruby-config + + dodoc COPYING* ChangeLog MANIFEST README* ToDo +} + +ruby_alternatives() { + if [ -n "`use ruby18`" ] ; then + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{18,16} + alternatives_makesym /usr/bin/irb /usr/bin/irb{18,16} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{18,16}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{18,16}.1.gz + else + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{16,18} + alternatives_makesym /usr/bin/irb /usr/bin/irb{16,18} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{16,18}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{16,18}.1.gz + fi +} + +pkg_postinst() { + ruby_alternatives + einfo + einfo "If you have both ruby 1.6 and 1.8 installed, you can switch" + einfo "default ruby by /usr/bin/ruby-config." + einfo +} + +pkg_postrm() { + ruby_alternatives +} diff --git a/dev-lang/ruby/ruby-1.8.0-r2.ebuild b/dev-lang/ruby/ruby-1.8.0-r2.ebuild new file mode 100644 index 000000000000..883ad6847694 --- /dev/null +++ b/dev-lang/ruby/ruby-1.8.0-r2.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.8.0-r2.ebuild,v 1.1 2003/11/14 23:48:08 usata Exp $ + +inherit flag-o-matic alternatives eutils gnuconfig +filter-flags -fomit-frame-pointer + +S=${WORKDIR}/${P%_pre*} +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="http://www.ruby-lang.org/" +SRC_URI="mirror://ruby/${PV%.*}/${P/_pre/-preview}.tar.gz" + +LICENSE="Ruby" +SLOT="1.8" +KEYWORDS="~alpha ~arm ~hppa ~ia64 ~mips ~ppc ~sparc ~x86" +IUSE="socks5 tcltk ruby18" + +DEPEND=">=sys-libs/glibc-2.1.3 + >=sys-libs/gdbm-1.8.0 + >=sys-libs/readline-4.1 + >=sys-libs/ncurses-5.2 + socks5? ( >=net-misc/dante-1.1.13 ) + tcltk? ( dev-lang/tk ) + sys-apps/findutils" + +pkg_setup() { + + ewarn + ewarn "If you have installed <dev-lang/ruby-1.6.8-r2 (ruby-1.6 branch) or" + ewarn "<dev-lang/ruby-1.8.0-r1 (ruby-1.8 branch) please unmerge them first." + ewarn "SLOT supports >=ruby-1.6.8-r2 and >=ruby-1.8.0-r1 only." + ewarn + einfo + einfo "Also if you want to use ruby-1.8 by default you need to set" + einfo "\tUSE=\"ruby18\"" + einfo "otherwise ruby-1.6 will be used." + einfo + + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + sleep 8 +} + +src_unpack() { + unpack ${A} + cd ${WORKDIR} + + # Enable build on alpha EV67 + if use alpha; then + gnuconfig_update || die "gnuconfig_update failed" + fi +} + +src_compile() { + # Socks support via dante + if [ ! -n "`use socks5`" ] ; then + # Socks support can't be disabled as long as SOCKS_SERVER is + # set and socks library is present, so need to unset + # SOCKS_SERVER in that case. + unset SOCKS_SERVER + fi + + # Increase GC_MALLOC_LIMIT if set (default is 8000000) + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then + CFLAGS="${CFLAGS} -DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" + export CFLAGS + fi + + econf --program-suffix=18 --enable-shared \ + `use_enable socks5 socks` \ + || die "econf failed" + emake || die "emake failed" +} + +src_install() { + make DESTDIR=${D} install || die "make install failed" + + dosym /usr/lib/libruby18.so.${PV} /usr/lib/libruby.so.${PV%.*} + dosym /usr/lib/libruby18.so.${PV} /usr/lib/libruby.so.${PV} + dosym /usr/bin/erb18 /usr/bin/erb + + dobin ${FILESDIR}/ruby-config + + dodoc COPYING* ChangeLog MANIFEST README* ToDo +} + +ruby_alternatives() { + if [ -n "`use ruby18`" ] ; then + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{18,16} + alternatives_makesym /usr/bin/irb /usr/bin/irb{18,16} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{18,16}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{18,16}.1.gz + else + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{16,18} + alternatives_makesym /usr/bin/irb /usr/bin/irb{16,18} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{16,18}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{16,18}.1.gz + fi +} + +pkg_postinst() { + ruby_alternatives + ewarn + ewarn "Warning: Vim won't work if you've just updated ruby from" + ewarn "1.6.8 to 1.8.0 due to the library version change." + ewarn "In that case, you will need to remerge vim." + ewarn + einfo "If you have both ruby 1.6 and 1.8 installed, you can switch" + einfo "default ruby by /usr/bin/ruby-config." + einfo +} + +pkg_postrm() { + ruby_alternatives +} diff --git a/dev-lang/ruby/ruby-1.8.1_pre2-r1.ebuild b/dev-lang/ruby/ruby-1.8.1_pre2-r1.ebuild new file mode 100644 index 000000000000..07eb0890c63a --- /dev/null +++ b/dev-lang/ruby/ruby-1.8.1_pre2-r1.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.8.1_pre2-r1.ebuild,v 1.1 2003/11/14 23:48:08 usata Exp $ + +inherit flag-o-matic alternatives eutils gnuconfig +filter-flags -fomit-frame-pointer + +S=${WORKDIR}/${P%_pre*} +DESCRIPTION="An object-oriented scripting language" +HOMEPAGE="http://www.ruby-lang.org/" +SRC_URI="mirror://ruby/${PV%.*}/${P/_pre/-preview}.tar.gz" + +LICENSE="Ruby" +SLOT="1.8" +KEYWORDS="~alpha ~arm ~hppa ~mips ~sparc ~x86" +IUSE="socks5 tcltk ruby18" + +DEPEND=">=sys-libs/glibc-2.1.3 + >=sys-libs/gdbm-1.8.0 + >=sys-libs/readline-4.1 + >=sys-libs/ncurses-5.2 + socks5? ( >=net-misc/dante-1.1.13 ) + tcltk? ( dev-lang/tk ) + sys-apps/findutils" + +pkg_setup() { + + ewarn + ewarn "If you have installed <dev-lang/ruby-1.6.8-r2 (ruby-1.6 branch) or" + ewarn "<dev-lang/ruby-1.8.0-r1 (ruby-1.8 branch) please unmerge them first." + ewarn "SLOT supports >=ruby-1.6.8-r2 and >=ruby-1.8.0-r1 only." + ewarn + einfo + einfo "Also if you want to use ruby-1.8 by default you need to set" + einfo "\tUSE=\"ruby18\"" + einfo "otherwise ruby-1.6 will be used." + einfo + + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" ; sleep 1 + sleep 8 +} + +src_unpack() { + unpack ${A} + cd ${WORKDIR} + + # Enable build on alpha EV67 + if use alpha; then + gnuconfig_update || die "gnuconfig_update failed" + fi +} + +src_compile() { + # Socks support via dante + if [ ! -n "`use socks5`" ] ; then + # Socks support can't be disabled as long as SOCKS_SERVER is + # set and socks library is present, so need to unset + # SOCKS_SERVER in that case. + unset SOCKS_SERVER + fi + + # Increase GC_MALLOC_LIMIT if set (default is 8000000) + if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then + CFLAGS="${CFLAGS} -DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}" + export CFLAGS + fi + + econf --program-suffix=18 --enable-shared \ + `use_enable socks5 socks` \ + || die "econf failed" + emake || die "emake failed" +} + +src_install() { + make DESTDIR=${D} install || die "make install failed" + + dosym /usr/lib/libruby18.so.${PV} /usr/lib/libruby.so.${PV%.*} + dosym /usr/lib/libruby18.so.${PV} /usr/lib/libruby.so.${PV} + dosym /usr/bin/erb18 /usr/bin/erb + + dobin ${FILESDIR}/ruby-config + + dodoc COPYING* ChangeLog MANIFEST README* ToDo +} + +ruby_alternatives() { + if [ -n "`use ruby18`" ] ; then + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{18,16} + alternatives_makesym /usr/bin/irb /usr/bin/irb{18,16} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{18,16}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{18,16}.1.gz + else + alternatives_makesym /usr/bin/ruby /usr/bin/ruby{16,18} + alternatives_makesym /usr/bin/irb /usr/bin/irb{16,18} + alternatives_makesym /usr/lib/libruby.so \ + /usr/lib/libruby{16,18}.so + alternatives_makesym /usr/share/man/man1/ruby.1.gz \ + /usr/share/man/man1/ruby{16,18}.1.gz + fi +} + +pkg_postinst() { + ruby_alternatives + ewarn + ewarn "Warning: Vim won't work if you've just updated ruby from" + ewarn "1.6.8 to 1.8.0 due to the library version change." + ewarn "In that case, you will need to remerge vim." + ewarn + einfo "If you have both ruby 1.6 and 1.8 installed, you can switch" + einfo "default ruby by /usr/bin/ruby-config." + einfo +} + +pkg_postrm() { + ruby_alternatives +} |