On Fri, Jan 16, 2009 at 9:42 PM, Martin Paljak <mar...@paljak.pri.ee> wrote:

> not set, is profile_dir. The included patch creates a #define to get
> rid of it but I really don't get the "eval eval eval eval" thing :)
> I'm sure there is a more correct way of doing it, as currently
> pkgdatadir and full_pkgdatadir have no direct relation...

File attached as well.
Index: configure.ac
===================================================================
--- configure.ac	(revision 3621)
+++ configure.ac	(working copy)
@@ -103,6 +103,7 @@
 
 full_usrlibdir="/usr/lib${libdir##*/lib}"
 full_sysconfdir=`eval eval eval eval eval echo "${sysconfdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
+full_profiledir=`eval eval eval eval eval echo "${datarootdir}" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
 
 AC_ARG_ENABLE(
 	[strict],
@@ -583,6 +584,8 @@
 	AC_DEFINE_UNQUOTED([DEFAULT_PCSC_PROVIDER], ["${DEFAULT_PCSC_PROVIDER}"], [Default PC/SC provider])
 	AC_DEFINE([ENABLE_PCSC], [1], [Define if PC/SC is to be enabled])
 fi
+DEFAULT_PROFILE_DIR="${full_profiledir}/opensc"
+AC_DEFINE_UNQUOTED([DEFAULT_PROFILE_DIR], ["${DEFAULT_PROFILE_DIR}"], [Default PKCS#15 profile directory])
 
 dnl AM_PATH_LIBASSUAN([MINIMUM-VERSION,
 dnl                   [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
@@ -739,6 +742,7 @@
 
 PC/SC default provider:  ${DEFAULT_PCSC_PROVIDER}
 pinentry:                ${with_pinentry}
+pkcs15 profiles:         ${DEFAULT_PROFILE_DIR}
 
 Host:                    ${host}
 Compiler:                ${CC}
Index: src/pkcs15init/profile.c
===================================================================
--- src/pkcs15init/profile.c	(revision 3621)
+++ src/pkcs15init/profile.c	(working copy)
@@ -300,9 +300,9 @@
 	}
 
 	if (!profile_dir) {
-		sc_error(ctx, "you need to set profile_dir in your config file.");
-		return SC_ERROR_FILE_NOT_FOUND;
-	 }
+		sc_debug(ctx, "Using default profile directory %s", DEFAULT_PROFILE_DIR);		
+		profile_dir = DEFAULT_PROFILE_DIR;
+	}
 
 #ifdef _WIN32
 	snprintf(path, sizeof(path), "%s\\%s.%s",
Index: etc/opensc.conf.in
===================================================================
--- etc/opensc.conf.in	(revision 3621)
+++ etc/opensc.conf.in	(working copy)
@@ -32,8 +32,9 @@
 
 	# PKCS#15 initialization / personalization
 	# profiles directory for pkcs15-init.
-	
-	profile_dir = @pkgdatadir@;
+	# Default: @pkgdatadir@
+	#
+	# profile_dir = /etc/pkcs15profiles;
 
 	# What reader drivers to load at start-up
 	#
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to