1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 DISTUTILS_OPTIONAL=true
7 DISTUTILS_SINGLE_IMPL=true
8 GENTOO_DEPEND_ON_PERL=no
9 PYTHON_COMPAT=( python{2_7,3_6} )
10 inherit autotools perl-module distutils-r1 flag-o-matic multilib
14 DESCRIPTION="A system to store and display time-series data"
15 HOMEPAGE="https://oss.oetiker.ch/rrdtool/"
16 SRC_URI="${HOMEPAGE}pub/${MY_P}.tar.gz"
20 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
21 IUSE="dbi doc graph lua perl python rados rrdcgi ruby static-libs tcl tcpd"
22 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
25 >=dev-libs/glib-2.28.7:2[static-libs(+)?]
26 >=dev-libs/libxml2-2.7.8:2[static-libs(+)?]
27 dbi? ( dev-db/libdbi[static-libs(+)?] )
29 >=media-libs/libpng-1.5.10:0=[static-libs(+)?]
30 >=x11-libs/cairo-1.10.2[svg,static-libs(+)?]
33 lua? ( dev-lang/lua:*[deprecated] )
34 perl? ( dev-lang/perl:= )
35 python? ( ${PYTHON_DEPS} )
36 rados? ( sys-cluster/ceph )
37 tcl? ( dev-lang/tcl:0= )
38 tcpd? ( sys-apps/tcp-wrappers )
51 ruby? ( ~dev-ruby/rrdtool-bindings-${PV} )
54 "${FILESDIR}"/${PN}-1.4.9-disable-rrd_graph-perl.patch
55 "${FILESDIR}"/${PN}-1.7.0-disable-rrd_graph-cgi.patch
56 "${FILESDIR}"/${PN}-1.7.1-configure.ac.patch
57 "${FILESDIR}"/${PN}-1.7.1-rrdcached.socket.patch
63 cd bindings/python || die
64 distutils-r1_python_compile
68 cd bindings/python || die
69 distutils-r1_python_install
73 use python && python-single-r1_pkg_setup
78 # At the next version bump, please see if you actually still need this
79 # before adding versions
80 if ! [ -f doc/rrdrados.pod ]; then
81 cp "${FILESDIR}"/${PN}-1.5.5-rrdrados.pod doc/rrdrados.pod
83 die "File already exists: doc/rrdrados.pod. Remove this code!"
89 -e 's|$LUA_CFLAGS|IGNORE_THIS_BAD_TEST|g' \
91 -e '/^dnl.*png/s|^dnl||g' \
94 # Python bindings are built/installed manually
96 -e '/^all-local:/s| @COMP_PYTHON@||' \
97 bindings/Makefile.am || die
101 -e '2s:rpn1::; 2s:rpn2::; 6s:create-with-source-4::;' \
102 -e '7s:xport1::; 7s:dcounter1::; 7s:vformatter1::' \
103 tests/Makefile.am || die
106 export rd_cv_gcc_flag__Werror=no
112 filter-flags -ffast-math
114 export RRDDOCDIR=${EPREFIX}/usr/share/doc/${PF}
116 # to solve bug #260380
117 [[ ${CHOST} == *-solaris* ]] && append-flags -D__EXTENSIONS__
122 myconf+=( "--disable-libwrap" )
125 myconf+=( "--disable-libdbi" )
128 myconf+=( "--disable-librados" )
132 $(use_enable graph rrd_graph) \
133 $(use_enable lua lua-site-install) \
135 $(use_enable perl perl-site-install) \
137 $(use_enable python) \
138 $(use_enable rrdcgi) \
139 $(use_enable static-libs static) \
141 $(use_with tcl tcllib "${EPREFIX}"/usr/$(get_libdir)) \
142 --with-perl-options=INSTALLDIRS=vendor \
143 --disable-ruby-site-install \
151 use python && distutils-r1_src_compile
163 rm -rf "${ED}"usr/share/doc/${PF}/{html,txt}
166 if use !rrdcgi ; then
167 # uses rrdcgi, causes invalid shebang error in Prefix, useless
168 # without rrdcgi installed
169 rm -f "${ED}"usr/share/${PN}/examples/cgi-demo.cgi
177 dodoc CHANGES CONTRIBUTORS NEWS THREADS TODO
179 find "${ED}"usr -name '*.la' -exec rm -f {} +
181 keepdir /var/lib/rrdcached/journal/
182 keepdir /var/lib/rrdcached/db/
184 newconfd "${FILESDIR}"/rrdcached.confd rrdcached
185 newinitd "${FILESDIR}"/rrdcached.init rrdcached
187 use python && distutils-r1_src_install