summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-24 18:40:58 +0200
committerDan McGee <dan@archlinux.org>2011-04-27 23:58:58 +0200
commit97be2f0e0a0daad2f9058377c7dbee62cc7a8718 (patch)
tree74e836f26a77219db43237e5a082af8f243fbaa6 /lib/libalpm
parentb7b3fc23869475d3d1729de802935b98594d1677 (diff)
downloadpacman-97be2f0e0a0daad2f9058377c7dbee62cc7a8718.tar.gz
pacman-97be2f0e0a0daad2f9058377c7dbee62cc7a8718.tar.xz
Allow conditional compilation with GPGME
This makes it possible to omit usage of -lgpgme, just as we can do for -lcurl and -lcrypto. Thanks to Rémy Oudompheng for an initial stab at this. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/Makefile.am6
-rw-r--r--lib/libalpm/signing.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
index 080ac195..b2b6d0d2 100644
--- a/lib/libalpm/Makefile.am
+++ b/lib/libalpm/Makefile.am
@@ -25,7 +25,6 @@ libalpm_la_SOURCES = \
alpm.h alpm.c \
alpm_list.h alpm_list.c \
backup.h backup.c \
- base64.h base64.c \
be_local.c \
be_package.c \
be_sync.c \
@@ -54,6 +53,11 @@ libalpm_la_SOURCES += \
md5.h md5.c
endif
+if HAVE_LIBGPGME
+libalpm_la_SOURCES += \
+ base64.h base64.c
+endif
+
libalpm_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION_INFO) @LIBCURL@
libalpm_la_LIBADD = $(LTLIBINTL)
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 867e0a58..a2a6457a 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -22,17 +22,21 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+
+#if HAVE_LIBGPGME
#include <locale.h> /* setlocale() */
#include <gpgme.h>
+#include "base64.h"
+#endif
/* libalpm */
#include "signing.h"
#include "package.h"
-#include "base64.h"
#include "util.h"
#include "log.h"
#include "alpm.h"
+#if HAVE_LIBGPGME
#define CHECK_ERR(void) do { \
if(err != GPG_ERR_NO_ERROR) { goto error; } \
} while(0)
@@ -364,6 +368,12 @@ error:
}
return ret;
}
+#else
+int _alpm_gpgme_checksig(const char *path, const char *base64_sig)
+{
+ return -1;
+}
+#endif
/**
* Determines the necessity of checking for a valid PGP signature