Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nDPI/
Date: Mon, 03 Jan 2022 11:23:18
Message-Id: 1641208880.fa4c91dd460e1604ec58cc6b3531e8170812da3f.sam@gentoo
1 commit: fa4c91dd460e1604ec58cc6b3531e8170812da3f
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 3 10:50:06 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 3 11:21:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa4c91dd
7
8 net-libs/nDPI: add 4.0
9
10 Includes a patch which adds an API to allow ntopong to work too.
11
12 (Working on ar/other build system patches upstream.)
13
14 Bug: https://bugs.gentoo.org/799782
15 Bug: https://bugs.gentoo.org/625730
16 Closes: https://bugs.gentoo.org/830403
17 Thanks-to: Larry Sexton <sexton.larry048 <AT> gmail.com>
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19
20 net-libs/nDPI/Manifest | 2 ++
21 net-libs/nDPI/nDPI-4.0.ebuild | 59 ++++++++++++++++++++++++++++++++++++
22 net-libs/nDPI/nDPI-9999.ebuild | 68 ++++++++++++++++++++----------------------
23 3 files changed, 93 insertions(+), 36 deletions(-)
24
25 diff --git a/net-libs/nDPI/Manifest b/net-libs/nDPI/Manifest
26 index 505e78a99b99..eae6568123c4 100644
27 --- a/net-libs/nDPI/Manifest
28 +++ b/net-libs/nDPI/Manifest
29 @@ -1 +1,3 @@
30 DIST nDPI-3.4.tar.gz 37976087 BLAKE2B 49e25586671a91278d90775c3dbc881ce4ca9ae4afd3108b1caff3b0d38251808bcd52ead253f451474195994fbf94658f70241acedb23c35a475df3b15c4a20 SHA512 ed5a22b6ddc14ad707a18a0bd96746c1df489969faaa42016fa9aad8d414fc4ee303b96cac15c3ba86f484a80a0aaa2dd1be5f92be672912e0e0d30da4bdad4c
31 +DIST nDPI-4.0-patches.tar.bz2 8744 BLAKE2B 48bfb2cf240823b64ab15a3f8a21acece878102ebb4cc807648b264ef091107a05d66fc672cccd1bc721ad3ea0edde786a1f133dfc84c91422604a9929e327ed SHA512 99a780c18c048ceec29c42828c420fe3f9624906eaef70f92af6abdbf7bc29133e048d7f8de85d8b73aa6667066e7ab5843fa293221d5ec8bbe87803dde83db6
32 +DIST nDPI-4.0.tar.gz 120053617 BLAKE2B ea0f333bd62622c1ab792137f9bbf2e35cb3790aae191c5caeaea36c7ce376bfa84633e99e321c16bcfbe5812d6674b825bdc4197297cee76064ed88f344a577 SHA512 2526041bc02a210e65bad31323a66167d79a37d14697cf4459054cc54715e53f9673b0000cefa6b452bbe3b3e6c25f0bafcf59d24323d210e2ce6782d9153f81
33
34 diff --git a/net-libs/nDPI/nDPI-4.0.ebuild b/net-libs/nDPI/nDPI-4.0.ebuild
35 new file mode 100644
36 index 000000000000..8516413b47eb
37 --- /dev/null
38 +++ b/net-libs/nDPI/nDPI-4.0.ebuild
39 @@ -0,0 +1,59 @@
40 +# Copyright 1999-2022 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=8
44 +
45 +inherit autotools
46 +
47 +DESCRIPTION="Open Source Deep Packet Inspection Software Toolkit"
48 +HOMEPAGE="https://www.ntop.org/"
49 +if [[ ${PV} == 9999 ]] ; then
50 + EGIT_REPO_URI="https://github.com/ntop/${PN}"
51 + inherit git-r3
52 +else
53 + SRC_URI="https://github.com/ntop/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
54 + SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches.tar.bz2"
55 +
56 + KEYWORDS="~amd64 ~x86"
57 +fi
58 +
59 +LICENSE="LGPL-3+"
60 +SLOT="0/$(ver_cut 1)"
61 +
62 +DEPEND="dev-libs/json-c:=
63 + dev-libs/libgcrypt:=
64 + dev-libs/libgpg-error
65 + net-libs/libpcap"
66 +RDEPEND="${DEPEND}"
67 +
68 +PATCHES=(
69 + "${WORKDIR}"/${P}-patches/
70 +)
71 +
72 +# Also sent a patch upstream https://github.com/ntop/nDPI/pull/1392 for
73 +# AR/CC etc but doesn't apply cleanly (at all) to 4.0.
74 +
75 +src_prepare() {
76 + default
77 +
78 + sed -i \
79 + -e "s%^libdir\s*=\s*\${prefix}/lib\s*$%libdir = \${prefix}/$(get_libdir)%" \
80 + src/lib/Makefile.in || die
81 +
82 + eautoreconf
83 +}
84 +
85 +src_test() {
86 + pushd tests || die
87 +
88 + ./do.sh || die "Failed tests"
89 + ./do-unit.sh || die "Failed unit tests"
90 +
91 + popd || die
92 +}
93 +
94 +src_install() {
95 + default
96 +
97 + rm "${ED}/usr/$(get_libdir)"/lib${PN,,}.a || die
98 +}
99
100 diff --git a/net-libs/nDPI/nDPI-9999.ebuild b/net-libs/nDPI/nDPI-9999.ebuild
101 index bd4ac3459b84..ea288e57ec66 100644
102 --- a/net-libs/nDPI/nDPI-9999.ebuild
103 +++ b/net-libs/nDPI/nDPI-9999.ebuild
104 @@ -1,58 +1,54 @@
105 -# Copyright 1999-2021 Gentoo Authors
106 +# Copyright 1999-2022 Gentoo Authors
107 # Distributed under the terms of the GNU General Public License v2
108
109 -EAPI=7
110 +EAPI=8
111
112 -inherit autotools git-r3
113 +inherit autotools
114
115 DESCRIPTION="Open Source Deep Packet Inspection Software Toolkit"
116 HOMEPAGE="https://www.ntop.org/"
117 -EGIT_REPO_URI="https://github.com/ntop/${PN}"
118 +if [[ ${PV} == 9999 ]] ; then
119 + EGIT_REPO_URI="https://github.com/ntop/${PN}"
120 + inherit git-r3
121 +else
122 + SRC_URI="https://github.com/ntop/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
123
124 -LICENSE="GPL-3"
125 -SLOT="0"
126 -KEYWORDS=""
127 -IUSE="static-libs"
128 + KEYWORDS="~amd64 ~x86"
129 +fi
130
131 -DEPEND="
132 - dev-libs/json-c:=
133 - net-libs/libpcap
134 -"
135 -RDEPEND="
136 - ${DEPEND}
137 -"
138 +LICENSE="LGPL-3+"
139 +SLOT="0/$(ver_cut 1)"
140 +
141 +DEPEND="dev-libs/json-c:=
142 + dev-libs/libgcrypt:=
143 + dev-libs/libgpg-error
144 + net-libs/libpcap"
145 +RDEPEND="${DEPEND}"
146 +
147 +# Also sent a patch upstream https://github.com/ntop/nDPI/pull/1392 for
148 +# AR/CC etc but doesn't apply cleanly (at all) to 4.0.
149
150 src_prepare() {
151 - eval $(grep '^NDPI_MAJOR=' autogen.sh)
152 - eval $(grep '^NDPI_MINOR=' autogen.sh)
153 - eval $(grep '^NDPI_PATCH=' autogen.sh)
154 - NDPI_VERSION_SHORT="${NDPI_MAJOR}.${NDPI_MINOR}.${NDPI_PATCH}"
155 -
156 - sed \
157 - -e "s/@NDPI_MAJOR@/${NDPI_MAJOR}/g" \
158 - -e "s/@NDPI_MINOR@/${NDPI_MINOR}/g" \
159 - -e "s/@NDPI_PATCH@/${NDPI_PATCH}/g" \
160 - -e "s/@NDPI_VERSION_SHORT@/${NDPI_VERSION_SHORT}/g" \
161 - < "${S}/configure.seed" \
162 - > "${S}/configure.ac" || die
163 + default
164
165 sed -i \
166 -e "s%^libdir\s*=\s*\${prefix}/lib\s*$%libdir = \${prefix}/$(get_libdir)%" \
167 src/lib/Makefile.in || die
168
169 - default
170 eautoreconf
171 +}
172
173 - # Taken from autogen.sh (bug #704074):
174 - sed -i \
175 - -e "s/#define PACKAGE/#define NDPI_PACKAGE/g" \
176 - -e "s/#define VERSION/#define NDPI_VERSION/g" \
177 - configure || die
178 +src_test() {
179 + pushd tests || die
180 +
181 + ./do.sh || die "Failed tests"
182 + ./do-unit.sh || die "Failed unit tests"
183 +
184 + popd || die
185 }
186
187 src_install() {
188 default
189 - if ! use static-libs; then
190 - rm "${D}"/usr/$(get_libdir)/lib${PN,,}.a || die
191 - fi
192 +
193 + rm "${ED}/usr/$(get_libdir)"/lib${PN,,}.a || die
194 }