Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Denied |
| 2 | |
| 3 | Add pkgconfig support to libksba. |
| 4 | This patch is rejected by upstream for the reason below: |
| 5 | They think pkgconfig adds no portability and maintaining them is not worthwhile. |
| 6 | |
| 7 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 8 | |
| 9 | Index: libksba-1.3.0/Makefile.am |
| 10 | =================================================================== |
| 11 | --- libksba-1.3.0.orig/Makefile.am 2014-05-13 21:39:22.390385646 +0000 |
| 12 | +++ libksba-1.3.0/Makefile.am 2014-05-13 21:39:22.462385646 +0000 |
| 13 | @@ -21,6 +21,9 @@ |
| 14 | ACLOCAL_AMFLAGS = -I m4 -I gl/m4 |
| 15 | AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip |
| 16 | |
| 17 | +pkgconfigdir = ${libdir}/pkgconfig |
| 18 | +pkgconfig_DATA = ksba.pc |
| 19 | + |
| 20 | # (A suitable gitlog-to-changelog script can be found in GnuPG master.) |
| 21 | GITLOG_TO_CHANGELOG=gitlog-to-changelog |
| 22 | |
| 23 | Index: libksba-1.3.0/configure.ac |
| 24 | =================================================================== |
| 25 | --- libksba-1.3.0.orig/configure.ac 2014-05-13 21:39:22.390385646 +0000 |
| 26 | +++ libksba-1.3.0/configure.ac 2014-05-13 21:39:22.462385646 +0000 |
| 27 | @@ -400,6 +400,7 @@ |
| 28 | src/Makefile |
| 29 | src/ksba-config |
| 30 | src/versioninfo.rc |
| 31 | +ksba.pc |
| 32 | tests/Makefile |
| 33 | doc/Makefile |
| 34 | ]) |
| 35 | Index: libksba-1.3.0/ksba.pc.in |
| 36 | =================================================================== |
| 37 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
| 38 | +++ libksba-1.3.0/ksba.pc.in 2014-05-13 21:39:22.462385646 +0000 |
| 39 | @@ -0,0 +1,17 @@ |
| 40 | +prefix=@prefix@ |
| 41 | +exec_prefix=@exec_prefix@ |
| 42 | +libdir=@libdir@ |
| 43 | +includedir=@includedir@ |
| 44 | + |
| 45 | +# API info |
| 46 | +api_version=@KSBA_CONFIG_API_VERSION@ |
| 47 | +host=@KSBA_CONFIG_HOST@ |
| 48 | + |
| 49 | +Name: ksba |
| 50 | +Description: Libksba provides an easy API to create and parse X.509 and CMS related objects |
| 51 | +Requires: |
| 52 | +Version: @VERSION@ |
| 53 | +Libs: -L${libdir} -lksba |
| 54 | +Libs.private: -L{libdir} -lgpg-error |
| 55 | +Cflags: -I${includedir} |
| 56 | + |
| 57 | Index: libksba-1.3.0/src/ksba.m4 |
| 58 | =================================================================== |
| 59 | --- libksba-1.3.0.orig/src/ksba.m4 2014-05-13 21:39:22.390385646 +0000 |
| 60 | +++ libksba-1.3.0/src/ksba.m4 2014-05-13 21:49:03.650382696 +0000 |
| 61 | @@ -22,18 +22,7 @@ |
| 62 | dnl |
| 63 | AC_DEFUN([AM_PATH_KSBA], |
| 64 | [AC_REQUIRE([AC_CANONICAL_HOST]) |
| 65 | - AC_ARG_WITH(ksba-prefix, |
| 66 | - AC_HELP_STRING([--with-ksba-prefix=PFX], |
| 67 | - [prefix where KSBA is installed (optional)]), |
| 68 | - ksba_config_prefix="$withval", ksba_config_prefix="") |
| 69 | - if test x$ksba_config_prefix != x ; then |
| 70 | - ksba_config_args="$ksba_config_args --prefix=$ksba_config_prefix" |
| 71 | - if test x${KSBA_CONFIG+set} != xset ; then |
| 72 | - KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config |
| 73 | - fi |
| 74 | - fi |
| 75 | |
| 76 | - AC_PATH_PROG(KSBA_CONFIG, ksba-config, no) |
| 77 | tmp=ifelse([$1], ,1:1.0.0,$1) |
| 78 | if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then |
| 79 | req_ksba_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` |
| 80 | @@ -43,48 +32,13 @@ |
| 81 | min_ksba_version="$tmp" |
| 82 | fi |
| 83 | |
| 84 | - AC_MSG_CHECKING(for KSBA - version >= $min_ksba_version) |
| 85 | - ok=no |
| 86 | - if test "$KSBA_CONFIG" != "no" ; then |
| 87 | - req_major=`echo $min_ksba_version | \ |
| 88 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` |
| 89 | - req_minor=`echo $min_ksba_version | \ |
| 90 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` |
| 91 | - req_micro=`echo $min_ksba_version | \ |
| 92 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` |
| 93 | - ksba_config_version=`$KSBA_CONFIG $ksba_config_args --version` |
| 94 | - major=`echo $ksba_config_version | \ |
| 95 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` |
| 96 | - minor=`echo $ksba_config_version | \ |
| 97 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` |
| 98 | - micro=`echo $ksba_config_version | \ |
| 99 | - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` |
| 100 | - if test "$major" -gt "$req_major"; then |
| 101 | - ok=yes |
| 102 | - else |
| 103 | - if test "$major" -eq "$req_major"; then |
| 104 | - if test "$minor" -gt "$req_minor"; then |
| 105 | - ok=yes |
| 106 | - else |
| 107 | - if test "$minor" -eq "$req_minor"; then |
| 108 | - if test "$micro" -ge "$req_micro"; then |
| 109 | - ok=yes |
| 110 | - fi |
| 111 | - fi |
| 112 | - fi |
| 113 | - fi |
| 114 | - fi |
| 115 | - fi |
| 116 | - if test $ok = yes; then |
| 117 | - AC_MSG_RESULT([yes ($ksba_config_version)]) |
| 118 | - else |
| 119 | - AC_MSG_RESULT(no) |
| 120 | - fi |
| 121 | + PKG_CHECK_MODULES(KSBA, [ksba >= $min_ksba_version], [ok=yes], [ok=no]) |
| 122 | + |
| 123 | if test $ok = yes; then |
| 124 | # Even if we have a recent libksba, we should check that the |
| 125 | # API is compatible. |
| 126 | if test "$req_ksba_api" -gt 0 ; then |
| 127 | - tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0` |
| 128 | + tmp=`$PKG_CONFIG --variable=api_version ksba` |
| 129 | if test "$tmp" -gt 0 ; then |
| 130 | AC_MSG_CHECKING([KSBA API version]) |
| 131 | if test "$req_ksba_api" -eq "$tmp" ; then |
| 132 | @@ -97,10 +51,8 @@ |
| 133 | fi |
| 134 | fi |
| 135 | if test $ok = yes; then |
| 136 | - KSBA_CFLAGS=`$KSBA_CONFIG $ksba_config_args --cflags` |
| 137 | - KSBA_LIBS=`$KSBA_CONFIG $ksba_config_args --libs` |
| 138 | ifelse([$2], , :, [$2]) |
| 139 | - libksba_config_host=`$LIBKSBA_CONFIG $ksba_config_args --host 2>/dev/null || echo none` |
| 140 | + libksba_config_host=`$PKG_CONFIG --variable=host ksba` |
| 141 | if test x"$libksba_config_host" != xnone ; then |
| 142 | if test x"$libksba_config_host" != x"$host" ; then |
| 143 | AC_MSG_WARN([[ |
| 144 | @@ -114,8 +66,6 @@ |
| 145 | fi |
| 146 | fi |
| 147 | else |
| 148 | - KSBA_CFLAGS="" |
| 149 | - KSBA_LIBS="" |
| 150 | ifelse([$3], , :, [$3]) |
| 151 | fi |
| 152 | AC_SUBST(KSBA_CFLAGS) |