From patchwork Thu Aug 31 02:03:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 111344 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp1847261qge; Wed, 30 Aug 2017 19:04:27 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5KgSs3AW+alTZfdUz+0G0T3BlBumUt1d9/I2Vu0/Mv/jiJRNiaztXYs+yiJ0M8JFHKMM/4 X-Received: by 10.84.217.155 with SMTP id p27mr766435pli.410.1504145066887; Wed, 30 Aug 2017 19:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504145066; cv=none; d=google.com; s=arc-20160816; b=x6X6oSG7tDiozKAls6cdH7rAJhA0zTCd5FcStS4IuaFigYgbHwK0LMJUgzjeCOs/o7 0i4pGtimmBpN0gU11qxjGqGd8+z0bun2oO0H5WMME5/y+k68EcyK57J2SJeMu3GEmCii FNXJ+B5cvolet5iFJdgSLGzCzdjVWp2pzgu4gA6aNi8kPjWOrMlxdotYkCNRCqrs88tg 9q419GsVkRyxoJa3FjIn0fhp620zsSrFlZmDPuiY1e9qXQf1EiacLqhAzarwChB1gYeI zqIRJ4gxzvBz4UY2ajEeUwdSx3FN9LcGRFGhwVG+16pU4UldsfoWL9Zrt+jpT+kO8vkL HQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=nJ1jZJ9mLz9HoZTi+Er+Sjjc8b54PF8QOSPQZuk7nRY=; b=g0GrEmPN6rbWsHPMhZwBZ+SJSZQ+r8d9/MTrX7rxmjtvWSsN3HpvsKpEKfk6k4/iOO jYHfuF1DXZvRQARcW9tK+e863H7Qubw1k0NWtv77QlE7IFS3NrgTuVX+ksnxfCuQ9JCK TaO5casYvkzGy4W/yR+mQsB+dsIeSm6w6CJ/dYHF4mTggTBB8m1qfv2c9rzQXCRDlOoI te+aB12jVUt8Ho3nliOdxC9SVZg2Zbjx+VNNavzD2TI6Yhd0r1pNy/H9Un+vvA3NMlNZ seEuvvFSu1WrxcOH8OfVnEHsG5jCykL4F2MEDIpsMCNDeJCqAdxKCQU8sD+si9wHWNO2 VX1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ooDZ+TgO; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id o19si5532488pgn.264.2017.08.30.19.04.26; Wed, 30 Aug 2017 19:04:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=ooDZ+TgO; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id A4A0D7826E; Thu, 31 Aug 2017 02:04:17 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by mail.openembedded.org (Postfix) with ESMTP id 9AF7D7826E for ; Thu, 31 Aug 2017 02:04:15 +0000 (UTC) Received: by mail-pg0-f45.google.com with SMTP id b8so24838886pgn.5 for ; Wed, 30 Aug 2017 19:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=LY5+gnaoapii5gtZGC7nqnyRC4KGXtpu8o7AgVVb7Rg=; b=ooDZ+TgOEk3KFRvAlQTQqjjrAlI9ylN0GHQ5ApRjXXUgZcTtNP1rEZZNXhzBOn9jjk jHx2L5VAirFnOA4gwwEfh4kq0axAM6M0bS6Dpcae40wZgtme1s/EJObqHZA6kkteqDfZ ppi4+kOOomYJW+PFWtGsWKYMyLdS+zyt4UCXa1qdQy917ZCAc+nNy5q29EVyTXlCplin vtjVykRjYcLfHI0T9YmWaiUzYUfxbgOTqpEt7r6vhecJ/r106JzCV3YTlHB7waPm7rWN Z6lpLKFmTOgRtAuO39qaqby1R4xqlzjlGO+Sc5J6SFDrq38IK4nUHiMKPMvzxbg8rPqV eGHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LY5+gnaoapii5gtZGC7nqnyRC4KGXtpu8o7AgVVb7Rg=; b=UBjdzRdd3+nwmMFswaJP7wggPpoeYdCYxUMH0pjKV1PLr+MqlXxPLNV2JZxf1C5oPs zSqlns8fH2R/L1xddwSCKvjIDX2r33OKkTXjjC5JAWAoYUKWG38avSK70dGz5JzWMpx2 V9AD6ns438vvNFbGa7WCSu3bt7ZNWEisHFPJeTGKHymK7BuN8K+dQ+cZZ37WSGgBeDGM rZ0QWSdif/tYKfBvYWINr+o1UDQ726sasF8/0PiQ/VILxjoe8c32ediWwExQEWRbxWXE az74V6hBWEJ1HD6WL7P+3f7sr1jxfRgRUyPqvyMvie9Eajqj3wL+sW344s2w+NCtjcIf JLQg== X-Gm-Message-State: AHYfb5jxClu4X95YqKOd5+EgIKSXC49MzMx2BlqsJpso569z2db4r3jS /9swBf2rl/68/W4p X-Received: by 10.99.173.79 with SMTP id y15mr629550pgo.432.1504145056331; Wed, 30 Aug 2017 19:04:16 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c::79ab]) by smtp.gmail.com with ESMTPSA id c10sm12347641pfk.101.2017.08.30.19.04.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 19:04:15 -0700 (PDT) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Wed, 30 Aug 2017 19:03:58 -0700 Message-Id: <20170831020401.6367-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [oe] [meta-networking][PATCH 1/4] ntop: Fix build with musl X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org move away from .inc file, when its included in single recipe helps with devtool workflow too. Signed-off-by: Khem Raj --- meta-networking/recipes-support/ntop/ntop.inc | 131 -------------------- .../ntop/ntop/0001-nDPI-Include-sys-types.h.patch | 24 ++++ .../recipes-support/ntop/ntop/support-arm64.patch | 28 ----- meta-networking/recipes-support/ntop/ntop_5.0.1.bb | 135 ++++++++++++++++++++- 4 files changed, 158 insertions(+), 160 deletions(-) delete mode 100644 meta-networking/recipes-support/ntop/ntop.inc create mode 100644 meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch delete mode 100644 meta-networking/recipes-support/ntop/ntop/support-arm64.patch -- 2.14.1 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-networking/recipes-support/ntop/ntop.inc b/meta-networking/recipes-support/ntop/ntop.inc deleted file mode 100644 index b96433425..000000000 --- a/meta-networking/recipes-support/ntop/ntop.inc +++ /dev/null @@ -1,131 +0,0 @@ -SUMMARY = "ntop is network top" -DESCRIPTION = "ntop is a network traffic probe that shows the network usage, \ -similar to what the popular top Unix command does." - -SECTION = "console/network" - -LICENSE = "GPLv2+ & GPLv3 & OpenSSL" -LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ - file://LICENSE-OpenSSL.txt;md5=a409f902e447ddd889cffa0c70e7c7c2 \ - " - -SRC_URI = "${SOURCEFORGE_MIRROR}/ntop/ntop-${PV}.tar.gz \ - file://ntop_configure_in.patch \ - file://ntop_init.patch \ - file://ntop_webInterface.patch \ - file://ntop_configure_in_net_snmp_config_exist.patch \ - file://ntop.service \ - file://use-static-inline.patch \ - file://support-arm64.patch \ - " - -inherit autotools-brokensep useradd pythonnative pkgconfig systemd - -DEPENDS = "geoip rrdtool python zlib libpcap gdbm" - -PACKAGECONFIG ??= "openssl snmp plugins" -PACKAGECONFIG[openssl] = "--with-ssl, --without-ssl, openssl, openssl" -PACKAGECONFIG[snmp] = "--enable-snmp=yes NETSNMP=${STAGING_BINDIR_CROSS}/net-snmp-config, \ ---disable-snmp,net-snmp," -PACKAGECONFIG[plugins] = "--enable-plugins=yes, --disable-plugins, ," - -EXTRA_OECONF += "ac_cv_file_aclocal_m4=yes ac_cv_file_depcomp=no" - -do_configure() { - cp ${STAGING_DATADIR_NATIVE}/aclocal/libtool.m4 libtool.m4.in - cat acinclude.m4.in acinclude.m4.ntop libtool.m4.in > acinclude.m4 - cp 3rd_party/* ./ - - # config nDPI - cd nDPI - ./configure ${CONFIGUREOPTS} --with-pic - cd .. - - sed -i -e 's:^CFG_DBFILE_DIR=$localstatedir/ntop:CFG_DBFILE_DIR=$localstatedir/lib/ntop:' ${S}/configure.in - - # fix the CFLAGS, CPPFLAGS, LDFLAGS, remove the host include - sed -i \ - -e 's:\(^CFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \ - -e 's:\(^CPPFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \ - -e 's:\(^LDFLAGS="\$.*\) -L/usr/local/lib -L/opt/local/lib":\1":' \ - ${S}/configure.in - - # replace the DISTRO RELEASE in configure.in which are host's - # with our release, although those doesn't affect functionality - sed -i -e \ - '/DEFINEOS="LINUX"/{N;s/DISTRO=.*/DISTRO="${DISTRO}"/;N;s/RELEASE=.*/RELEASE="${DISTRO_VERSION}"/;}' \ - ${S}/configure.in - - # osName in original configure.in should be ${TARGET_SYS} - # which will show in ntop's "show configuration" - sed -i -e \ - 's:^osName=.*:osName=${TARGET_SYS}:' \ - ${S}/configure.in - - # rename configureextra to configureextra_rename to avoid - # configure.in to guess host OS and pull in more configure, non needed - # which will cause some cross-compiling failure on specific host - # e.g. SUSE(SLED...) - test ! -f configureextra || mv -f configureextra configureextra_rename - - # make sure configure finds python includdirs/libs with these envs - export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ - STAGING_INCDIR=${STAGING_INCDIR} \ - STAGING_LIBDIR=${STAGING_LIBDIR} - - autotools_do_configure -} - -do_compile_prepend() { - cd nDPI - oe_runmake - cd .. -} - -do_install_append() { - # remove the empty dirs - rm -rf ${D}${libdir}/plugins - - install -D -m 0755 ${S}/packages/RedHat/ntop.init \ - ${D}${sysconfdir}/init.d/ntop - install -D -m 0644 ${S}/packages/RedHat/ntop.conf.sample \ - ${D}${sysconfdir}/ntop.conf - - # change ntop dir in ntop.conf - # don't use the -P as the ntop.init didn't support it - sed -i -e "s:^--db-file-path /usr/share/ntop:--db-file-path /var/lib/ntop:" \ - -e "s:^#? -P /var/ntop:#? -P /var/lib/ntop:" \ - ${D}${sysconfdir}/ntop.conf - - # For systemd - if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then - install -D -m 0755 ${S}/packages/RedHat/ntop.init ${D}${libexecdir}/ntop-helper - install -D -m 0644 ${WORKDIR}/ntop.service ${D}${systemd_system_unitdir}/ntop.service - sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \ - -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - ${D}${systemd_system_unitdir}/ntop.service - fi - - # Fix host-user-contaminated issue - chown -R root:root ${D} - - chown -R ntop.ntop ${D}${datadir}/ntop - chown -R ntop:ntop ${D}${localstatedir}/lib/ntop -} - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "-M -g ntop -r -d ${localstatedir}/lib/ntop \ --s /usr/sbin/nologin -c 'ntop' ntop" -GROUPADD_PARAM_${PN} = "-r ntop" - -SYSTEMD_SERVICE_${PN} = "ntop.service" -SYSTEMD_AUTO_ENABLE = "disable" - -FILES_${PN}_append = "${libdir}/ntop/plugins ${libdir}/libntop-*.so \ - ${libdir}/libntopreport-*.so ${libdir}/lib*-${PV}.so" -FILES_${PN}-dev = "${includedir} ${libdir}/libntop.so \ - ${libdir}/libntopreport.so \ - ${libdir}/libnetflowPlugin.so ${libdir}/libsflowPlugin.so \ - ${libdir}/librrdPlugin.so \ - ${libdir}/*.a ${libdir}/libntopreport.a ${libdir}/*.la" - diff --git a/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch b/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch new file mode 100644 index 000000000..3a6a76120 --- /dev/null +++ b/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch @@ -0,0 +1,24 @@ +From 6543f3e2d5fe214e2fc6c050289bf1ae73b18724 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 30 Aug 2017 13:56:24 -0700 +Subject: [PATCH] nDPI: Include sys/types.h + +Needed for uint_t types + +Signed-off-by: Khem Raj +--- + nDPI/src/include/ipq_api.h | 1 + + 1 file changed, 1 insertion(+) + +Index: ntop-5.0.1/nDPI/src/include/ipq_api.h +=================================================================== +--- ntop-5.0.1.orig/nDPI/src/include/ipq_api.h ++++ ntop-5.0.1/nDPI/src/include/ipq_api.h +@@ -24,6 +24,7 @@ + #ifndef __IPOQUE_API_INCLUDE_FILE__ + #define __IPOQUE_API_INCLUDE_FILE__ + ++#include + + #if defined(HAVE_NTOP) && defined(WIN32) + #include diff --git a/meta-networking/recipes-support/ntop/ntop/support-arm64.patch b/meta-networking/recipes-support/ntop/ntop/support-arm64.patch deleted file mode 100644 index 0b1e8afbc..000000000 --- a/meta-networking/recipes-support/ntop/ntop/support-arm64.patch +++ /dev/null @@ -1,28 +0,0 @@ -Add support for arm64 - -Upstream-Status: Inappropriate [no longer maintained] - -Signed-off-by: Yue Tao - -diff --git a/nDPI/config.sub.old b/nDPI/config.sub -index c2d1257..e4347ac 100755 ---- a/nDPI/config.sub.old -+++ b/nDPI/config.sub -@@ -249,7 +249,7 @@ case $basic_machine in - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ -- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ -+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 | aarch64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ -@@ -331,7 +331,7 @@ case $basic_machine in - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ -- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ -+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* | aarch64-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ diff --git a/meta-networking/recipes-support/ntop/ntop_5.0.1.bb b/meta-networking/recipes-support/ntop/ntop_5.0.1.bb index 77b5e436f..298fbec61 100644 --- a/meta-networking/recipes-support/ntop/ntop_5.0.1.bb +++ b/meta-networking/recipes-support/ntop/ntop_5.0.1.bb @@ -1,4 +1,137 @@ -include ntop.inc +SUMMARY = "ntop is network top" +DESCRIPTION = "ntop is a network traffic probe that shows the network usage, \ +similar to what the popular top Unix command does." +SECTION = "console/network" + +LICENSE = "GPLv2+ & GPLv3 & OpenSSL" +LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ + file://LICENSE-OpenSSL.txt;md5=a409f902e447ddd889cffa0c70e7c7c2 \ + " + +SRC_URI = "${SOURCEFORGE_MIRROR}/ntop/ntop-${PV}.tar.gz \ + file://ntop_configure_in.patch \ + file://ntop_init.patch \ + file://ntop_webInterface.patch \ + file://ntop_configure_in_net_snmp_config_exist.patch \ + file://ntop.service \ + file://use-static-inline.patch \ + file://0001-nDPI-Include-sys-types.h.patch \ + " SRC_URI[md5sum] = "01710b6925a8a5ffe1a41b8b512ebd69" SRC_URI[sha256sum] = "7e8e84cb14d2173beaca4d4cb991a14d84a4bef84ec37b2276bc363f45c52ef8" + +inherit autotools-brokensep useradd pythonnative pkgconfig systemd + +DEPENDS = "geoip rrdtool python zlib libpcap gdbm" + +PACKAGECONFIG ??= "openssl snmp plugins" +PACKAGECONFIG[openssl] = "--with-ssl, --without-ssl, openssl, openssl" +PACKAGECONFIG[snmp] = "--enable-snmp=yes NETSNMP=${STAGING_BINDIR_CROSS}/net-snmp-config, \ +--disable-snmp,net-snmp," +PACKAGECONFIG[plugins] = "--enable-plugins=yes, --disable-plugins, ," + +EXTRA_OECONF += "ac_cv_file_aclocal_m4=yes ac_cv_file_depcomp=no" + +do_configure() { + cp ${STAGING_DATADIR_NATIVE}/aclocal/libtool.m4 libtool.m4.in + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S} + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S} + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/nDPI + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/nDPI + cat acinclude.m4.in acinclude.m4.ntop libtool.m4.in > acinclude.m4 + cp 3rd_party/* ./ + + # config nDPI + cd nDPI + ./configure ${CONFIGUREOPTS} --with-pic + cd .. + + sed -i -e 's:^CFG_DBFILE_DIR=$localstatedir/ntop:CFG_DBFILE_DIR=$localstatedir/lib/ntop:' ${S}/configure.in + + # fix the CFLAGS, CPPFLAGS, LDFLAGS, remove the host include + sed -i \ + -e 's:\(^CFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \ + -e 's:\(^CPPFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \ + -e 's:\(^LDFLAGS="\$.*\) -L/usr/local/lib -L/opt/local/lib":\1":' \ + ${S}/configure.in + + # replace the DISTRO RELEASE in configure.in which are host's + # with our release, although those doesn't affect functionality + sed -i -e \ + '/DEFINEOS="LINUX"/{N;s/DISTRO=.*/DISTRO="${DISTRO}"/;N;s/RELEASE=.*/RELEASE="${DISTRO_VERSION}"/;}' \ + ${S}/configure.in + + # osName in original configure.in should be ${TARGET_SYS} + # which will show in ntop's "show configuration" + sed -i -e \ + 's:^osName=.*:osName=${TARGET_SYS}:' \ + ${S}/configure.in + + # rename configureextra to configureextra_rename to avoid + # configure.in to guess host OS and pull in more configure, non needed + # which will cause some cross-compiling failure on specific host + # e.g. SUSE(SLED...) + test ! -f configureextra || mv -f configureextra configureextra_rename + + # make sure configure finds python includdirs/libs with these envs + export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \ + STAGING_INCDIR=${STAGING_INCDIR} \ + STAGING_LIBDIR=${STAGING_LIBDIR} + + autotools_do_configure +} + +do_compile_prepend() { + cd nDPI + oe_runmake + cd .. +} + +do_install_append() { + # remove the empty dirs + rm -rf ${D}${libdir}/plugins + + install -D -m 0755 ${S}/packages/RedHat/ntop.init \ + ${D}${sysconfdir}/init.d/ntop + install -D -m 0644 ${S}/packages/RedHat/ntop.conf.sample \ + ${D}${sysconfdir}/ntop.conf + + # change ntop dir in ntop.conf + # don't use the -P as the ntop.init didn't support it + sed -i -e "s:^--db-file-path /usr/share/ntop:--db-file-path /var/lib/ntop:" \ + -e "s:^#? -P /var/ntop:#? -P /var/lib/ntop:" \ + ${D}${sysconfdir}/ntop.conf + + # For systemd + if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then + install -D -m 0755 ${S}/packages/RedHat/ntop.init ${D}${libexecdir}/ntop-helper + install -D -m 0644 ${WORKDIR}/ntop.service ${D}${systemd_system_unitdir}/ntop.service + sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${D}${systemd_system_unitdir}/ntop.service + fi + + # Fix host-user-contaminated issue + chown -R root:root ${D} + + chown -R ntop.ntop ${D}${datadir}/ntop + chown -R ntop:ntop ${D}${localstatedir}/lib/ntop +} + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "-M -g ntop -r -d ${localstatedir}/lib/ntop \ +-s /usr/sbin/nologin -c 'ntop' ntop" +GROUPADD_PARAM_${PN} = "-r ntop" + +SYSTEMD_SERVICE_${PN} = "ntop.service" +SYSTEMD_AUTO_ENABLE = "disable" + +FILES_${PN}_append = "${libdir}/ntop/plugins ${libdir}/libntop-*.so \ + ${libdir}/libntopreport-*.so ${libdir}/lib*-${PV}.so" +FILES_${PN}-dev = "${includedir} ${libdir}/libntop.so \ + ${libdir}/libntopreport.so \ + ${libdir}/libnetflowPlugin.so ${libdir}/libsflowPlugin.so \ + ${libdir}/librrdPlugin.so \ + ${libdir}/*.a ${libdir}/libntopreport.a ${libdir}/*.la" +