summaryrefslogtreecommitdiff
path: root/dev-ruby/rrdtool-bindings/rrdtool-bindings-1.9.0-r1.ebuild
blob: 9d8f6d4b97544be133737598bd1c65519b41fc58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MY_P="${P/-bindings}"
MY_P="${MY_P/_/-}"

USE_RUBY="ruby31 ruby32 ruby33 ruby34"
RUBY_FAKEGEM_TASK_DOC=""

inherit ruby-ng

DESCRIPTION="Ruby bindings for rrdtool"
HOMEPAGE="https://oss.oetiker.ch/rrdtool/"
SRC_URI="https://github.com/oetiker/${PN/-bindings}-1.x/releases/download/v${PV}/${MY_P}.tar.gz"
RUBY_S="${MY_P}/bindings/ruby"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="graph test"
RESTRICT="!test? ( test )"

RDEPEND="
	~net-analyzer/rrdtool-${PV}
"
DEPEND="${RDEPEND}"

all_ruby_prepare() {
	eapply -p3 "${FILESDIR}"/${PN}-1.4.8-graph-ruby.patch
	use !graph && eapply -p3 "${FILESDIR}"/${PN}-1.4.8-no-graph-ruby-test.patch
}

each_ruby_configure() {
	rm ../../src/rrd_config.h || die
	touch ../../src/rrd_config.h || die

	${RUBY} extconf.rb \
		--with-cflags="${CFLAGS} $(usex graph -DHAVE_RRD_GRAPH -UHAVE_RRD_GRAPH)" || die
}

each_ruby_compile() {
	emake V=1 ABS_TOP_SRCDIR="${PWD}/../.."
}

each_ruby_test() {
	${RUBY} -I. test.rb || die
}

all_ruby_install() {
	dodoc CHANGES README
}

each_ruby_install() {
	DESTDIR=${D} emake install
}