[gnome-keyring/with-p11-kit: 3/4] Install a proper p11-kit module configuration file



commit 56094296ec9e44d7ea98a27c1cc876c000839c70
Author: Stef Walter <stefw collabora co uk>
Date:   Tue Apr 5 15:52:50 2011 +0200

    Install a proper p11-kit module configuration file

 .gitignore                               |    1 +
 configure.in                             |   15 +++++++++++++--
 pkcs11/rpc-layer/Makefile.am             |    7 +++++++
 pkcs11/rpc-layer/gnome-keyring-module.in |    4 ++++
 4 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1e8f090..e608ad1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -104,6 +104,7 @@ run-tests
 /gck/tests/test-gck-slot
 /gck/tests/test-gck-uri
 
+/pkcs11/rpc-layer/gnome-keyring-module
 
 /daemon/dbus/tests/test-secret-util
 
diff --git a/configure.in b/configure.in
index c204e6f..d59235e 100644
--- a/configure.in
+++ b/configure.in
@@ -312,6 +312,15 @@ PKG_CHECK_MODULES([P11_KIT], p11-kit)
 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 --variable=p11_system_modules`
+AC_MSG_RESULT($P11_SYSTEM_MODULES)
+AC_SUBST(P11_SYSTEM_MODULES)
+
+if "$P11_SYSTEM_MODULES" = ""; then
+	AC_MSG_ERROR([Could not find location for pkcs11 module config])
+fi
+
 # --------------------------------------------------------------------
 # PAM Module Directory
 
@@ -695,7 +704,7 @@ fi
 eval BINDIR="$bindir"
 AC_SUBST(BINDIR)
 
-pkcs11dir="${libdir}/pkcs11"
+eval pkcs11dir="${libdir}/pkcs11"
 AC_SUBST(pkcs11dir)
 
 pkcs11standalonedir="${libdir}/gnome-keyring/devel"
@@ -740,6 +749,7 @@ pkcs11/gnome2-store/tests/Makefile
 pkcs11/roots-store/Makefile
 pkcs11/roots-store/tests/Makefile
 pkcs11/rpc-layer/Makefile
+pkcs11/rpc-layer/gnome-keyring-module
 pkcs11/secret-store/Makefile
 pkcs11/secret-store/tests/Makefile
 pkcs11/ssh-store/Makefile
@@ -772,11 +782,12 @@ echo "  SSH Agent:            $ssh_status"
 echo "  GPG Agent:            $gpg_status"
 echo "  Root Certificates:    $root_status"
 echo "  GTK+ Version:         $GTK_API_VERSION"
+echo "  PKCS#11 Modules:      $P11_SYSTEM_MODULES"
 echo
 echo "BUILD"
 echo "  Debug Build:          $debug_status"
 echo "  Valgrind:             $valgrind_status"
-echo "  Pkcs#11 Tests         $p11_tests_status"
+echo "  PKCS#11 Tests         $p11_tests_status"
 echo "  Tests, -Werror:       $tests_status"
 echo "  Test Coverage:        $enable_gcov"
 echo
diff --git a/pkcs11/rpc-layer/Makefile.am b/pkcs11/rpc-layer/Makefile.am
index dd593fe..43d20b9 100644
--- a/pkcs11/rpc-layer/Makefile.am
+++ b/pkcs11/rpc-layer/Makefile.am
@@ -34,6 +34,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)
 
 module_LTLIBRARIES = \
@@ -53,6 +54,12 @@ gnome_keyring_pkcs11_la_LDFLAGS = \
 	-module -avoid-version \
 	-no-undefined -export-symbols-regex 'C_GetFunctionList'
 
+# This is the configuration file that p11-kit uses to load the module
+configdir = $(P11_SYSTEM_MODULES)
+
+config_DATA = \
+	gnome-keyring-module
+
 # -----------------------------------------------------------------------------
 # The test daemon
 
diff --git a/pkcs11/rpc-layer/gnome-keyring-module.in b/pkcs11/rpc-layer/gnome-keyring-module.in
new file mode 100644
index 0000000..01be1e1
--- /dev/null
+++ b/pkcs11/rpc-layer/gnome-keyring-module.in
@@ -0,0 +1,4 @@
+
+# This file describes how to load the gnome-keyring module
+
+module: @pkcs11dir@/gnome-keyring-pkcs11.so



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]