1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 DISTUTILS_OPTIONAL=true
6 DISTUTILS_SINGLE_IMPL=true
7 GENTOO_DEPEND_ON_PERL=no
8 PYTHON_COMPAT=( python{2_7,3_5,3_6} )
9 inherit autotools perl-module distutils-r1 flag-o-matic multilib
13 DESCRIPTION="A system to store and display time-series data"
14 HOMEPAGE="https://oss.oetiker.ch/rrdtool/"
15 SRC_URI="${HOMEPAGE}pub/${MY_P}.tar.gz"
19 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
20 IUSE="dbi doc graph lua perl python rados rrdcgi ruby static-libs tcl tcpd"
21 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
24 >=dev-libs/glib-2.28.7:2[static-libs(+)?]
25 >=dev-libs/libxml2-2.7.8:2[static-libs(+)?]
26 dbi? ( dev-db/libdbi[static-libs(+)?] )
28 >=media-libs/libpng-1.5.10:0=[static-libs(+)?]
29 >=x11-libs/cairo-1.10.2[svg,static-libs(+)?]
32 lua? ( dev-lang/lua:*[deprecated] )
33 perl? ( dev-lang/perl:= )
34 python? ( ${PYTHON_DEPS} )
35 rados? ( sys-cluster/ceph )
36 tcl? ( dev-lang/tcl:0= )
37 tcpd? ( sys-apps/tcp-wrappers )
50 ruby? ( ~dev-ruby/rrdtool-bindings-${PV} )
53 "${FILESDIR}"/${PN}-1.4.9-disable-rrd_graph-perl.patch
54 "${FILESDIR}"/${PN}-1.7.0-disable-rrd_graph-cgi.patch
55 "${FILESDIR}"/${PN}-1.7.1-configure.ac.patch
60 cd bindings/python || die
61 distutils-r1_python_compile
65 cd bindings/python || die
66 distutils-r1_python_install
70 use python && python-single-r1_pkg_setup
75 # At the next version bump, please see if you actually still need this
76 # before adding versions
77 if ! [ -f doc/rrdrados.pod ]; then
78 cp "${FILESDIR}"/${PN}-1.5.5-rrdrados.pod doc/rrdrados.pod
80 die "File already exists: doc/rrdrados.pod. Remove this code!"
86 -e 's|$LUA_CFLAGS|IGNORE_THIS_BAD_TEST|g' \
88 -e '/^dnl.*png/s|^dnl||g' \
91 # Python bindings are built/installed manually
93 -e '/^all-local:/s| @COMP_PYTHON@||' \
94 bindings/Makefile.am || die
98 -e '2s:rpn1::; 2s:rpn2::; 6s:create-with-source-4::;' \
99 -e '7s:xport1::; 7s:dcounter1::; 7s:vformatter1::' \
100 tests/Makefile.am || die
103 export rd_cv_gcc_flag__Werror=no
109 filter-flags -ffast-math
111 export RRDDOCDIR=${EPREFIX}/usr/share/doc/${PF}
113 # to solve bug #260380
114 [[ ${CHOST} == *-solaris* ]] && append-flags -D__EXTENSIONS__
119 myconf+=( "--disable-libwrap" )
122 myconf+=( "--disable-libdbi" )
125 myconf+=( "--disable-librados" )
129 $(use_enable graph rrd_graph) \
130 $(use_enable lua lua-site-install) \
132 $(use_enable perl perl-site-install) \
134 $(use_enable python) \
135 $(use_enable rrdcgi) \
136 $(use_enable static-libs static) \
138 $(use_with tcl tcllib "${EPREFIX}"/usr/$(get_libdir)) \
139 --with-perl-options=INSTALLDIRS=vendor \
140 --disable-ruby-site-install \
148 use python && distutils-r1_src_compile
160 rm -rf "${ED}"usr/share/doc/${PF}/{html,txt}
163 if use !rrdcgi ; then
164 # uses rrdcgi, causes invalid shebang error in Prefix, useless
165 # without rrdcgi installed
166 rm -f "${ED}"usr/share/${PN}/examples/cgi-demo.cgi
174 dodoc CHANGES CONTRIBUTORS NEWS THREADS TODO
176 find "${ED}"usr -name '*.la' -exec rm -f {} +
178 keepdir /var/lib/rrdcached/journal/
179 keepdir /var/lib/rrdcached/db/
181 newconfd "${FILESDIR}"/rrdcached.confd rrdcached
182 newinitd "${FILESDIR}"/rrdcached.init rrdcached
184 use python && distutils-r1_src_install