nDPI
nDPI copied to clipboard
`src/lib/Makefile.in` has a broken libdir path.
It has
cp $(NDPI_LIBS) $(DESTDIR)$(PREFIX)$(libdir)/
which is installing libraries into /usr/usr/lib64/
, because in Autotools logic, $libdir
must be absolute.
Just make it
cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
But shouldn't it be DESTDIR=/
in your case? Because you want to install it to /
with PREFIX=usr/
.
Or am I wrong?
But shouldn't it be
DESTDIR=/
in your case? Because you want to install it to/
withPREFIX=usr/
. Or am I wrong?
No, that is not the point of DESTDIR
. DESTDIR
is normally equal to /tmp/package-ndpi-prefix
, and is used to obtain an installation tree somewhere outside of the normal OS directory hierarchy.
You're damn right. $(PREFIX)
is usually part of $(libdir)
if not set by the user explicitly.
I remember that a long time ago there was an "anomaly" within all those Makefile.in
s which caused issues with DESTDIR
and PREFIX
.
I think there is something broken. Using this patch:
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 918547ad..e76d8edc 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -91,8 +91,9 @@ cppcheck:
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I ../include *.c protocols/*.c
install: $(NDPI_LIBS)
- mkdir -p $(DESTDIR)$(PREFIX)$(libdir)
- cp $(NDPI_LIBS) $(DESTDIR)$(PREFIX)$(libdir)/
+ mkdir -p $(DESTDIR)$(libdir)
+ cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
+
cp -P $(NDPI_LIB_SHARED_BASE) $(DESTDIR)$(PREFIX)$(libdir)/
cp -P $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) $(DESTDIR)$(PREFIX)$(libdir)/
mkdir -p $(DESTDIR)$(PREFIX)$(includedir)
and I get this error:
Making install in src/lib
make[1]: Entering directory '/home/toni/git/nDPI/src/lib'
mkdir -p /home/toni/git/nDPI/tmp_install/lib
cp libndpi.a libndpi.so.4.9.0 /home/toni/git/nDPI/tmp_install/lib/
cp -P libndpi.so /home/toni/git/nDPI/tmp_install/usr/bla/lib/
cp: cannot create symbolic link '/home/toni/git/nDPI/tmp_install/usr/bla/lib/': No such file or directory
make[1]: *** [Makefile:96: install] Error 1
make[1]: Leaving directory '/home/toni/git/nDPI/src/lib'
make: *** [Makefile:557: install-recursive] Error 1
while configuring and building it with:
./autogen.sh --prefix=/usr/bla && make install DESTDIR=$(realpath ./tmp_install)
Does it work for you or do I miss something?
Nevermind, the patch is not enough to fix this. ;)
See https://gitlab.com/Lockywolf/lwfslackbuilds/-/blob/master/53_todo_services/ntopng/ntopng.SlackBuild?ref_type=heads