net-libs/rpcsvc-proto: arm stable wrt bug #725002
[gentoo.git] / net-libs / nDPI / nDPI-9999.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 git-r3 multilib
6
7 DESCRIPTION="Open Source Deep Packet Inspection Software Toolkit"
8 HOMEPAGE="https://www.ntop.org/"
9 EGIT_REPO_URI="https://github.com/ntop/${PN}"
10
11 LICENSE="GPL-3"
12 SLOT="0"
13 KEYWORDS=""
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         eval $(grep '^NDPI_MAJOR=' autogen.sh)
26         eval $(grep '^NDPI_MINOR=' autogen.sh)
27         eval $(grep '^NDPI_PATCH=' autogen.sh)
28         NDPI_VERSION_SHORT="${NDPI_MAJOR}.${NDPI_MINOR}.${NDPI_PATCH}"
29
30         sed \
31                 -e "s/@NDPI_MAJOR@/${NDPI_MAJOR}/g" \
32                 -e "s/@NDPI_MINOR@/${NDPI_MINOR}/g" \
33                 -e "s/@NDPI_PATCH@/${NDPI_PATCH}/g" \
34                 -e "s/@NDPI_VERSION_SHORT@/${NDPI_VERSION_SHORT}/g" \
35                 < "${S}/configure.seed" \
36                 > "${S}/configure.ac" || die
37
38         sed -i \
39                 -e "s%^libdir\s*=\s*\${prefix}/lib\s*$%libdir     = \${prefix}/$(get_libdir)%" \
40                 src/lib/Makefile.in || die
41
42         default
43         eautoreconf
44
45         # Taken from autogen.sh (bug #704074):
46         sed -i \
47                 -e "s/#define PACKAGE/#define NDPI_PACKAGE/g" \
48                 -e "s/#define VERSION/#define NDPI_VERSION/g" \
49                 configure || die
50 }
51
52 src_install() {
53         default
54         if ! use static-libs; then
55                 rm "${D}"/usr/$(get_libdir)/lib${PN,,}.a || die
56         fi
57 }