[gnome-keyring] pkcs11: Fix packaging issues installing the pkcs11 module
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keyring] pkcs11: Fix packaging issues installing the pkcs11 module
- Date: Thu, 15 Sep 2011 08:56:09 +0000 (UTC)
commit 84737ca00028bb73148ad5664ff31a20ec5daa6a
Author: Stef Walter <stefw collabora co uk>
Date: Thu Sep 15 10:44:50 2011 +0200
pkcs11: Fix packaging issues installing the pkcs11 module
* Packagers have problems installing the gnome-keyring-module file
because the same file (with different contents) exists on both
32-bit and 64-bit packages.
* p11-kit 0.6 fixes this by supporting relative paths for module
configuration. We use that relative path stuff here to automatically
load the appropriate (32-bit or 64-bit) from the right directory.
Discussed on the p11-glue mailing list.
configure.ac | 28 +++++++++++++++++-----------
pkcs11/rpc-layer/Makefile.am | 4 ++--
pkcs11/rpc-layer/gnome-keyring-module.in | 5 ++---
3 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0b7e639..24602f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -282,19 +282,31 @@ AC_SUBST(DL_LIBS)
# --------------------------------------------------------------------
# p11-kit
-PKG_CHECK_MODULES([P11_KIT], p11-kit-1)
+PKG_CHECK_MODULES([P11_KIT], p11-kit-1 >= 0.6)
AC_SUBST(P11_KIT_CFLAGS)
AC_SUBST(P11_KIT_LIBS)
AC_MSG_CHECKING([where to put pkcs11 module configuration])
-P11_SYSTEM_MODULES=`$PKG_CONFIG p11-kit-1 --variable=p11_system_modules`
-AC_MSG_RESULT($P11_SYSTEM_MODULES)
-AC_SUBST(P11_SYSTEM_MODULES)
+P11_SYSTEM_CONFIG_MODULES=$($PKG_CONFIG p11-kit-1 --variable=p11_system_config_modules)
+AC_MSG_RESULT($P11_SYSTEM_CONFIG_MODULES)
+AC_SUBST(P11_SYSTEM_CONFIG_MODULES)
-if "$P11_SYSTEM_MODULES" = ""; then
+if test "$P11_SYSTEM_CONFIG_MODULES" = ""; then
AC_MSG_ERROR([Could not find location for pkcs11 module config])
fi
+AC_MSG_CHECKING([default module path for pkcs11 modules])
+P11_MODULE_PATH=$($PKG_CONFIG p11-kit-1 --variable=p11_module_path)
+AC_MSG_RESULT($P11_MODULE_PATH)
+AC_SUBST(P11_MODULE_PATH)
+
+if test "$P11_MODULE_PATH" = ""; then
+ AC_MSG_ERROR([Could not find default path for pkcs11 modules])
+fi
+
+pkcs11standalonedir="${libdir}/gnome-keyring/devel"
+AC_SUBST(pkcs11standalonedir)
+
# --------------------------------------------------------------------
# PAM Module Directory
@@ -719,12 +731,6 @@ AC_SUBST(BINDIR)
eval LIBEXECDIR="$libexecdir"
AC_SUBST(LIBEXECDIR)
-eval pkcs11dir="${libdir}/pkcs11"
-AC_SUBST(pkcs11dir)
-
-pkcs11standalonedir="${libdir}/gnome-keyring/devel"
-AC_SUBST(pkcs11standalonedir)
-
AC_OUTPUT([
Makefile
daemon/Makefile
diff --git a/pkcs11/rpc-layer/Makefile.am b/pkcs11/rpc-layer/Makefile.am
index 43d20b9..2ccfe70 100644
--- a/pkcs11/rpc-layer/Makefile.am
+++ b/pkcs11/rpc-layer/Makefile.am
@@ -35,7 +35,7 @@ libgkm_rpc_layer_la_CFLAGS = \
# The module code, built as the public gnome-keyring module
# This is the location that some older software looks for modules
-moduledir = $(pkcs11dir)
+moduledir = $(P11_MODULE_PATH)
module_LTLIBRARIES = \
gnome-keyring-pkcs11.la
@@ -55,7 +55,7 @@ gnome_keyring_pkcs11_la_LDFLAGS = \
-no-undefined -export-symbols-regex 'C_GetFunctionList'
# This is the configuration file that p11-kit uses to load the module
-configdir = $(P11_SYSTEM_MODULES)
+configdir = $(P11_SYSTEM_CONFIG_MODULES)
config_DATA = \
gnome-keyring-module
diff --git a/pkcs11/rpc-layer/gnome-keyring-module.in b/pkcs11/rpc-layer/gnome-keyring-module.in
index 3e68ce5..3ee2018 100644
--- a/pkcs11/rpc-layer/gnome-keyring-module.in
+++ b/pkcs11/rpc-layer/gnome-keyring-module.in
@@ -1,7 +1,6 @@
-# This file describes how to load the gnome-keyring module
-
-module: @pkcs11dir@/gnome-keyring-pkcs11.so
+# The file is installed/loaded from the default module p11-kit directory
+module: gnome-keyring-pkcs11.so
# And where to store and lookup trust objects
x-trust-store: pkcs11:library-manufacturer=GNOME%20Keyring;serial=1:XDG:DEFAULT
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]