blob: 216aafcee7db5a9cd0ca1ffd01171df5eb11f4b2 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "High performance data logging and graphing system for time series data"
2HOMEPAGE = "http://oss.oetiker.ch/rrdtool/"
3
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3349111ed0533471494beec99715bc9d"
6
7DEPENDS = "libpng zlib cairo pango glib-2.0 libxml2 groff-native"
8
9SRCREV = "04f70058cc894c0a3ee5d555ea1bb5a8d4bb8a0e"
10PV = "1.5.4"
11
12SRC_URI = "\
13 git://github.com/oetiker/rrdtool-1.x.git;branch=1.5 \
14"
15
16S = "${WORKDIR}/git"
17
18inherit cpan autotools-brokensep gettext pythonnative python-dir systemd
19
20BBCLASSEXTEND = "native"
21
22SYSTEMD_SERVICE_${PN} = "rrdcached.socket rrdcached.service"
23
24EXTRA_AUTORECONF = "-I m4"
25
26PACKAGECONFIG ??= "python perl ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
27
28PACKAGECONFIG[python] = "--enable-python=yes \
29am_cv_python_pythondir=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/site-packages \
30am_cv_python_pyexecdir=${STAGING_LIBDIR}/python${PYTHON_BASEVERSION}/site-packages,\
31--disable-python,python,"
32
33PACKAGECONFIG[perl] = \
34"--enable-perl=yes --with-perl-options='INSTALLDIRS="vendor"' \
35ac_cv_path_PERL_CC='${CC}', \
36--disable-perl,perl,"
37
38PACKAGECONFIG[dbi] = "--enable-libdbi,--disable-libdbi,libdbi"
39
40PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
41
42EXTRA_OECONF = " \
43 --enable-shared \
44 --disable-libwrap \
45 --program-prefix='' \
46 rd_cv_ieee_works=yes \
47 --disable-ruby \
48 --disable-lua \
49 --disable-tcl \
50 --disable-rpath \
51"
52
53export BUILD_SYS
54export HOST_SYS
55export STAGING_LIBDIR
56export STAGING_INCDIR
57
58# emulate cpan_do_configure
59EXTRA_OEMAKE = ' PERL5LIB="${PERL_ARCHLIB}" '
60# Avoid do_configure error on some hosts
61export PERLHOSTLIB = ""
62
63do_configure() {
64 #fix the pkglib problem with newer automake
65 #perl
66 sed -i -e "s|-Wl,--rpath -Wl,\$rp||g" \
67 ${S}/bindings/perl-shared/Makefile.PL
68
69 #python
70 sed -i -e '/PYTHON_INCLUDES="-I${/c \
71 PYTHON_INCLUDES="-I=/usr/include/python${PYTHON_BASEVERSION}"' \
72 ${S}/m4/acinclude.m4
73 #remove the useless RPATH from the rrdtool.so
74 sed -i -e 's|LD_RUN_PATH=$(libdir)||g' ${S}/bindings/Makefile.am
75
76 autotools_do_configure
77
78 #modify python sitepkg
79 #remove the dependency of perl-shared:Makefile
80 #or perl-shared/Makefile will be regenerated
81 #if any code touch bindings/Makefile after below perl bindings code
82 sed -i -e "s:python/setup.py install:python/setup.py install \
83 --install-lib=${PYTHON_SITEPACKAGES_DIR}:" \
84 -e "s:perl-shared/Makefile.PL Makefile:perl-shared/Makefile.PL:" \
85 ${B}/bindings/Makefile
86
87 #redo the perl bindings
88 (
89 cd ${S}/bindings/perl-shared;
90 perl Makefile.PL INSTALLDIRS="vendor" INSTALLPRIVLIB="abc";
91
92 cd ../../bindings/perl-piped;
93 perl Makefile.PL INSTALLDIRS="vendor";
94 )
95
96 #change the interpreter in file
97 sed -i -e "s|^PERL = ${STAGING_BINDIR_NATIVE}/.*|PERL = /usr/bin/perl|g" \
98 ${B}/examples/Makefile
99 sed -i -e "s|${STAGING_BINDIR_NATIVE}/perl-native/perl|/usr/bin/perl|g" \
100 ${B}/examples/*.pl
101}
102
103PACKAGES =+ "${PN}-perl ${PN}-python"
104
105FILES_${PN}-doc += "${datadir}/rrdtool/examples"
106
107DESCRIPTION_${PN}-perl = \
108"The ${PN}-perl package includes RRDtool bindings for perl."
109FILES_${PN}-perl = "${libdir}/perl/vendor_perl/*/*.pm \
110 ${libdir}/perl/vendor_perl/*/auto/RRDs/RRDs.*"
111RDEPENDS_${PN}-perl = "perl perl-module-lib perl-module-getopt-long perl-module-time-hires \
112 perl-module-io-file perl-module-ipc-open2 perl-module-io-socket"
113
114DESCRIPTION_${PN}-python = \
115"The ${PN}-python package includes RRDtool bindings for python."
116FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
117RDEPENDS_${PN}-python = "python"
118
119FILES_${PN}-dbg += "${libdir}/perl/vendor_perl/*/auto/RRDs/.debug \
120 ${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug"