Package: gpgme1.0
Version: 1.18.0-2
Severity: normal
Tags: patch

Dear maintainer,

I've prepared an NMU for gpgme1.0 (versioned as 1.18.0-2.1) and
uploaded it to unstable. Please also see
https://salsa.debian.org/debian/gpgme/-/merge_requests/9 


kind regards
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 gpgme1.0-1.18.0/debian/changelog gpgme1.0-1.18.0/debian/changelog
--- gpgme1.0-1.18.0/debian/changelog	2022-11-02 15:54:12.000000000 +0100
+++ gpgme1.0-1.18.0/debian/changelog	2022-11-20 07:16:46.000000000 +0100
@@ -1,3 +1,16 @@
+gpgme1.0 (1.18.0-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Cherrypicked from upstream GIT:
+    + 0015-build-Prefer-gpgrt-config-when-available.patch,
+      0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch: Update
+      gpgme.m4 to prefer gpgrt-config even if gpgme-config was available and
+      to find gpgrt-config when AM_PATH_GPG_ERROR was not used.
+    + 0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch:
+      Document pkg-config instead of gpgme-config in manual.
+
+ -- Andreas Metzler <ametz...@debian.org>  Sun, 20 Nov 2022 07:16:46 +0100
+
 gpgme1.0 (1.18.0-2) unstable; urgency=medium
 
   [ Andreas Metzler ]
diff -Nru gpgme1.0-1.18.0/debian/patches/0015-build-Prefer-gpgrt-config-when-available.patch gpgme1.0-1.18.0/debian/patches/0015-build-Prefer-gpgrt-config-when-available.patch
--- gpgme1.0-1.18.0/debian/patches/0015-build-Prefer-gpgrt-config-when-available.patch	1970-01-01 01:00:00.000000000 +0100
+++ gpgme1.0-1.18.0/debian/patches/0015-build-Prefer-gpgrt-config-when-available.patch	2022-11-20 06:53:26.000000000 +0100
@@ -0,0 +1,59 @@
+From 9f55dceca0cf2926d14cb4a70bd0cdc454d89f03 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gni...@fsij.org>
+Date: Wed, 2 Nov 2022 10:08:52 +0900
+Subject: [PATCH] build: Prefer gpgrt-config when available.
+
+* src/gpgme.m4: Overriding the decision by --with-gpgme-prefix,
+use gpgrt-config gpgme when gpgrt-config is available.
+
+--
+
+This may offer better migration.
+
+GnuPG-bug-id: 5034
+Signed-off-by: NIIBE Yutaka <gni...@fsij.org>
+---
+ src/gpgme.m4 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/gpgme.m4 b/src/gpgme.m4
+index c749a5dd..09a282d0 100644
+--- a/src/gpgme.m4
++++ b/src/gpgme.m4
+@@ -5,15 +5,15 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ #
+ # This file is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ #
+-# Last-changed: 2020-11-20
++# Last-changed: 2022-11-02
+ 
+ 
+ AC_DEFUN([_AM_PATH_GPGME_CONFIG],
+ [ AC_ARG_WITH(gpgme-prefix,
+             AS_HELP_STRING([--with-gpgme-prefix=PFX],
+                            [prefix where GPGME is installed (optional)]),
+      gpgme_config_prefix="$withval", gpgme_config_prefix="")
+@@ -33,15 +33,15 @@ AC_DEFUN([_AM_PATH_GPGME_CONFIG],
+            AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+            ;;
+        esac
+      fi
+   fi
+ 
+   use_gpgrt_config=""
+-  if test x"${GPGME_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
++  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+     if $GPGRT_CONFIG gpgme --exists; then
+       GPGME_CONFIG="$GPGRT_CONFIG gpgme"
+       AC_MSG_NOTICE([Use gpgrt-config as gpgme-config])
+       use_gpgrt_config=yes
+     fi
+   fi
+   if test -z "$use_gpgrt_config"; then
+-- 
+2.35.1
+
diff -Nru gpgme1.0-1.18.0/debian/patches/0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch gpgme1.0-1.18.0/debian/patches/0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch
--- gpgme1.0-1.18.0/debian/patches/0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch	1970-01-01 01:00:00.000000000 +0100
+++ gpgme1.0-1.18.0/debian/patches/0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch	2022-11-20 06:53:26.000000000 +0100
@@ -0,0 +1,144 @@
+From abd51848bdc8a5ea5929f9cfb819a408dc53d463 Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gni...@fsij.org>
+Date: Tue, 15 Nov 2022 13:40:57 +0900
+Subject: [PATCH 1/2] gpgme.m4: Include _AM_PATH_GPGRT_CONFIG implementation.
+
+* src/gpgme.m4 (_AM_PATH_GPGRT_CONFIG): New.
+(_AM_PATH_GPGME_CONFIG): Require _AM_PATH_GPGRT_CONFIG.
+
+--
+
+GnuPG-bug-id: 6273
+Signed-off-by: NIIBE Yutaka <gni...@fsij.org>
+---
+ src/gpgme.m4 | 101 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 95 insertions(+), 6 deletions(-)
+
+diff --git a/src/gpgme.m4 b/src/gpgme.m4
+index 09a282d0..363a84f3 100644
+--- a/src/gpgme.m4
++++ b/src/gpgme.m4
+@@ -1,25 +1,114 @@
+ # gpgme.m4 - autoconf macro to detect GPGME.
+-# Copyright (C) 2002, 2003, 2004, 2014, 2018 g10 Code GmbH
++# Copyright (C) 2002, 2003, 2004, 2014, 2018, 2022 g10 Code GmbH
+ #
+ # This file is free software; as a special exception the author gives
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ #
+ # This file is distributed in the hope that it will be useful, but
+ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ #
+-# Last-changed: 2022-11-02
++# Last-changed: 2022-11-15
+ 
+ 
+-AC_DEFUN([_AM_PATH_GPGME_CONFIG],
+-[ AC_ARG_WITH(gpgme-prefix,
+-            AS_HELP_STRING([--with-gpgme-prefix=PFX],
+-                           [prefix where GPGME is installed (optional)]),
++dnl
++dnl Find gpgrt-config, which uses .pc file
++dnl (minimum pkg-config functionality, supporting cross build)
++dnl
++dnl _AM_PATH_GPGRT_CONFIG
++AC_DEFUN([_AM_PATH_GPGRT_CONFIG],[dnl
++  AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, [$prefix/bin:$PATH])
++  if test "$GPGRT_CONFIG" != "no"; then
++    # Determine gpgrt_libdir
++    #
++    # Get the prefix of gpgrt-config assuming it's something like:
++    #   <PREFIX>/bin/gpgrt-config
++    gpgrt_prefix=${GPGRT_CONFIG%/*/*}
++    possible_libdir1=${gpgrt_prefix}/lib
++    # Determine by using system libdir-format with CC, it's like:
++    #   Normal style: /usr/lib
++    #   GNU cross style: /usr/<triplet>/lib
++    #   Debian style: /usr/lib/<multiarch-name>
++    #   Fedora/openSUSE style: /usr/lib, /usr/lib32 or /usr/lib64
++    # It is assumed that CC is specified to the one of host on cross build.
++    if libdir_candidates=$(${CC:-cc} -print-search-dirs | \
++          sed -n -e "/^libraries/{s/libraries: =//;s/:/\\
++/g;p;}"); then
++      # From the output of -print-search-dirs, select valid pkgconfig dirs.
++      libdir_candidates=$(for dir in $libdir_candidates; do
++        if p=$(cd $dir 2>/dev/null && pwd); then
++          test -d "$p/pkgconfig" && echo $p;
++        fi
++      done)
++
++      for possible_libdir0 in $libdir_candidates; do
++        # possible_libdir0:
++        #   Fallback candidate, the one of system-installed (by $CC)
++        #   (/usr/<triplet>/lib, /usr/lib/<multiarch-name> or /usr/lib32)
++        # possible_libdir1:
++        #   Another candidate, user-locally-installed
++        #   (<gpgrt_prefix>/lib)
++        # possible_libdir2
++        #   Most preferred
++        #   (<gpgrt_prefix>/<triplet>/lib,
++        #    <gpgrt_prefix>/lib/<multiarch-name> or <gpgrt_prefix>/lib32)
++        if test "${possible_libdir0##*/}" = "lib"; then
++          possible_prefix0=${possible_libdir0%/lib}
++          possible_prefix0_triplet=${possible_prefix0##*/}
++          if test -z "$possible_prefix0_triplet"; then
++            continue
++          fi
++          possible_libdir2=${gpgrt_prefix}/$possible_prefix0_triplet/lib
++        else
++          possible_prefix0=${possible_libdir0%%/lib*}
++          possible_libdir2=${gpgrt_prefix}${possible_libdir0#$possible_prefix0}
++        fi
++        if test -f ${possible_libdir2}/pkgconfig/gpg-error.pc; then
++          gpgrt_libdir=${possible_libdir2}
++        elif test -f ${possible_libdir1}/pkgconfig/gpg-error.pc; then
++          gpgrt_libdir=${possible_libdir1}
++        elif test -f ${possible_libdir0}/pkgconfig/gpg-error.pc; then
++          gpgrt_libdir=${possible_libdir0}
++        fi
++        if test -n "$gpgrt_libdir"; then break; fi
++      done
++      if test -z "$libdir_candidates"; then
++        # No valid pkgconfig dir in any of the system directories, fallback
++        gpgrt_libdir=${possible_libdir1}
++      fi
++    else
++      # When we cannot determine system libdir-format, use this:
++      gpgrt_libdir=${possible_libdir1}
++    fi
++  else
++    unset GPGRT_CONFIG
++  fi
++
++  if test -n "$gpgrt_libdir"; then
++    GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
++    if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
++      GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
++      AC_MSG_NOTICE([Use gpgrt-config with $gpgrt_libdir as gpg-error-config])
++      gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
++    else
++      unset GPGRT_CONFIG
++    fi
++  elif test "$GPG_ERROR_CONFIG" != "no"; then
++    gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
++    unset GPGRT_CONFIG
++  fi
++])
++
++AC_DEFUN([_AM_PATH_GPGME_CONFIG],[dnl
++AC_REQUIRE([_AM_PATH_GPGRT_CONFIG])dnl
++  AC_ARG_WITH(gpgme-prefix,
++              AS_HELP_STRING([--with-gpgme-prefix=PFX],
++                             [prefix where GPGME is installed (optional)]),
+      gpgme_config_prefix="$withval", gpgme_config_prefix="")
+   if test x"${GPGME_CONFIG}" = x ; then
+      if test x"${gpgme_config_prefix}" != x ; then
+         GPGME_CONFIG="${gpgme_config_prefix}/bin/gpgme-config"
+      else
+        case "${SYSROOT}" in
+          /*)
+-- 
+2.35.1
+
diff -Nru gpgme1.0-1.18.0/debian/patches/0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch gpgme1.0-1.18.0/debian/patches/0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch
--- gpgme1.0-1.18.0/debian/patches/0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch	1970-01-01 01:00:00.000000000 +0100
+++ gpgme1.0-1.18.0/debian/patches/0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch	2022-11-20 06:54:19.000000000 +0100
@@ -0,0 +1,210 @@
+From ae2057e6017427941aef00ccf1b7a9f6b0e3189c Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gni...@fsij.org>
+Date: Tue, 15 Nov 2022 14:25:26 +0900
+Subject: [PATCH 2/2] doc: Update documentation for gpgme.pc and pkg-config.
+
+--
+
+GnuPG-bug-id: 6274
+Signed-off-by: NIIBE Yutaka <gni...@fsij.org>
+---
+ doc/gpgme.texi | 99 ++++++++++++++++++++++++++++----------------------
+ 1 file changed, 55 insertions(+), 44 deletions(-)
+
+diff --git a/doc/gpgme.texi b/doc/gpgme.texi
+index 327a5ea1..e88bf2ac 100644
+--- a/doc/gpgme.texi
++++ b/doc/gpgme.texi
+@@ -417,63 +417,76 @@ name space indirectly.
+ If you want to compile a source file including the `gpgme.h' header
+ file, you must make sure that the compiler can find it in the
+ directory hierarchy.  This is accomplished by adding the path to the
+ directory in which the header file is located to the compilers include
+ file search path (via the @option{-I} option).
+ 
+ However, the path to the include file is determined at the time the
+-source is configured.  To solve this problem, gpgme ships with a small
+-helper program @command{gpgme-config} that knows about the path to the
+-include file and other configuration options.  The options that need
+-to be added to the compiler invocation at compile time are output by
+-the @option{--cflags} option to @command{gpgme-config}.  The following
+-example shows how it can be used at the command line:
++source is configured.  To solve this problem, gpgme ships with
++@code{gpgme.pc} file, that knows about the path to the include file
++and other configuration options.  The command, @command{pkg-config},
++can be used to handle information with @code{gpgme.pc} file.  In an
++environment which doesn't have @command{pkg-config} (like the one in
++early stage of OS bootstrap), for Automake, you can use
++@code{gpgme.m4} which invokes @command{gpgrt-config} with
++@code{gpgme.pc}.  (In the past, gpgme used to ship with a small helper
++program @command{gpgme-config}.  This functionality of
++@command{gpgme-config} is replaced by @command{pkg-config} with
++@code{gpgme.pc} file.)
++
++The options that need to be added to the compiler invocation at
++compile time are output by the @option{--cflags} option to
++@command{pkg-config gpgme}.  The following example shows how it can be
++used at the command line:
+ 
+ @example
+-gcc -c foo.c `gpgme-config --cflags`
++gcc -c foo.c `pkg-config --cflags gpgme`
+ @end example
+ 
+-Adding the output of @samp{gpgme-config --cflags} to the compiler
++Adding the output of @samp{pkg-config --cflags gpgme} to the compiler
+ command line will ensure that the compiler can find the
+ @acronym{GPGME} header file.
+ 
+ A similar problem occurs when linking the program with the library.
+ Again, the compiler has to find the library files.  For this to work,
+ the path to the library files has to be added to the library search
+ path (via the @option{-L} option).  For this, the option
+-@option{--libs} to @command{gpgme-config} can be used.  For
++@option{--libs} to @command{pkg-config gpgme} can be used.  For
+ convenience, this option also outputs all other options that are
+ required to link the program with @acronym{GPGME} (in particular, the
+ @samp{-lgpgme} option).  The example shows how to link @file{foo.o}
+ with the @acronym{GPGME} library to a program @command{foo}.
+ 
+ @example
+-gcc -o foo foo.o `gpgme-config --libs`
++gcc -o foo foo.o `pkg-config --libs gpgme`
+ @end example
+ 
+ Of course you can also combine both examples to a single command by
+-specifying both options to @command{gpgme-config}:
++specifying both options to @command{pkg-config gpgme}:
+ 
+ @example
+-gcc -o foo foo.c `gpgme-config --cflags --libs`
+-@end example
+-
+-If you need to detect the installed language bindings you can use list
+-them using:
+-
+-@example
+-gpgme-config --print-lang
+-@end example
+-
+-or test for the availability using
+-
+-@example
+-gpgme-config --have-lang=python && echo 'Bindings for Pythons available'
++gcc -o foo foo.c `pkg-config --cflags --libs gpgme`
+ @end example
+ 
++@c
++@c Feature not available by pkg-config/gpgrt-config
++@c
++@c If you need to detect the installed language bindings you can use list
++@c them using:
++@c
++@c @example
++@c gpgme-config --print-lang
++@c @end example
++@c
++@c or test for the availability using
++@c
++@c @example
++@c gpgme-config --have-lang=python && echo 'Bindings for Pythons available'
++@c @end example
++@c
+ 
+ @node Largefile Support (LFS)
+ @section Largefile Support (LFS)
+ @cindex largefile support
+ @cindex LFS
+ 
+ @acronym{GPGME} is compiled with largefile support by default, if it
+@@ -574,52 +587,51 @@ mode (@code{_LARGEFILE64_SOURCE}).
+ @node Using Automake
+ @section Using Automake
+ @cindex automake
+ @cindex autoconf
+ 
+ It is much easier if you use GNU Automake instead of writing your own
+ Makefiles.  If you do that you do not have to worry about finding and
+-invoking the @command{gpgme-config} script at all.  @acronym{GPGME}
++invoking the @command{pkg-config} script at all.  @acronym{GPGME}
+ provides an extension to Automake that does all the work for you.
+ 
+ @c A simple macro for optional variables.
+ @macro ovar{varname}
+ @r{[}@var{\varname\}@r{]}
+ @end macro
+ @defmac AM_PATH_GPGME (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
+-@defmacx AM_PATH_GPGME_PTH (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
+-@defmacx AM_PATH_GPGME_PTHREAD (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
+ Check whether @acronym{GPGME} (at least version @var{minimum-version},
+ if given) exists on the host system.  If it is found, execute
+ @var{action-if-found}, otherwise do @var{action-if-not-found}, if
+ given.
+ 
++This macro locates for @code{gpgme.pc}, with cross-compile support.
++
+ Additionally, the function defines @code{GPGME_CFLAGS} to the flags
+ needed for compilation of the program to find the @file{gpgme.h}
+ header file, and @code{GPGME_LIBS} to the linker flags needed to link
+-the program to the @acronym{GPGME} library.  If the used helper script
+-does not match the target type you are building for a warning is
+-printed and the string @code{libgcrypt} is appended to the variable
+-@code{gpg_config_script_warn}.
++the program to the @acronym{GPGME} library.
++@c
++@c If the used helper script does not match the target type you are
++@c building for a warning is printed and the string @code{gpgme} is
++@c appended to the variable @code{gpg_config_script_warn}.
++@c@c@c@c@c@c@c@c
++@c ^-- About this statement.
++@c In the past, this might happens, when it was configured by
++@c --with-*-prefix options, and it located the helper script for
++@c other target.  Cross-build by gpgrt-config has been improved
++@c (in different way), so it's not relevant now.
++@c
+ 
+ @code{AM_PATH_GPGME_PTHREAD} checks for the version of @acronym{GPGME}
+ that can be used with the native pthread implementation, and defines
+ @code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since
+ version 1.8.0 this is no longer required to GPGME_PTHREAD as
+ @acronym{GPGME} itself is thread safe.
+ 
+-This macro searches for @command{gpgme-config} along the PATH.  If
+-you are cross-compiling, it is useful to set the environment variable
+-@code{SYSROOT} to the top directory of your target.  The macro will
+-then first look for the helper program in the @file{bin} directory
+-below that top directory.  An absolute directory name must be used for
+-@code{SYSROOT}.  Finally, if the configure command line option
+-@code{--with-gpgme-prefix} is used, only its value is used for the top
+-directory below which the helper script is expected.
+-
+ @end defmac
+ 
+ You can use the defined Autoconf variables like this in your
+ @file{Makefile.am}:
+ 
+ @example
+ AM_CPPFLAGS = $(GPGME_CFLAGS)
+@@ -628,17 +640,16 @@ LDADD = $(GPGME_LIBS)
+ 
+ 
+ @node Using Libtool
+ @section Using Libtool
+ @cindex libtool
+ 
+ The easiest way is to just use GNU Libtool.  If you use libtool, and
+-link to @code{libgpgme.la}, @code{libgpgme-pth.la} or
+-@code{libgpgme-pthread.la} respectively, everything will be done
+-automatically by Libtool.
++link to @code{libgpgme.la}, everything will be done automatically by
++Libtool.
+ 
+ 
+ @node Library Version Check
+ @section Library Version Check
+ @cindex version check, of the library
+ 
+ @deftypefun {const char *} gpgme_check_version (@w{const char *@var{required_version}})
+-- 
+2.35.1
+
diff -Nru gpgme1.0-1.18.0/debian/patches/series gpgme1.0-1.18.0/debian/patches/series
--- gpgme1.0-1.18.0/debian/patches/series	2022-11-02 15:53:14.000000000 +0100
+++ gpgme1.0-1.18.0/debian/patches/series	2022-11-20 06:54:19.000000000 +0100
@@ -5,3 +5,6 @@
 0007-lang-python-tests-Fix-FTBFS-caused-by-missing-PYTHON.patch
 0010-build-python-Don-t-use-gpg-error-config-gpgme-config.patch
 0013-python-Fix-configure-generating-setup.py.patch
+0015-build-Prefer-gpgrt-config-when-available.patch
+0016-gpgme.m4-Include-_AM_PATH_GPGRT_CONFIG-implementatio.patch
+0017-doc-Update-documentation-for-gpgme.pc-and-pkg-config.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to