summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntop/ntop_5.0.1.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-08-30 19:03:58 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2017-09-12 10:55:07 -0400
commit2db3fdcc95a52a4f9aad45a47e15d2b8a0a445aa (patch)
tree47b019e6956c5d1c52aea865e94a491ad7696312 /meta-networking/recipes-support/ntop/ntop_5.0.1.bb
parentf8e7e5af3578937f056dddbe104a08bb35c56c64 (diff)
downloadmeta-openembedded-2db3fdcc95a52a4f9aad45a47e15d2b8a0a445aa.tar.gz
ntop: Fix build with musl
move away from .inc file, when its included in single recipe helps with devtool workflow too. Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-support/ntop/ntop_5.0.1.bb')
-rw-r--r--meta-networking/recipes-support/ntop/ntop_5.0.1.bb135
1 files changed, 134 insertions, 1 deletions
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 @@
1include ntop.inc 1SUMMARY = "ntop is network top"
2DESCRIPTION = "ntop is a network traffic probe that shows the network usage, \
3similar to what the popular top Unix command does."
2 4
5SECTION = "console/network"
6
7LICENSE = "GPLv2+ & GPLv3 & OpenSSL"
8LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
9 file://LICENSE-OpenSSL.txt;md5=a409f902e447ddd889cffa0c70e7c7c2 \
10 "
11
12SRC_URI = "${SOURCEFORGE_MIRROR}/ntop/ntop-${PV}.tar.gz \
13 file://ntop_configure_in.patch \
14 file://ntop_init.patch \
15 file://ntop_webInterface.patch \
16 file://ntop_configure_in_net_snmp_config_exist.patch \
17 file://ntop.service \
18 file://use-static-inline.patch \
19 file://0001-nDPI-Include-sys-types.h.patch \
20 "
3SRC_URI[md5sum] = "01710b6925a8a5ffe1a41b8b512ebd69" 21SRC_URI[md5sum] = "01710b6925a8a5ffe1a41b8b512ebd69"
4SRC_URI[sha256sum] = "7e8e84cb14d2173beaca4d4cb991a14d84a4bef84ec37b2276bc363f45c52ef8" 22SRC_URI[sha256sum] = "7e8e84cb14d2173beaca4d4cb991a14d84a4bef84ec37b2276bc363f45c52ef8"
23
24inherit autotools-brokensep useradd pythonnative pkgconfig systemd
25
26DEPENDS = "geoip rrdtool python zlib libpcap gdbm"
27
28PACKAGECONFIG ??= "openssl snmp plugins"
29PACKAGECONFIG[openssl] = "--with-ssl, --without-ssl, openssl, openssl"
30PACKAGECONFIG[snmp] = "--enable-snmp=yes NETSNMP=${STAGING_BINDIR_CROSS}/net-snmp-config, \
31--disable-snmp,net-snmp,"
32PACKAGECONFIG[plugins] = "--enable-plugins=yes, --disable-plugins, ,"
33
34EXTRA_OECONF += "ac_cv_file_aclocal_m4=yes ac_cv_file_depcomp=no"
35
36do_configure() {
37 cp ${STAGING_DATADIR_NATIVE}/aclocal/libtool.m4 libtool.m4.in
38 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
39 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
40 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/nDPI
41 install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/nDPI
42 cat acinclude.m4.in acinclude.m4.ntop libtool.m4.in > acinclude.m4
43 cp 3rd_party/* ./
44
45 # config nDPI
46 cd nDPI
47 ./configure ${CONFIGUREOPTS} --with-pic
48 cd ..
49
50 sed -i -e 's:^CFG_DBFILE_DIR=$localstatedir/ntop:CFG_DBFILE_DIR=$localstatedir/lib/ntop:' ${S}/configure.in
51
52 # fix the CFLAGS, CPPFLAGS, LDFLAGS, remove the host include
53 sed -i \
54 -e 's:\(^CFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
55 -e 's:\(^CPPFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
56 -e 's:\(^LDFLAGS="\$.*\) -L/usr/local/lib -L/opt/local/lib":\1":' \
57 ${S}/configure.in
58
59 # replace the DISTRO RELEASE in configure.in which are host's
60 # with our release, although those doesn't affect functionality
61 sed -i -e \
62 '/DEFINEOS="LINUX"/{N;s/DISTRO=.*/DISTRO="${DISTRO}"/;N;s/RELEASE=.*/RELEASE="${DISTRO_VERSION}"/;}' \
63 ${S}/configure.in
64
65 # osName in original configure.in should be ${TARGET_SYS}
66 # which will show in ntop's "show configuration"
67 sed -i -e \
68 's:^osName=.*:osName=${TARGET_SYS}:' \
69 ${S}/configure.in
70
71 # rename configureextra to configureextra_rename to avoid
72 # configure.in to guess host OS and pull in more configure, non needed
73 # which will cause some cross-compiling failure on specific host
74 # e.g. SUSE(SLED...)
75 test ! -f configureextra || mv -f configureextra configureextra_rename
76
77 # make sure configure finds python includdirs/libs with these envs
78 export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
79 STAGING_INCDIR=${STAGING_INCDIR} \
80 STAGING_LIBDIR=${STAGING_LIBDIR}
81
82 autotools_do_configure
83}
84
85do_compile_prepend() {
86 cd nDPI
87 oe_runmake
88 cd ..
89}
90
91do_install_append() {
92 # remove the empty dirs
93 rm -rf ${D}${libdir}/plugins
94
95 install -D -m 0755 ${S}/packages/RedHat/ntop.init \
96 ${D}${sysconfdir}/init.d/ntop
97 install -D -m 0644 ${S}/packages/RedHat/ntop.conf.sample \
98 ${D}${sysconfdir}/ntop.conf
99
100 # change ntop dir in ntop.conf
101 # don't use the -P as the ntop.init didn't support it
102 sed -i -e "s:^--db-file-path /usr/share/ntop:--db-file-path /var/lib/ntop:" \
103 -e "s:^#? -P /var/ntop:#? -P /var/lib/ntop:" \
104 ${D}${sysconfdir}/ntop.conf
105
106 # For systemd
107 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
108 install -D -m 0755 ${S}/packages/RedHat/ntop.init ${D}${libexecdir}/ntop-helper
109 install -D -m 0644 ${WORKDIR}/ntop.service ${D}${systemd_system_unitdir}/ntop.service
110 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
111 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
112 ${D}${systemd_system_unitdir}/ntop.service
113 fi
114
115 # Fix host-user-contaminated issue
116 chown -R root:root ${D}
117
118 chown -R ntop.ntop ${D}${datadir}/ntop
119 chown -R ntop:ntop ${D}${localstatedir}/lib/ntop
120}
121
122USERADD_PACKAGES = "${PN}"
123USERADD_PARAM_${PN} = "-M -g ntop -r -d ${localstatedir}/lib/ntop \
124-s /usr/sbin/nologin -c 'ntop' ntop"
125GROUPADD_PARAM_${PN} = "-r ntop"
126
127SYSTEMD_SERVICE_${PN} = "ntop.service"
128SYSTEMD_AUTO_ENABLE = "disable"
129
130FILES_${PN}_append = "${libdir}/ntop/plugins ${libdir}/libntop-*.so \
131 ${libdir}/libntopreport-*.so ${libdir}/lib*-${PV}.so"
132FILES_${PN}-dev = "${includedir} ${libdir}/libntop.so \
133 ${libdir}/libntopreport.so \
134 ${libdir}/libnetflowPlugin.so ${libdir}/libsflowPlugin.so \
135 ${libdir}/librrdPlugin.so \
136 ${libdir}/*.a ${libdir}/libntopreport.a ${libdir}/*.la"
137