1 |
commit: f885f314661f613af15d46b79217b602fed28472 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Feb 8 06:31:37 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 8 06:31:45 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f885f314 |
7 |
|
8 |
net-analyzer/ntopng: add 5.2.1 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
net-analyzer/ntopng/Manifest | 1 + |
13 |
.../ntopng/files/ntopng-5.2.1-build-system.patch | 89 ++++++++++++++++++++ |
14 |
.../ntopng/files/ntopng-5.2.1-mysqltool.patch | 17 ++++ |
15 |
.../ntopng/files/ntopng-5.2.1-ndpi-linking.patch | 13 +++ |
16 |
net-analyzer/ntopng/ntopng-5.2.1.ebuild | 97 ++++++++++++++++++++++ |
17 |
5 files changed, 217 insertions(+) |
18 |
|
19 |
diff --git a/net-analyzer/ntopng/Manifest b/net-analyzer/ntopng/Manifest |
20 |
index 9a94093e2365..c97edb42bb7e 100644 |
21 |
--- a/net-analyzer/ntopng/Manifest |
22 |
+++ b/net-analyzer/ntopng/Manifest |
23 |
@@ -1,2 +1,3 @@ |
24 |
DIST ntopng-4.2.tar.gz 57554819 BLAKE2B a9eaf7ea670dbd9c830696a4b017330e25a82307852a0a85d95ddbb4e32a3123d43eda1b686c359da1fef77e601cd3791dcdf257141e2e1d3ed7974b92edaac8 SHA512 e89ec3f35644ae8bc570d9802ecfadbf0067145e23a589df2032e8781e9c954f4166d3abb650ddafc65e4fbad656730ee1abf9c5273d3e09f8173d423436b8ff |
25 |
DIST ntopng-5.0.tar.gz 57935381 BLAKE2B 420bda10ecc264d6baea0714367e8c475e72480ab1a114251c6712535ad1415288154623aa3ef780a5bab55bec684ddd7c0582997654f8fbb96ec08e17cb099f SHA512 e157430d9c98871d0136d2f51af6c7fed3a95fa21f8d3a9447ee69ac2aaee3752b6eddfd584715e3ee36234fd0fdcf865b761b0ec1a08727f6d988bc115d21e6 |
26 |
+DIST ntopng-5.2.1.tar.gz 60280025 BLAKE2B e7885a1ec9e5d37ee06def83a83c62f41acf87d939d18c33c8d114fe0bed0c973a6146f26fd92343aa7c7e7484970c3e95c33fe76468fe382809daddeed6541b SHA512 01cdf21deac61a3b11e7d0e6b662c911123241332e812bb676cb8c5c003fe1d50a4c61231f9c327d467e89dd1345fc1bdbab5d2599fe04b04a8fe12654c01bdd |
27 |
|
28 |
diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..ff05d103f22a |
31 |
--- /dev/null |
32 |
+++ b/net-analyzer/ntopng/files/ntopng-5.2.1-build-system.patch |
33 |
@@ -0,0 +1,89 @@ |
34 |
+https://github.com/ntop/ntopng/pull/6288 |
35 |
+ |
36 |
+From 93b62eb0b48f9914fed5511dc2a4289a83a1ed34 Mon Sep 17 00:00:00 2001 |
37 |
+From: Sam James <sam@g.o> |
38 |
+Date: Tue, 8 Feb 2022 06:07:21 +0000 |
39 |
+Subject: [PATCH 1/3] build: fail configure if ZMQ can't be found |
40 |
+ |
41 |
+We already "fail" (makefile won't be generated) when ZMQ can't be found but |
42 |
+the exit code doesn't represent this until now. |
43 |
+ |
44 |
+Signed-off-by: Sam James <sam@g.o> |
45 |
+--- |
46 |
+ configure.ac.in | 2 +- |
47 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
48 |
+ |
49 |
+diff --git a/configure.ac.in b/configure.ac.in |
50 |
+index b032d7faa34..0b30e9480c7 100644 |
51 |
+--- a/configure.ac.in |
52 |
++++ b/configure.ac.in |
53 |
+@@ -132,7 +132,7 @@ if test "x$ac_cv_lib_zmq_zmq_socket_monitor" = xyes; then : |
54 |
+ AC_DEFINE_UNQUOTED(HAVE_ZMQ, 1, [ZMQ is present]) |
55 |
+ else |
56 |
+ echo "ZMQ not present or too old (< v. 3.x)" |
57 |
+- exit |
58 |
++ exit 1 |
59 |
+ fi |
60 |
+ |
61 |
+ AC_CHECK_LIB([sodium], [sodium_init], LIBS="${LIBS} -lsodium") |
62 |
+ |
63 |
+From 75206e5a3fdc289a2229770595fbf588de79402b Mon Sep 17 00:00:00 2001 |
64 |
+From: Sam James <sam@g.o> |
65 |
+Date: Tue, 8 Feb 2022 06:08:02 +0000 |
66 |
+Subject: [PATCH 2/3] build: avoid bashism in configure |
67 |
+ |
68 |
+[[ ]] and == are both Bashisms and /bin/sh may be a POSIX compliant |
69 |
+shell (Debian notably uses dash for /bin/sh which wouldn't be |
70 |
+happy with this). |
71 |
+ |
72 |
+This will continue to work on Bash. |
73 |
+ |
74 |
+Signed-off-by: Sam James <sam@g.o> |
75 |
+--- |
76 |
+ configure.ac.in | 2 +- |
77 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
78 |
+ |
79 |
+diff --git a/configure.ac.in b/configure.ac.in |
80 |
+index 0b30e9480c7..3dc6ef4a539 100644 |
81 |
+--- a/configure.ac.in |
82 |
++++ b/configure.ac.in |
83 |
+@@ -187,7 +187,7 @@ fi |
84 |
+ |
85 |
+ if [ test -f /usr/bin/lsb_release ]; then |
86 |
+ CODENAME=`/usr/bin/lsb_release -c|cut -f 2` |
87 |
+- if [[ $CODENAME == "wheezy" ]]; then : |
88 |
++ if test $CODENAME = "wheezy" ; then |
89 |
+ CPPFLAGS="${CPPFLAGS} -DOLD_NETFILTER_INTERFACE=1" |
90 |
+ fi |
91 |
+ fi |
92 |
+ |
93 |
+From 6e355cb98078dbfc379ba178ec99b7e351afdfe9 Mon Sep 17 00:00:00 2001 |
94 |
+From: Sam James <sam@g.o> |
95 |
+Date: Tue, 8 Feb 2022 06:09:44 +0000 |
96 |
+Subject: [PATCH 3/3] build: use $(MAKE) |
97 |
+ |
98 |
+This allows parallel builds to work properly as we'll be calling 'make ...' |
99 |
+with any additional arguments it internally passes down rather than literally |
100 |
+just make. |
101 |
+ |
102 |
+Signed-off-by: Sam James <sam@g.o> |
103 |
+--- |
104 |
+ configure.ac.in | 5 +---- |
105 |
+ 1 file changed, 1 insertion(+), 4 deletions(-) |
106 |
+ |
107 |
+diff --git a/configure.ac.in b/configure.ac.in |
108 |
+index 3dc6ef4a539..3ff06c4efd4 100644 |
109 |
+--- a/configure.ac.in |
110 |
++++ b/configure.ac.in |
111 |
+@@ -720,10 +720,7 @@ fi |
112 |
+ |
113 |
+ AC_DEFINE_UNQUOTED(_CRT_SECURE_NO_WARNINGS, 1, [Disable warning on windows]) |
114 |
+ |
115 |
+-GMAKE=`which gmake` |
116 |
+-if test x$GMAKE = x; then |
117 |
+- GMAKE="make" |
118 |
+-fi |
119 |
++GMAKE='$(MAKE)' |
120 |
+ |
121 |
+ GIT=`which git` |
122 |
+ if test x$GIT = x; then |
123 |
|
124 |
diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch |
125 |
new file mode 100644 |
126 |
index 000000000000..48551589f022 |
127 |
--- /dev/null |
128 |
+++ b/net-analyzer/ntopng/files/ntopng-5.2.1-mysqltool.patch |
129 |
@@ -0,0 +1,17 @@ |
130 |
+--- a/configure.ac.in |
131 |
++++ b/configure.ac.in |
132 |
+@@ -596,13 +596,7 @@ if test "${with_nedge+set}" != set; then |
133 |
+ if test "x$ac_cv_prog_ac_ct_MARIADB" = "xmariadb_config"; then |
134 |
+ MYSQLTOOL="mariadb_config" |
135 |
+ else |
136 |
+- PATH=$PATH:/usr/local/mysql/bin |
137 |
+- AC_CHECK_TOOL(MYSQL, mysql_config) |
138 |
+- if test "x$ac_cv_prog_ac_ct_MYSQL" = "xmysql_config"; then |
139 |
+- MYSQLTOOL="mysql_config" |
140 |
+- else |
141 |
+- MYSQLTOOL="" |
142 |
+- fi |
143 |
++ MYSQLTOOL="mysql_config" |
144 |
+ fi |
145 |
+ |
146 |
+ if test -n "$MYSQLTOOL"; then |
147 |
|
148 |
diff --git a/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch b/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch |
149 |
new file mode 100644 |
150 |
index 000000000000..4940cb44b733 |
151 |
--- /dev/null |
152 |
+++ b/net-analyzer/ntopng/files/ntopng-5.2.1-ndpi-linking.patch |
153 |
@@ -0,0 +1,13 @@ |
154 |
+--- a/configure.ac.in |
155 |
++++ b/configure.ac.in |
156 |
+@@ -236,8 +236,8 @@ fi |
157 |
+ PKG_CHECK_MODULES([NDPI], [libndpi >= 2.0], [ |
158 |
+ NDPI_INC=`echo $NDPI_CFLAGS | sed -e "s/[ ]*$//"` |
159 |
+ # Use static libndpi library as building against the dynamic library fails |
160 |
+- NDPI_LIB="-Wl,-Bstatic $NDPI_LIBS -Wl,-Bdynamic" |
161 |
+- #NDPI_LIB="$NDPI_LIBS" |
162 |
++ #NDPI_LIB="-Wl,-Bstatic $NDPI_LIBS -Wl,-Bdynamic" |
163 |
++ NDPI_LIB="$NDPI_LIBS" |
164 |
+ NDPI_LIB_DEP= |
165 |
+ ], [ |
166 |
+ AC_MSG_CHECKING(for nDPI source) |
167 |
|
168 |
diff --git a/net-analyzer/ntopng/ntopng-5.2.1.ebuild b/net-analyzer/ntopng/ntopng-5.2.1.ebuild |
169 |
new file mode 100644 |
170 |
index 000000000000..b1e0ebb11864 |
171 |
--- /dev/null |
172 |
+++ b/net-analyzer/ntopng/ntopng-5.2.1.ebuild |
173 |
@@ -0,0 +1,97 @@ |
174 |
+# Copyright 1999-2022 Gentoo Authors |
175 |
+# Distributed under the terms of the GNU General Public License v2 |
176 |
+ |
177 |
+EAPI=8 |
178 |
+ |
179 |
+inherit autotools toolchain-funcs |
180 |
+ |
181 |
+DESCRIPTION="Network traffic analyzer with web interface" |
182 |
+HOMEPAGE="https://www.ntop.org/" |
183 |
+SRC_URI="https://github.com/ntop/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
184 |
+ |
185 |
+LICENSE="GPL-3" |
186 |
+SLOT="0" |
187 |
+KEYWORDS="~amd64 ~x86" |
188 |
+ |
189 |
+DEPEND="dev-db/mysql-connector-c:= |
190 |
+ dev-db/sqlite:3 |
191 |
+ dev-libs/hiredis:= |
192 |
+ dev-libs/json-c:= |
193 |
+ dev-libs/libmaxminddb |
194 |
+ dev-libs/libsodium:= |
195 |
+ dev-libs/openssl:= |
196 |
+ net-analyzer/rrdtool |
197 |
+ net-libs/libpcap |
198 |
+ >=net-libs/nDPI-4.2:= |
199 |
+ >=net-libs/zeromq-3:= |
200 |
+ net-misc/curl |
201 |
+ sys-libs/libcap |
202 |
+ sys-libs/zlib" |
203 |
+RDEPEND="${DEPEND} |
204 |
+ acct-user/ntopng |
205 |
+ acct-group/ntopng |
206 |
+ dev-db/redis" |
207 |
+BDEPEND="virtual/pkgconfig" |
208 |
+ |
209 |
+PATCHES=( |
210 |
+ "${FILESDIR}"/${PN}-5.2.1-mysqltool.patch |
211 |
+ "${FILESDIR}"/${PN}-5.2.1-ndpi-linking.patch |
212 |
+ "${FILESDIR}"/${PN}-5.2.1-build-system.patch |
213 |
+) |
214 |
+ |
215 |
+src_prepare() { |
216 |
+ default |
217 |
+ |
218 |
+ # Follows upstream's autogen.sh |
219 |
+ sed \ |
220 |
+ -e "s/@VERSION@/${PV}.$(date +%y%m%d)/g" \ |
221 |
+ -e "s/@SHORT_VERSION@/${PV}/g" \ |
222 |
+ -e "s/@GIT_DATE@/$(date)/g" \ |
223 |
+ -e "s/@GIT_RELEASE@/${PV}.$(date +%y%m%d)/g" \ |
224 |
+ -e "s/@GIT_BRANCH@//g" < "${S}/configure.ac.in" \ |
225 |
+ > "${S}/configure.ac" || die |
226 |
+ |
227 |
+ eautoreconf |
228 |
+} |
229 |
+ |
230 |
+src_configure() { |
231 |
+ tc-export PKG_CONFIG |
232 |
+ |
233 |
+ # configure.ac.in at least has some bashisms(?) which get lost(?) |
234 |
+ # in conversion to configure.ac (like [ -> nothing?) so just force |
235 |
+ # bash for now. It's still not quite right but at least upstream will be |
236 |
+ # testing with it. TODO: fix this! |
237 |
+ CONFIG_SHELL="${BROOT}/bin/bash" econf |
238 |
+} |
239 |
+ |
240 |
+src_compile() { |
241 |
+ emake \ |
242 |
+ CC="$(tc-getCC)" \ |
243 |
+ MYCFLAGS="${CFLAGS}" \ |
244 |
+ MYLDFLAGS="${LDFLAGS}" |
245 |
+} |
246 |
+ |
247 |
+src_install() { |
248 |
+ SHARE_NTOPNG_DIR="${EPREFIX}/usr/share/${PN}" |
249 |
+ insinto "${SHARE_NTOPNG_DIR}" |
250 |
+ doins -r httpdocs |
251 |
+ doins -r scripts |
252 |
+ |
253 |
+ insinto "${SHARE_NTOPNG_DIR}/third-party" |
254 |
+ doins -r third-party/i18n.lua-master |
255 |
+ doins -r third-party/lua-resty-template-master |
256 |
+ |
257 |
+ exeinto /usr/bin |
258 |
+ doexe "${PN}" |
259 |
+ doman "${PN}.8" |
260 |
+ |
261 |
+ newinitd "${FILESDIR}"/ntopng.init.d ntopng |
262 |
+ newconfd "${FILESDIR}"/ntopng.conf.d ntopng |
263 |
+ |
264 |
+ keepdir /var/lib/ntopng |
265 |
+ fowners ntopng /var/lib/ntopng |
266 |
+} |
267 |
+ |
268 |
+pkg_postinst() { |
269 |
+ elog "ntopng default credentials are user='admin' password='admin'" |
270 |
+} |