On 2011-08-31 Russell Coker <russ...@coker.com.au> wrote: > I would appreciate it if you could write a patch for configure.in to > check for the version.
> I've already put an ifdef around the code in question, but it'll > still get a useless link. Hello Russell, find attached the simple version of the patch which simply stops linking against gcrypt at all, since it is only necessary for very old gnutls. This way postal can be bult against libgnutls28-dev If you want a versioned check I can provide one, but it would introduce a depency on pkgconfig. cu Andreas -- `What a good friend you are to him, Dr. Maturin. His other friends are so grateful to you.' `I sew his ears on from time to time, sure'
diff -Nru postal-0.73/bhm.cpp postal-0.73+nmu1/bhm.cpp --- postal-0.73/bhm.cpp 2012-01-14 13:09:31.000000000 +0100 +++ postal-0.73+nmu1/bhm.cpp 2014-04-19 19:34:52.000000000 +0200 @@ -21,8 +21,10 @@ #include "basictcp.h" #ifdef USE_GNUTLS #include <errno.h> +#if GNUTLS_VERSION_NUMBER <= 0x020b00 #include <gcrypt.h> GCRY_THREAD_OPTION_PTHREAD_IMPL; +#endif /* GNUTLS_VERSION_NUMBER */ #endif int processes = 0; diff -Nru postal-0.73/changes.txt postal-0.73+nmu1/changes.txt diff -Nru postal-0.73/config.status postal-0.73+nmu1/config.status diff -Nru postal-0.73/configure postal-0.73+nmu1/configure --- postal-0.73/configure 2012-01-14 12:33:01.000000000 +0100 +++ postal-0.73+nmu1/configure 2014-04-19 19:36:59.000000000 +0200 @@ -4057,7 +4057,7 @@ gnutls="" else gnutls="#define USE_GNUTLS" - crypt_ldflags="$extra_ldflags -lgnutls -lgcrypt" + crypt_ldflags="$extra_ldflags -lgnutls" fi if [ "$OPENSSL" = "no" ]; then openssl="" diff -Nru postal-0.73/configure.in postal-0.73+nmu1/configure.in --- postal-0.73/configure.in 2012-01-14 12:32:56.000000000 +0100 +++ postal-0.73+nmu1/configure.in 2014-04-19 19:51:31.000000000 +0200 @@ -120,7 +120,7 @@ gnutls="" else gnutls="#define USE_GNUTLS" - crypt_ldflags="$extra_ldflags -lgnutls -lgcrypt" + crypt_ldflags="$extra_ldflags -lgnutls" fi if [[ "$OPENSSL" = "no" ]]; then openssl="" diff -Nru postal-0.73/debian/changelog postal-0.73+nmu1/debian/changelog --- postal-0.73/debian/changelog 2012-01-16 21:48:27.000000000 +0100 +++ postal-0.73+nmu1/debian/changelog 2014-04-19 19:37:56.000000000 +0200 @@ -1,3 +1,11 @@ +postal (0.73+nmu1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Do not #include <gcrypt.h> when unnecessary. + * Stop linking against libgcrypt. + + -- Andreas Metzler <ametz...@debian.org> Sat, 19 Apr 2014 19:37:12 +0200 + postal (0.73) unstable; urgency=low * Make postal correctly issue the quit command after delivery failure. diff -Nru postal-0.73/Makefile postal-0.73+nmu1/Makefile diff -Nru postal-0.73/postal.cpp postal-0.73+nmu1/postal.cpp --- postal-0.73/postal.cpp 2012-01-14 13:08:12.000000000 +0100 +++ postal-0.73+nmu1/postal.cpp 2014-04-19 19:35:29.000000000 +0200 @@ -12,8 +12,10 @@ #include "logit.h" #ifdef USE_GNUTLS #include <errno.h> +#if GNUTLS_VERSION_NUMBER <= 0x020b00 #include <gcrypt.h> GCRY_THREAD_OPTION_PTHREAD_IMPL; +#endif /* GNUTLS_VERSION_NUMBER */ #endif void usage() diff -Nru postal-0.73/rabid.cpp postal-0.73+nmu1/rabid.cpp --- postal-0.73/rabid.cpp 2012-01-14 13:08:49.000000000 +0100 +++ postal-0.73+nmu1/rabid.cpp 2014-04-19 19:40:35.000000000 +0200 @@ -14,9 +14,12 @@ #include "logit.h" #ifdef USE_GNUTLS #include <errno.h> +#if GNUTLS_VERSION_NUMBER <= 0x020b00 #include <gcrypt.h> GCRY_THREAD_OPTION_PTHREAD_IMPL; +#endif /* GNUTLS_VERSION_NUMBER */ #endif +#include <cstring> void usage() {