From 04efb3588e4a53b1cf4d954967f72afce3e89a1d Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Tue, 25 Jun 2013 01:44:10 +0200 Subject: [PATCH] use libpcsclite.pc's new serialconfdir --- virtualsmartcard/configure.ac | 31 +++++++++++++++++++-------- virtualsmartcard/src/vpcd/Makefile.am | 6 +++--- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/virtualsmartcard/configure.ac b/virtualsmartcard/configure.ac index ccfa68e..376bde4 100644 --- a/virtualsmartcard/configure.ac +++ b/virtualsmartcard/configure.ac @@ -61,12 +61,12 @@ AC_ARG_ENABLE(serialdropdir, [serialdropdir="${enableval}"], [serialdropdir=false]) if test "${serialdropdir}" = false ; then if test "${prefix}" = NONE ; then - serialdropdir=`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial + serialdropdir="`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial" if test "${serialdropdir}" = "/serial" ; then AC_MSG_ERROR([use --enable-serialdropdir=DIR]) fi else - serialdropdir=${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial + serialdropdir="${prefix}`$PKG_CONFIG libpcsclite --variable=usbdropdir`/serial" if test "${serialdropdir}" = "${prefix}/serial" ; then AC_MSG_ERROR([use --enable-serialdropdir=DIR]) fi @@ -74,11 +74,24 @@ if test "${serialdropdir}" = false ; then fi -# --enable-confdir=DIR -AC_ARG_ENABLE(confdir, - AC_HELP_STRING([--enable-confdir=DIR],[directory to install the - vpcd configuration (default to pcscd config or /etc/reader.conf.d)]), - [confdir="${enableval}"], [confdir=/etc/reader.conf.d]) +# --enable-serialconfdir=DIR +AC_ARG_ENABLE(serialconfdir, + AC_HELP_STRING([--enable-serialconfdir=DIR],[directory to install the + serial wrapper driver (default to pcscd config or /etc/reader.conf.d)]), + [serialconfdir="${enableval}"], [serialconfdir=false]) +if test "${serialconfdir}" = false ; then + if test "${prefix}" = NONE ; then + serialconfdir="`$PKG_CONFIG libpcsclite --variable=serialconfdir`" + if test "${serialconfdir}" = "" ; then + serialconfdir="/etc/reader.conf.d" + fi + else + serialconfdir="${prefix}`$PKG_CONFIG libpcsclite --variable=serialconfdir`" + if test "${serialconfdir}" = "${prefix}" ; then + serialconfdir="${prefix}/etc/reader.conf.d" + fi + fi +fi PACKAGE_SUMMARY="Smart card emulator written in Python" @@ -101,7 +114,7 @@ AC_SUBST(BUNDLE_HOST) AC_SUBST(DYN_LIB_EXT) AC_SUBST(LIB_PREFIX) AC_SUBST(serialdropdir) -AC_SUBST(confdir) +AC_SUBST(serialconfdir) case "$host" in *-*-darwin*) BUNDLE_HOST="MacOS" @@ -145,7 +158,7 @@ ${PACKAGE} has been configured with following options: Version: ${PACKAGE_VERSION} User binaries: $(eval eval eval echo "${bindir}") -PC/SC configuration: ${confdir} +PC/SC configuration: ${serialconfdir} Python site-packages: $(eval eval eval echo "${pythondir}") Driver directory: ${serialdropdir} diff --git a/virtualsmartcard/src/vpcd/Makefile.am b/virtualsmartcard/src/vpcd/Makefile.am index 8554dde..d8d862c 100644 --- a/virtualsmartcard/src/vpcd/Makefile.am +++ b/virtualsmartcard/src/vpcd/Makefile.am @@ -21,8 +21,8 @@ install_libvpcd: libvpcd.la reader.conf.in $(LIBTOOL) --mode=install cp .libs/$(VPCD_LIB) $(DESTDIR)$(serialdropdir)/$(VPCD_LIB).$(VERSION) (cd $(DESTDIR)$(serialdropdir) && \ $(LN_S) -f $(VPCD_LIB).$(VERSION) $(VPCD_LIB)) - $(mkinstalldirs) $(DESTDIR)$(confdir) - $(do_subst) < $(srcdir)/reader.conf.in > $(DESTDIR)$(confdir)/vpcd + $(mkinstalldirs) $(DESTDIR)$(serialconfdir) + $(do_subst) < $(srcdir)/reader.conf.in > $(DESTDIR)$(serialconfdir)/vpcd uninstall: uninstall_libvpcd @@ -30,4 +30,4 @@ uninstall: uninstall_libvpcd uninstall_libvpcd: rm -f $(DESTDIR)$(serialdropdir)/$(VPCD_LIB).$(VERSION) \ $(DESTDIR)$(serialdropdir)/$(VPCD_LIB) \ - $(DESTDIR)$(confdir)/vpcd + $(DESTDIR)$(serialconfdir)/vpcd