[opensaml2] 09/24: New patch Use-pkg-config-for-log4shib-log4cpp.patch

Ferenc Wágner wferi at moszumanska.debian.org
Tue Aug 30 20:55:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

wferi pushed a commit to branch debian/experimental
in repository opensaml2.

commit cc5314640371545287e99bb3a3e77f5172b57f43
Author: Ferenc Wágner <wferi at niif.hu>
Date:   Fri Jul 1 20:43:27 2016 +0200

    New patch Use-pkg-config-for-log4shib-log4cpp.patch
    
    Use pkg-config for log4shib/log4cpp
---
 .../Use-pkg-config-for-log4shib-log4cpp.patch      | 103 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 104 insertions(+)

diff --git a/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch b/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch
new file mode 100644
index 0000000..d6fc996
--- /dev/null
+++ b/debian/patches/Use-pkg-config-for-log4shib-log4cpp.patch
@@ -0,0 +1,103 @@
+From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi at niif.hu>
+Date: Mon, 20 Jun 2016 12:17:00 +0200
+Subject: Use pkg-config for log4shib/log4cpp
+
+---
+ configure.ac         | 53 ++++------------------------------------------------
+ saml/Makefile.am     |  4 ++++
+ samlsign/Makefile.am |  4 ++++
+ 3 files changed, 12 insertions(+), 49 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 29eff67..bba1f29 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -160,55 +160,10 @@ BOOST_SMART_PTR
+ BOOST_STRING_ALGO
+ CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
+ 
+-# log4shib settings (favor this version over the log4cpp code)
+-AC_PATH_PROG(LOG4SHIB_CONFIG,log4shib-config)
+-AC_ARG_WITH(log4shib,
+-    AS_HELP_STRING([--with-log4shib=PATH],[where log4shib-config is installed]),
+-    [
+-    LOG4SHIB_CONFIG="${with_log4shib}"
+-    if ! test -f "${LOG4SHIB_CONFIG}"; then
+-    	LOG4SHIB_CONFIG="${with_log4shib}/bin/log4shib-config"
+-    fi
+-    ])
+-if test -f "${LOG4SHIB_CONFIG}" ; then
+-    LIBS="`${LOG4SHIB_CONFIG} --libs` $LIBS"
+-    CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
+-	AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
+-    AC_LINK_IFELSE(
+-        [AC_LANG_PROGRAM([[#include <log4shib/Category.hh>
+-#include <log4shib/CategoryStream.hh>]],
+-            [[log4shib::Category::getInstance("foo").errorStream() << log4shib::eol]])],
+-        [AC_DEFINE([OPENSAML_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
+-        [AC_MSG_ERROR([unable to link with log4shib])])
+-else
+-    AC_MSG_WARN([log4shib-config not found, may need to use --with-log4shib option])
+-    AC_MSG_WARN([will look for original log4cpp library])
+-    
+-    # log4cpp settings
+-    AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
+-    AC_ARG_WITH(log4cpp,
+-        AS_HELP_STRING([--with-log4cpp=PATH],[where log4cpp-config is installed]),
+-        [
+-        LOG4CPP_CONFIG="${with_log4cpp}"
+-        if ! test -f "${LOG4CPP_CONFIG}"; then
+-        	LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"
+-        fi
+-        ])
+-    if test -f "${LOG4CPP_CONFIG}"; then
+-        AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
+-        LIBS="`${LOG4CPP_CONFIG} --libs` $LIBS"
+-        CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
+-        AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
+-        AC_LINK_IFELSE(
+-            [AC_LANG_PROGRAM([[#include <log4cpp/Category.hh>
+-#include <log4cpp/CategoryStream.hh>]],
+-                [[log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol]])],
+-            [AC_DEFINE([OPENSAML_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])],
+-            [AC_MSG_ERROR([unable to link with log4cpp, need version 1.0 or later])])
+-    else
+-        AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
+-    fi
+-fi
++PKG_CHECK_MODULES([log4shib], [log4shib],
++    [AC_DEFINE([OPENSAML_LOG4SHIB],[1],[Define to 1 if log4shib library is used.])],
++    [PKG_CHECK_MODULES([log4cpp], [log4cpp],
++        [AC_DEFINE([OPENSAML_LOG4CPP],[1],[Define to 1 if log4cpp library is used.])])])
+ 
+ # Xerces settings
+ AC_ARG_WITH(xerces,
+diff --git a/saml/Makefile.am b/saml/Makefile.am
+index 9c82971..c09b573 100644
+--- a/saml/Makefile.am
++++ b/saml/Makefile.am
+@@ -193,6 +193,10 @@ libsaml_la_SOURCES = \
+ # this is different from the project version
+ # http://sources.redhat.com/autobook/autobook/autobook_91.html
+ libsaml_la_LDFLAGS = -version-info 9:0:0
++libsaml_la_CPPFLAGS = \
++    $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
++libsaml_la_LIBADD = \
++    $(log4shib_LIBS) $(log4cpp_LIBS)
+ 
+ install-exec-hook:
+ 	for la in $(lib_LTLIBRARIES) ; do rm -f $(DESTDIR)$(libdir)/$$la ; done
+diff --git a/samlsign/Makefile.am b/samlsign/Makefile.am
+index 5eb3074..2dde4a6 100644
+--- a/samlsign/Makefile.am
++++ b/samlsign/Makefile.am
+@@ -5,5 +5,9 @@ bin_PROGRAMS = samlsign
+ samlsign_SOURCES = samlsign.cpp
+ 
+ samlsign_LDADD = $(top_builddir)/saml/libsaml.la
++samlsign_CPPFLAGS = \
++    $(log4shib_CFLAGS) $(log4cpp_CFLAGS)
++samlsign_LDADD += \
++    $(log4shib_LIBS) $(log4cpp_LIBS)
+ 
+ EXTRA_DIST = resource.h samlsign.rc
diff --git a/debian/patches/series b/debian/patches/series
index cafdbc4..b735d92 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 Disable-forcing-of-libtool-silent.patch
+Use-pkg-config-for-log4shib-log4cpp.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-shibboleth/opensaml2.git



More information about the Pkg-shibboleth-devel mailing list