diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-07-31 17:13:04 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-07-31 17:13:04 +0000 |
commit | 8ac0f173fdaf13a4737865ee7c41730168274106 (patch) | |
tree | 36793c6184173b426a74bcf813cb537109d9b843 /dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild | |
parent | Stabilize for everyone #330633 by Raúl Porcel. (diff) | |
download | gentoo-2-8ac0f173fdaf13a4737865ee7c41730168274106.tar.gz gentoo-2-8ac0f173fdaf13a4737865ee7c41730168274106.tar.bz2 gentoo-2-8ac0f173fdaf13a4737865ee7c41730168274106.zip |
Fix build function to actually build the extension on 1.8 and EE.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild')
-rw-r--r-- | dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild b/dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild new file mode 100644 index 000000000000..974eccb14570 --- /dev/null +++ b/dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-ruby/tmail/tmail-1.2.7.1-r2.ebuild,v 1.1 2010/07/31 17:13:04 flameeyes Exp $ + +EAPI=2 +USE_RUBY="ruby18 ree18 ruby19 jruby" + +RUBY_FAKEGEM_TASK_DOC="doc" +RUBY_FAKEGEM_DOCDIR="doc" +RUBY_FAKEGEM_EXTRADOC="README CHANGES NOTES" + +inherit ruby-fakegem + +DESCRIPTION="An email handling library" +HOMEPAGE="http://rubyforge.org/projects/tmail/" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos ~x64-solaris ~x86-solaris" +IUSE="debug" + +# Tests seem to be broken with the new encoding handling from Ruby, +# need to be verified twice; code seems to work anyway. +RESTRICT=test + +# Once it's added to portage, this should be added, right now it's +# bundled. +# ruby_add_rdepend dev-ruby/rchardet + +ruby_add_bdepend " + dev-ruby/racc + test? ( >=dev-ruby/mocha-0.9.5 )" + +all_ruby_prepare() { + # Provide file that is no longer distributed but still needed + mkdir meta || die "Failed to mkdir meta." + echo "tmail" > meta/unixname || die "Failed to create unixname file." +} + +each_ruby_configure() { + case ${RUBY} in + *ruby18 | *rubyee18) + ${RUBY} -Cext/tmailscanner/tmail extconf.rb || die "extconf failed" + ;; + esac +} + +each_ruby_compile() { + emake -C lib/tmail $(use debug && echo DEBUG=true) parser.rb || die "emake failed" + + case ${RUBY} in + *ruby18 | *rubyee18) + emake -Cext/tmailscanner/tmail \ + CFLAGS="${CFLAGS} -fPIC" archflag="${LDFLAGS}" || die "emake extension failed" + ;; + esac +} + +each_ruby_install() { + # We cannot use the recursive install because there are + # racc source files and a makefile. + find lib -name '*.rb' | while read file; do + ruby_fakegem_newins $file $file + done + + [[ -f ext/tmailscanner/tmail/tmailscanner.so ]] && \ + ruby_fakegem_newins ext/tmailscanner/tmail/tmailscanner.so lib/tmail/tmailscanner.so + + ruby_fakegem_genspec +} |