# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-ruby/system_timer/system_timer-1.2.4.ebuild,v 1.2 2012/05/17 10:56:39 tomka Exp $ EAPI="4" USE_RUBY="ruby18 ree18" RUBY_FAKEGEM_TASK_TEST="test" RUBY_FAKEGEM_TASK_DOC="rdoc" RUBY_FAKEGEM_DOCDIR="rdoc" RUBY_FAKEGEM_EXTRADOC="README.markdown ChangeLog" GITHUB_USER="ph7" GITHUB_PROJECT="${PN/_/-}" inherit ruby-fakegem eutils DESCRIPTION="Signal-based timer for Ruby 1.8 (and RubyEE 1.8)" HOMEPAGE="http://ph7spot.com/musings/system-timer" SRC_URI="https://github.com/${GITHUB_USER}/${GITHUB_PROJECT}/tarball/${PV} -> ${P}.tar.gz" RUBY_S="${GITHUB_USER}-${GITHUB_PROJECT}-*" LICENSE="|| ( Ruby GPL-2 )" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" ruby_add_bdepend " test? ( dev-ruby/mocha dev-ruby/dust )" each_ruby_configure() { ${RUBY} -C ext/${PN} extconf.rb || die } each_ruby_compile() { emake -C ext/${PN} CFLAGS="${CFLAGS} -fPIC" archflag="${LDFLAGS}" cp ext/${PN}/*.so lib || die } each_ruby_install() { each_fakegem_install # and now... since the gem was renamed from SystemTimer, create a # fake SystemTimer gem... cat - < "${T}/SystemTimer.gemspec" # generated by ebuild # $Header: /var/cvsroot/gentoo-x86/dev-ruby/system_timer/system_timer-1.2.4.ebuild,v 1.2 2012/05/17 10:56:39 tomka Exp $ Gem::Specification.new do |s| s.name = "SystemTimer" s.version = "${RUBY_FAKEGEM_VERSION}" s.summary = "Fake gem to load system_timer" s.homepage = "${HOMEPAGE}" s.require_paths = ["lib"] s.specification_version = 3 s.add_runtime_dependency("${RUBY_FAKEGEM_NAME}", ["= ${RUBY_FAKEGEM_VERSION}"]) end EOF RUBY_FAKEGEM_NAME=SystemTimer \ RUBY_FAKEGEM_GEMSPEC="${T}/SystemTimer.gemspec" \ ruby_fakegem_install_gemspec dodir $(ruby_fakegem_gemsdir)/gems/SystemTimer-${PV}/lib cat - < "${D}/$(ruby_fakegem_gemsdir)/gems/SystemTimer-${PV}/lib/SystemTimer.rb" require 'system_timer' EOF }