xref: /openbmc/openbmc/meta-openembedded/meta-oe/recipes-extended/rrdtool/rrdtool_1.8.0.bb (revision 8460358c3d24c71d9d38fd126c745854a6301564)
1SUMMARY = "High performance data logging and graphing system for time series data"
2HOMEPAGE = "http://oss.oetiker.ch/rrdtool/"
3
4LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39df84cfd8a5e18bf988f277f7946676"
6
7DEPENDS = "libpng zlib glib-2.0 libxml2 groff-native python3-setuptools-native"
8
9SRCREV = "3af04acd38bbc61bbdcdd931dcf234c971aa5336"
10PV = "1.8.0"
11
12SRC_URI = "\
13    git://github.com/oetiker/rrdtool-1.x.git;protocol=https;branch=master \
14    file://b76e3c578f1e9f582e9c28f50d82b1f569602075.patch \
15"
16
17S = "${WORKDIR}/git"
18
19inherit cpan autotools-brokensep gettext pkgconfig python3native python3-dir systemd
20
21BBCLASSEXTEND = "native"
22
23SYSTEMD_PACKAGES = "rrdcached"
24SYSTEMD_SERVICE:rrdcached = "rrdcached.socket rrdcached.service"
25
26EXTRA_AUTORECONF = "-I m4 --exclude=autopoint"
27
28PACKAGECONFIG ??= "perl graph ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
29
30PACKAGECONFIG[python] = "--enable-python=yes \
31am_cv_python_pythondir=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/site-packages \
32am_cv_python_pyexecdir=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/site-packages,\
33--disable-python,python,"
34
35PACKAGECONFIG[perl] = \
36"--enable-perl=yes --with-perl-options='INSTALLDIRS="vendor" CCFLAGS="${CFLAGS}" NO_PACKLIST=1 NO_PERLLOCAL=1' \
37ac_cv_path_PERL_CC='${CC}',  \
38--disable-perl,perl,"
39
40PACKAGECONFIG[dbi] = "--enable-libdbi,--disable-libdbi,libdbi"
41
42PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
43
44PACKAGECONFIG[graph] = "--enable-rrd_graph,--disable-rrd_graph,pango cairo"
45
46EXTRA_OECONF = " \
47    --enable-shared \
48    --disable-libwrap \
49    --program-prefix='' \
50    rd_cv_ieee_works=yes \
51    --disable-ruby \
52    --disable-lua \
53    --disable-tcl \
54    --disable-rpath \
55    --enable-nls=${USE_NLS} \
56    --disable-docs \
57"
58
59export STAGING_LIBDIR
60export STAGING_INCDIR
61
62# emulate cpan_do_configure
63EXTRA_OEMAKE = ' CC="${CC} -Wno-incompatible-pointer-types" PERL5LIB="${PERL_ARCHLIB}" '
64# Avoid do_configure error on some hosts
65
66do_configure() {
67    unset PERLHOSTLIB
68    #fix the pkglib problem with newer automake
69    #perl
70    sed -i -e "s|-Wl,--rpath -Wl,\$rp||g" \
71        ${S}/bindings/perl-shared/Makefile.PL
72
73    #python
74    sed -i -e '/PYTHON_INCLUDES="-I${/c \
75    PYTHON_INCLUDES="-I=/usr/include/python${PYTHON_BASEVERSION}"' \
76        ${S}/m4/acinclude.m4
77    #remove the useless RPATH from the rrdtool.so
78    sed -i -e 's|LD_RUN_PATH=$(libdir)||g' ${S}/bindings/Makefile.am
79
80    autotools_do_configure
81
82    #modify python sitepkg
83    #remove the dependency of perl-shared:Makefile
84    #or perl-shared/Makefile will be regenerated
85    #if any code touch bindings/Makefile after below perl bindings code
86    sed -i -e "s:python/setup.py install:python/setup.py install \
87        --install-lib=${PYTHON_SITEPACKAGES_DIR}:" \
88        -e "s:perl-shared/Makefile.PL Makefile:perl-shared/Makefile.PL:" \
89        ${B}/bindings/Makefile
90
91    #redo the perl bindings
92    (
93    cd ${S}/bindings/perl-shared;
94    perl Makefile.PL INSTALLDIRS="vendor" INSTALLPRIVLIB="abc";
95
96    cd ../../bindings/perl-piped;
97    perl Makefile.PL INSTALLDIRS="vendor";
98    )
99
100    #change the interpreter in file
101    sed -i -e "s|^PERL = ${STAGING_BINDIR_NATIVE}/.*|PERL = /usr/bin/perl|g" \
102        ${B}/examples/Makefile
103    sed -i -e "s|${STAGING_BINDIR_NATIVE}/perl-native/perl|/usr/bin/perl|g" \
104        ${B}/examples/*.pl
105}
106
107do_install:append:class-native() {
108    # Replace the shebang line in cgi-demo.cgi
109    sed -i '1s|^.*$|#!/usr/bin/env rrdcgi|' ${D}${datadir}/rrdtool/examples/cgi-demo.cgi
110}
111
112PACKAGES =+ "${PN}-perl ${PN}-python"
113PACKAGES =+ "rrdcached"
114
115DESCRIPTION:rrdcached = \
116"The rrdcached package contains the data caching daemon for RRDtool."
117
118FILES:rrdcached = "${bindir}/rrdcached \
119    ${systemd_unitdir}/system/rrdcached.service \
120    ${systemd_unitdir}/system/rrdcached.socket"
121
122FILES:${PN}-doc += "${datadir}/rrdtool/examples"
123
124DESCRIPTION:${PN}-perl = \
125"The ${PN}-perl package includes RRDtool bindings for perl."
126FILES:${PN}-perl = "${libdir}/perl/vendor_perl/*/*.pm \
127    ${libdir}/perl/vendor_perl/*/auto/RRDs/RRDs.*"
128RDEPENDS:${PN}-perl = "perl perl-module-lib perl-module-getopt-long perl-module-time-hires \
129    perl-module-io-file perl-module-ipc-open2 perl-module-io-socket"
130
131DESCRIPTION:${PN}-python = \
132"The ${PN}-python package includes RRDtool bindings for python."
133FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*"
134RDEPENDS:${PN}-python = "python3"
135
136FILES:${PN}-dbg += "${libdir}/perl/vendor_perl/*/auto/RRDs/.debug \
137    ${PYTHON_SITEPACKAGES_DIR}/.debug"
138
139# http://errors.yoctoproject.org/Errors/Details/766911/
140# rrd_tune.c:239:35: error: passing argument 3 of 'optparse_init' from incompatible pointer type [-Wincompatible-pointer-types]
141CFLAGS += "-Wno-error=incompatible-pointer-types"
142