[libfko] Have 'make install' run ldconfig if basic fwknop/fwknopd -h exec fails fwknop-2.5-pre3
authorMichael Rash <mbr@cipherdyne.org>
Sun, 30 Jun 2013 18:50:12 +0000 (14:50 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Sun, 30 Jun 2013 18:50:12 +0000 (14:50 -0400)
This commit makes sure that if running 'fwknop -h' or 'fwknopd -h' appears to
fail then run ldconfig under the 'make install' step.  George Herlin reported
that on some systems ldconfig was not automatically getting executed via the
autoconf Makefile config, and since fwknop/fwknopd depend on a shared library
(libfko), ldconfig needs to be executed by 'make install' if it wasn't already
done.

CREDITS
Makefile.am

diff --git a/CREDITS b/CREDITS
index 58708a3..41e8440 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -115,6 +115,9 @@ George Herlin
       test suite operate equivalently regardless of whether valgrind is used or
       whether fwknop is being tested on an embedded system with very limited
       resources.
+    - Suggested that 'make install' run ldconfig since on some systems it
+      appears that ldconfig is not automatically run via the autoconf generated
+      Makefile configs.
 
 Ruhsam Bernhard
     - Reported an issue where the message size test would result in long
index a480d19..b6c9205 100644 (file)
@@ -345,3 +345,14 @@ install-exec-hook:
        if test -f $(DESTDIR)$(sysconfdir)/fwknop/access.conf; then \
                chmod 600 $(DESTDIR)$(sysconfdir)/fwknop/access.conf; \
        fi
+       if test -f $(DESTDIR)$(bindir)/fwknop; then \
+               if ! $(DESTDIR)$(bindir)/fwknop -h > /dev/null 2>&1; then \
+                       ldconfig; \
+               fi \
+       else \
+               if test -f $(DESTDIR)$(sbindir)/fwknopd; then \
+                       if ! $(DESTDIR)$(sbindir)/fwknopd -h > /dev/null 2>&1; then \
+                               ldconfig -v; \
+                       fi \
+               fi \
+       fi