net-libs/rpcsvc-proto: arm stable wrt bug #725002
[gentoo.git] / net-libs / nDPI / nDPI-3.0-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit autotools multilib
6
7 DESCRIPTION="Open Source Deep Packet Inspection Software Toolkit"
8 HOMEPAGE="https://www.ntop.org/"
9 SRC_URI="https://github.com/ntop/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
10
11 LICENSE="GPL-3"
12 SLOT="0/$(ver_cut 1)"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="static-libs"
15
16 DEPEND="
17         dev-libs/json-c:=
18         net-libs/libpcap
19 "
20 RDEPEND="
21         ${DEPEND}
22 "
23
24 src_prepare() {
25         # Taken from autogen.sh (bug #704074):
26         sed \
27                 -e "s/@NDPI_MAJOR@/$(ver_cut 1)/g" \
28                 -e "s/@NDPI_MINOR@/$(ver_cut 2)/g" \
29                 -e "s/@NDPI_PATCH@/$(ver_cut 3)/g" \
30                 -e "s/@NDPI_VERSION_SHORT@/${PV}/g" \
31                 < "${S}/configure.seed" \
32                 > "${S}/configure.ac" || die
33
34         sed -i \
35                 -e "s%^libdir\s*=\s*\${prefix}/lib\s*$%libdir     = \${prefix}/$(get_libdir)%" \
36                 src/lib/Makefile.in || die
37
38         default
39         eautoreconf
40
41         # Taken from autogen.sh (bug #704074):
42         sed -i \
43                 -e "s/#define PACKAGE/#define NDPI_PACKAGE/g" \
44                 -e "s/#define VERSION/#define NDPI_VERSION/g" \
45                 configure || die
46 }
47
48 src_install() {
49         default
50         if ! use static-libs; then
51                 rm "${D}"/usr/$(get_libdir)/lib${PN,,}.a || die
52         fi
53 }