summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support
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
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')
-rw-r--r--meta-networking/recipes-support/ntop/ntop.inc131
-rw-r--r--meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch26
-rw-r--r--meta-networking/recipes-support/ntop/ntop/support-arm64.patch28
-rw-r--r--meta-networking/recipes-support/ntop/ntop_5.0.1.bb135
4 files changed, 160 insertions, 160 deletions
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 @@
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."
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://support-arm64.patch \
20 "
21
22inherit autotools-brokensep useradd pythonnative pkgconfig systemd
23
24DEPENDS = "geoip rrdtool python zlib libpcap gdbm"
25
26PACKAGECONFIG ??= "openssl snmp plugins"
27PACKAGECONFIG[openssl] = "--with-ssl, --without-ssl, openssl, openssl"
28PACKAGECONFIG[snmp] = "--enable-snmp=yes NETSNMP=${STAGING_BINDIR_CROSS}/net-snmp-config, \
29--disable-snmp,net-snmp,"
30PACKAGECONFIG[plugins] = "--enable-plugins=yes, --disable-plugins, ,"
31
32EXTRA_OECONF += "ac_cv_file_aclocal_m4=yes ac_cv_file_depcomp=no"
33
34do_configure() {
35 cp ${STAGING_DATADIR_NATIVE}/aclocal/libtool.m4 libtool.m4.in
36 cat acinclude.m4.in acinclude.m4.ntop libtool.m4.in > acinclude.m4
37 cp 3rd_party/* ./
38
39 # config nDPI
40 cd nDPI
41 ./configure ${CONFIGUREOPTS} --with-pic
42 cd ..
43
44 sed -i -e 's:^CFG_DBFILE_DIR=$localstatedir/ntop:CFG_DBFILE_DIR=$localstatedir/lib/ntop:' ${S}/configure.in
45
46 # fix the CFLAGS, CPPFLAGS, LDFLAGS, remove the host include
47 sed -i \
48 -e 's:\(^CFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
49 -e 's:\(^CPPFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
50 -e 's:\(^LDFLAGS="\$.*\) -L/usr/local/lib -L/opt/local/lib":\1":' \
51 ${S}/configure.in
52
53 # replace the DISTRO RELEASE in configure.in which are host's
54 # with our release, although those doesn't affect functionality
55 sed -i -e \
56 '/DEFINEOS="LINUX"/{N;s/DISTRO=.*/DISTRO="${DISTRO}"/;N;s/RELEASE=.*/RELEASE="${DISTRO_VERSION}"/;}' \
57 ${S}/configure.in
58
59 # osName in original configure.in should be ${TARGET_SYS}
60 # which will show in ntop's "show configuration"
61 sed -i -e \
62 's:^osName=.*:osName=${TARGET_SYS}:' \
63 ${S}/configure.in
64
65 # rename configureextra to configureextra_rename to avoid
66 # configure.in to guess host OS and pull in more configure, non needed
67 # which will cause some cross-compiling failure on specific host
68 # e.g. SUSE(SLED...)
69 test ! -f configureextra || mv -f configureextra configureextra_rename
70
71 # make sure configure finds python includdirs/libs with these envs
72 export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
73 STAGING_INCDIR=${STAGING_INCDIR} \
74 STAGING_LIBDIR=${STAGING_LIBDIR}
75
76 autotools_do_configure
77}
78
79do_compile_prepend() {
80 cd nDPI
81 oe_runmake
82 cd ..
83}
84
85do_install_append() {
86 # remove the empty dirs
87 rm -rf ${D}${libdir}/plugins
88
89 install -D -m 0755 ${S}/packages/RedHat/ntop.init \
90 ${D}${sysconfdir}/init.d/ntop
91 install -D -m 0644 ${S}/packages/RedHat/ntop.conf.sample \
92 ${D}${sysconfdir}/ntop.conf
93
94 # change ntop dir in ntop.conf
95 # don't use the -P as the ntop.init didn't support it
96 sed -i -e "s:^--db-file-path /usr/share/ntop:--db-file-path /var/lib/ntop:" \
97 -e "s:^#? -P /var/ntop:#? -P /var/lib/ntop:" \
98 ${D}${sysconfdir}/ntop.conf
99
100 # For systemd
101 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
102 install -D -m 0755 ${S}/packages/RedHat/ntop.init ${D}${libexecdir}/ntop-helper
103 install -D -m 0644 ${WORKDIR}/ntop.service ${D}${systemd_system_unitdir}/ntop.service
104 sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
105 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
106 ${D}${systemd_system_unitdir}/ntop.service
107 fi
108
109 # Fix host-user-contaminated issue
110 chown -R root:root ${D}
111
112 chown -R ntop.ntop ${D}${datadir}/ntop
113 chown -R ntop:ntop ${D}${localstatedir}/lib/ntop
114}
115
116USERADD_PACKAGES = "${PN}"
117USERADD_PARAM_${PN} = "-M -g ntop -r -d ${localstatedir}/lib/ntop \
118-s /usr/sbin/nologin -c 'ntop' ntop"
119GROUPADD_PARAM_${PN} = "-r ntop"
120
121SYSTEMD_SERVICE_${PN} = "ntop.service"
122SYSTEMD_AUTO_ENABLE = "disable"
123
124FILES_${PN}_append = "${libdir}/ntop/plugins ${libdir}/libntop-*.so \
125 ${libdir}/libntopreport-*.so ${libdir}/lib*-${PV}.so"
126FILES_${PN}-dev = "${includedir} ${libdir}/libntop.so \
127 ${libdir}/libntopreport.so \
128 ${libdir}/libnetflowPlugin.so ${libdir}/libsflowPlugin.so \
129 ${libdir}/librrdPlugin.so \
130 ${libdir}/*.a ${libdir}/libntopreport.a ${libdir}/*.la"
131
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..81ffeec21
--- /dev/null
+++ b/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch
@@ -0,0 +1,26 @@
1From 6543f3e2d5fe214e2fc6c050289bf1ae73b18724 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 30 Aug 2017 13:56:24 -0700
4Subject: [PATCH] nDPI: Include sys/types.h
5
6Needed for uint_t types
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Pending
11
12 nDPI/src/include/ipq_api.h | 1 +
13 1 file changed, 1 insertion(+)
14
15Index: ntop-5.0.1/nDPI/src/include/ipq_api.h
16===================================================================
17--- ntop-5.0.1.orig/nDPI/src/include/ipq_api.h
18+++ ntop-5.0.1/nDPI/src/include/ipq_api.h
19@@ -24,6 +24,7 @@
20 #ifndef __IPOQUE_API_INCLUDE_FILE__
21 #define __IPOQUE_API_INCLUDE_FILE__
22
23+#include <sys/types.h>
24
25 #if defined(HAVE_NTOP) && defined(WIN32)
26 #include <winsock2.h>
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 @@
1Add support for arm64
2
3Upstream-Status: Inappropriate [no longer maintained]
4
5Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
6
7diff --git a/nDPI/config.sub.old b/nDPI/config.sub
8index c2d1257..e4347ac 100755
9--- a/nDPI/config.sub.old
10+++ b/nDPI/config.sub
11@@ -249,7 +249,7 @@ case $basic_machine in
12 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
13 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
14 | am33_2.0 \
15- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
16+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 | aarch64 \
17 | bfin \
18 | c4x | clipper \
19 | d10v | d30v | dlx | dsp16xx \
20@@ -331,7 +331,7 @@ case $basic_machine in
21 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
22 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
23 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
24- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
25+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* | aarch64-* \
26 | avr-* | avr32-* \
27 | bfin-* | bs2000-* \
28 | 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 @@
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