freebsd-ports/net/ndpi/Makefile
Guido Falsi 66e6345cf9 net/ntopng,net/ndpi: Fix build due to missing symbols in certain circumstances
When building on live machines when rrdtool happens to be already
present, which often happens automatically due to the order in which
the ports system builds things locally, the ntopng port could fail
due to unreferenced symbols from glib. This was caused by ntopng
trying to unconditionally link statically to ndpi but not providing
all required static libraries references to the command line.

- Add databases/rrdtool dependency in ndpi to ensure the same
  libraries are used in both ports
- Make ntopng unconditionally use dynamic linking for ndpi too,
  avoiding the issue described above.

PR:		262756
2022-03-25 00:48:47 +01:00

54 lines
1.5 KiB
Makefile

# Created by: Muhammad Moinur Rahman <5u623l20@gmail.com>
PORTNAME= ndpi
PORTVERSION= 4.2.d20220210
PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= net
MAINTAINER= madpilot@FreeBSD.org
COMMENT= NTOP-maintained superset of the popular OpenDPI library
LICENSE= LGPL3+
LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= librrd.so:databases/rrdtool \
libjson-c.so:devel/json-c \
libgcrypt.so:security/libgcrypt \
libgpg-error.so:security/libgpg-error
USES= autoreconf compiler:c++11-lang cpe libtool localbase:ldflags pathfix \
pkgconfig
CPE_VENDOR= ntop
USE_LDCONFIG= yes
CONFIGURE_ARGS= --with-pic
CPPFLAGS+= -I${LOCALBASE}/include/json-c
LIBS+= -ljson-c
MAKE_ENV+= EXAMPLESDIR="${EXAMPLESDIR_REL}"
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USE_GITHUB= yes
GH_ACCOUNT= ntop
GH_PROJECT= nDPI
GH_TAGNAME= 258fedb
PLIST_SUB= MAJOR_VER=${PORTVERSION:R:R} VER=${PORTVERSION:R}
post-configure:
@${REINPLACE_CMD} -e 's/#define PACKAGE/#define NDPI_PACKAGE/g' \
-e 's/#define VERSION/#define NDPI_VERSION/g' \
${WRKSRC}/configure
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libndpi.so.${PORTVERSION:R}.0
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/ndpiReader
${RM} ${STAGEDIR}${PREFIX}/lib/libndpi.so \
${STAGEDIR}${PREFIX}/lib/libndpi.so.${PORTVERSION:R:R}
${RLN} ${STAGEDIR}${PREFIX}/lib/libndpi.so.${PORTVERSION:R}.0 \
${STAGEDIR}${PREFIX}/lib/libndpi.so
${RLN} ${STAGEDIR}${PREFIX}/lib/libndpi.so.${PORTVERSION:R}.0 \
${STAGEDIR}${PREFIX}/lib/libndpi.so.${PORTVERSION:R:R}
.include <bsd.port.mk>