1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 USE_RUBY="ruby20 ruby21 ruby22 ruby23"
7 RUBY_FAKEGEM_TASK_DOC=""
8 RUBY_FAKEGEM_RECIPE_TEST="rspec"
9 RUBY_FAKEGEM_EXTRADOC="README.md"
10 RUBY_FAKEGEM_BINWRAP="facter"
14 DESCRIPTION="A cross-platform Ruby library for retrieving facts from operating systems"
15 HOMEPAGE="http://www.puppetlabs.com/puppet/related-projects/facter/"
19 IUSE="+dmi +pciutils +virt"
20 KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
23 app-emulation/virt-what
26 dmi? ( sys-apps/dmidecode )
27 pciutils? ( sys-apps/pciutils )"
29 RDEPEND+=" ${CDEPEND}"
30 DEPEND+=" test? ( ${CDEPEND} )"
32 ruby_add_bdepend "test? ( dev-ruby/mocha:1.0 )"
35 # Provide explicit path since /sbin is not in the default PATH on
37 sed -i -e 's:arp -an:/sbin/arp -an:' lib/facter/util/ec2.rb spec/unit/util/ec2_spec.rb || die
39 # Ensure the correct version of mocha is used without using bundler.
40 sed -i -e '1igem "mocha", "~>1.0"' spec/spec_helper.rb || die
42 # Avoid because tests try to access outside stuff, e.g. /sys/block
43 sed -i -e '/should load facts on the facter search path only once/,/^ end/ s:^:#:' spec/unit/util/loader_spec.rb || die
45 # Allow specs to work with newer rspec 2.x versions.
46 sed -i -e '1irequire "rspec-expectations"' spec/puppetlabs_spec/matchers.rb || die
48 # Avoid specs specific to macosx requiring cfpropertylist which is
49 # not available anymore.
50 rm spec/unit/util/macosx_spec.rb || die
51 sed -i -e '/macosx/ s:^:#:' \
52 -e '/on Darwin/,/^ end/ s:^:#:' spec/unit/virtual_spec.rb || die
53 sed -i -e '/Facter::Processors::Darwin/,/^end/ s:^:#:' spec/unit/processors/os_spec.rb || die
59 # Create the directory for custom facts.
60 keepdir /etc/facter/facts.d