From 0b60b64cb55f8d2d54fedfa9353405a0e382c79b Mon Sep 17 00:00:00 2001 From: frankmorgner Date: Sat, 8 May 2010 20:58:58 +0000 Subject: [PATCH] switched to autotools git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@103 96b47cad-a561-4643-ad3b-153ac7d7599c --- virtualsmartcard/ChangeLog | 0 virtualsmartcard/INSTALL | 17 --- virtualsmartcard/Makefile | 114 ------------------ virtualsmartcard/Makefile.am | 2 + virtualsmartcard/NEWS | 0 virtualsmartcard/src/Makefile.am | 1 + virtualsmartcard/src/vpcd/Makefile.am | 27 +++++ virtualsmartcard/{ => src}/vpcd/ifd.c | 0 virtualsmartcard/src/vpcd/reader.conf.in | 4 + virtualsmartcard/{ => src}/vpcd/vpcd.c | 0 virtualsmartcard/{ => src}/vpcd/vpcd.h | 0 .../{ => src}/vpicc/CardGenerator.py | 0 .../{ => src}/vpicc/ConstantDefinitions.py | 0 .../{ => src}/vpicc/CryptoUtils.py | 0 virtualsmartcard/{ => src}/vpicc/SEutils.py | 0 virtualsmartcard/{ => src}/vpicc/SWutils.py | 0 .../{ => src}/vpicc/SmartcardFilesystem.py | 0 .../{ => src}/vpicc/SmartcardSAM.py | 0 virtualsmartcard/{ => src}/vpicc/TLVutils.py | 0 .../{ => src}/vpicc/VirtualSmartcard.py | 0 virtualsmartcard/{ => src}/vpicc/utils.py | 0 .../src/vpicc/virtualsmartcard.in | 4 + 22 files changed, 38 insertions(+), 131 deletions(-) create mode 100644 virtualsmartcard/ChangeLog delete mode 100644 virtualsmartcard/INSTALL delete mode 100644 virtualsmartcard/Makefile create mode 100644 virtualsmartcard/Makefile.am create mode 100644 virtualsmartcard/NEWS create mode 100644 virtualsmartcard/src/Makefile.am create mode 100644 virtualsmartcard/src/vpcd/Makefile.am rename virtualsmartcard/{ => src}/vpcd/ifd.c (100%) create mode 100644 virtualsmartcard/src/vpcd/reader.conf.in rename virtualsmartcard/{ => src}/vpcd/vpcd.c (100%) rename virtualsmartcard/{ => src}/vpcd/vpcd.h (100%) rename virtualsmartcard/{ => src}/vpicc/CardGenerator.py (100%) rename virtualsmartcard/{ => src}/vpicc/ConstantDefinitions.py (100%) rename virtualsmartcard/{ => src}/vpicc/CryptoUtils.py (100%) rename virtualsmartcard/{ => src}/vpicc/SEutils.py (100%) rename virtualsmartcard/{ => src}/vpicc/SWutils.py (100%) rename virtualsmartcard/{ => src}/vpicc/SmartcardFilesystem.py (100%) rename virtualsmartcard/{ => src}/vpicc/SmartcardSAM.py (100%) rename virtualsmartcard/{ => src}/vpicc/TLVutils.py (100%) rename virtualsmartcard/{ => src}/vpicc/VirtualSmartcard.py (100%) rename virtualsmartcard/{ => src}/vpicc/utils.py (100%) create mode 100644 virtualsmartcard/src/vpicc/virtualsmartcard.in diff --git a/virtualsmartcard/ChangeLog b/virtualsmartcard/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/virtualsmartcard/INSTALL b/virtualsmartcard/INSTALL deleted file mode 100644 index 1c4d5f2..0000000 --- a/virtualsmartcard/INSTALL +++ /dev/null @@ -1,17 +0,0 @@ -Installation is simple; type `make install`. If you want to customize the -compilation or install process, you will need to pass variables to make. - - DESTDIR prefix for installation - LIBPCSCLITE_CFLAGS compiler flags for pcsclite usage (needed if no - pkg-config is available) - python_sitelib where to install the virtual smartcard - serialdropdir where to install the virtual smartcard driver (needed - if no pkg-config is available) - -See the Makefile for more details. - -Example: - make DESTDIR=/tmp/stage install - -Note: If you want to uninstall the binary, you need to pass the same DESTDIR -to make, for example `make DESTDIR=/tmp/stage uninstall`. diff --git a/virtualsmartcard/Makefile b/virtualsmartcard/Makefile deleted file mode 100644 index 88392b8..0000000 --- a/virtualsmartcard/Makefile +++ /dev/null @@ -1,114 +0,0 @@ -MAKEFLAGS += -rR --no-print-directory - -# Directories -prefix = -exec_prefix = $(prefix) -bindir = $(exec_prefix)/bin -serialdropdir = `pkg-config libpcsclite --variable=usbdropdir`/serial -sysconfdir = $(prefix)/etc -readerconfdir = $(sysconfdir)/reader.conf.d -python_sitelib = /usr/lib/python2.5/site-packages - - -# Compiler -CC = gcc -CFLAGS = -Wall -g -LIBPCSCLITE_CFLAGS = `pkg-config --cflags --libs libpcsclite` -# use -fPIC in case of problems -SO_CFLAGS = -fpic - -# Linker -LD = ld -LDFLAGS = -G - -INSTALL = install -INSTALL_PROGRAM = $(INSTALL) -INSTALL_DATA = $(INSTALL) -m 644 - -UPDATEREADERCONF = update-reader.conf -RESTARTPCSCD = /etc/init.d/pcscd restart - - -TARGETS = libvpcd.so configuration virtualsmartcard - -# top-level rule -default: all - -all: $(TARGETS) - -ifd.o: vpcd/ifd.c - $(CC) $(SO_CFLAGS) $(CFLAGS) $(LIBPCSCLITE_CFLAGS) -c $< -o $@ - -vpcd.o: vpcd/vpcd.c vpcd/vpcd.h - $(CC) $(SO_CFLAGS) $(CFLAGS) -c $< -o $@ - -libvpcd.so: ifd.o vpcd.o - $(LD) $(LDFLAGS) $^ -o $@ -soname=$@.1 -lc - -.PHONY: virtualsmartcard -virtualsmartcard: - echo '#!/bin/sh' > virtualsmartcard - echo 'cd "$(python_sitelib)"' \ - >> virtualsmartcard - echo 'python "$(python_sitelib)/VirtualSmartcard.py" "$$@"' \ - >> virtualsmartcard - -.PHONY: configuration -configuration: - echo 'FRIENDLYNAME "Virtual PCD"' > vpcd.conf - echo 'DEVICENAME /dev/null' >> vpcd.conf - echo "LIBPATH $(serialdropdir)/libvpcd.so" >> vpcd.conf - echo 'CHANNELID 0' >> vpcd.conf - - -install: $(TARGETS) installdirs - $(INSTALL_PROGRAM) libvpcd.so $(DESTDIR)$(serialdropdir) - $(INSTALL_PROGRAM) virtualsmartcard $(DESTDIR)$(bindir) - $(INSTALL_DATA) vpcd.conf $(DESTDIR)$(readerconfdir) - $(INSTALL_DATA) vpicc/ConstantDefinitions.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/CardGenerator.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/CryptoUtils.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/SEutils.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/SmartcardFilesystem.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/SmartcardSAM.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/SWutils.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/TLVutils.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/utils.py $(DESTDIR)$(python_sitelib) - $(INSTALL_DATA) vpicc/VirtualSmartcard.py $(DESTDIR)$(python_sitelib) - -.PHONY: installdirs -installdirs: - $(INSTALL) -d $(DESTDIR)$(serialdropdir) - $(INSTALL) -d $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(readerconfdir) - $(INSTALL) -d $(DESTDIR)$(python_sitelib) - -.PHONY: install-strip -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install - -.PHONY: uninstall -uninstall: - rm -f $(DESTDIR)$(serialdropdir)/libvpcd.so - rm -f $(DESTDIR)$(bindir)/virtualsmartcard - rm -f $(DESTDIR)$(readerconfdir)/vpcd.conf - rm -f $(DESTDIR)$(python_sitelib)/ConstantDefinitions.py - rm -f $(DESTDIR)$(python_sitelib)/CryptoUtils.py - rm -f $(DESTDIR)$(python_sitelib)/SEutils.py - rm -f $(DESTDIR)$(python_sitelib)/SmartcardFilesystem.py - rm -f $(DESTDIR)$(python_sitelib)/SmartcardSAM.py - rm -f $(DESTDIR)$(python_sitelib)/SWutils.py - rm -f $(DESTDIR)$(python_sitelib)/TLVutils.py - rm -f $(DESTDIR)$(python_sitelib)/utils.py - rm -f $(DESTDIR)$(python_sitelib)/VirtualSmartcard.py - rm -f $(DESTDIR)$(python_sitelib)/testconfig.sam - rm -f $(DESTDIR)$(python_sitelib)/testconfig.mf - rm -f $(DESTDIR)$(python_sitelib)/jp2.jpg - -.PHONY: clean -clean: - rm -f libvpcd.so \ - ifd.o \ - vpcd.o \ - vpcd.conf \ - virtualsmartcard diff --git a/virtualsmartcard/Makefile.am b/virtualsmartcard/Makefile.am new file mode 100644 index 0000000..0a7b929 --- /dev/null +++ b/virtualsmartcard/Makefile.am @@ -0,0 +1,2 @@ +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = src diff --git a/virtualsmartcard/NEWS b/virtualsmartcard/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/virtualsmartcard/src/Makefile.am b/virtualsmartcard/src/Makefile.am new file mode 100644 index 0000000..0eb85ab --- /dev/null +++ b/virtualsmartcard/src/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = vpcd vpicc diff --git a/virtualsmartcard/src/vpcd/Makefile.am b/virtualsmartcard/src/vpcd/Makefile.am new file mode 100644 index 0000000..4c87a28 --- /dev/null +++ b/virtualsmartcard/src/vpcd/Makefile.am @@ -0,0 +1,27 @@ +VPCD_LIB = libvpcd.$(DYN_LIB_EXT) + +lib_LTLIBRARIES = libvpcd.la +libvpcd_la_SOURCES = ifd.c vpcd.c +libvpcd_la_LIBADD = $(PCSC_LIBS) +libvpcd_la_CFLAGS = $(PCSC_CFLAGS) + +EXTRA_DIST = reader.conf.in + +install: install_libvpcd + +install_libvpcd: libvpcd.la + $(mkinstalldirs) $(DESTDIR)$(prefix)$(serialdropdir) + cp .libs/$(VPCD_LIB) $(DESTDIR)$(prefix)$(serialdropdir)/$(VPCD_LIB).$(VERSION) + ln -fs $(VPCD_LIB).$(VERSION) $(DESTDIR)$(prefix)$(serialdropdir)/$(VPCD_LIB) + if [ -e $(DESTDIR)$(sysconfdir)/reader.conf ] ; \ + then \ + echo "Edit existing /etc/reader.conf" ; \ + else \ + $(mkinstalldirs) $(DESTDIR)$(sysconfdir) ; \ + perl -ne "s|TARGET|$(serialdropdir)/$(VPCD_LIB)| ; print" $(srcdir)/reader.conf.in > $(DESTDIR)$(sysconfdir)/reader.conf ; \ + fi + +uninstall: uninstall_libvpcd + +uninstall_libvpcd: + rm -f $(DESTDIR)$(prefix)$(serialdropdir)/$(VPCD_LIB).$(VERSION) diff --git a/virtualsmartcard/vpcd/ifd.c b/virtualsmartcard/src/vpcd/ifd.c similarity index 100% rename from virtualsmartcard/vpcd/ifd.c rename to virtualsmartcard/src/vpcd/ifd.c diff --git a/virtualsmartcard/src/vpcd/reader.conf.in b/virtualsmartcard/src/vpcd/reader.conf.in new file mode 100644 index 0000000..bf15d39 --- /dev/null +++ b/virtualsmartcard/src/vpcd/reader.conf.in @@ -0,0 +1,4 @@ +FRIENDLYNAME "Virtual PCD" +DEVICENAME /dev/null +LIBPATH TARGET +CHANNELID 0 diff --git a/virtualsmartcard/vpcd/vpcd.c b/virtualsmartcard/src/vpcd/vpcd.c similarity index 100% rename from virtualsmartcard/vpcd/vpcd.c rename to virtualsmartcard/src/vpcd/vpcd.c diff --git a/virtualsmartcard/vpcd/vpcd.h b/virtualsmartcard/src/vpcd/vpcd.h similarity index 100% rename from virtualsmartcard/vpcd/vpcd.h rename to virtualsmartcard/src/vpcd/vpcd.h diff --git a/virtualsmartcard/vpicc/CardGenerator.py b/virtualsmartcard/src/vpicc/CardGenerator.py similarity index 100% rename from virtualsmartcard/vpicc/CardGenerator.py rename to virtualsmartcard/src/vpicc/CardGenerator.py diff --git a/virtualsmartcard/vpicc/ConstantDefinitions.py b/virtualsmartcard/src/vpicc/ConstantDefinitions.py similarity index 100% rename from virtualsmartcard/vpicc/ConstantDefinitions.py rename to virtualsmartcard/src/vpicc/ConstantDefinitions.py diff --git a/virtualsmartcard/vpicc/CryptoUtils.py b/virtualsmartcard/src/vpicc/CryptoUtils.py similarity index 100% rename from virtualsmartcard/vpicc/CryptoUtils.py rename to virtualsmartcard/src/vpicc/CryptoUtils.py diff --git a/virtualsmartcard/vpicc/SEutils.py b/virtualsmartcard/src/vpicc/SEutils.py similarity index 100% rename from virtualsmartcard/vpicc/SEutils.py rename to virtualsmartcard/src/vpicc/SEutils.py diff --git a/virtualsmartcard/vpicc/SWutils.py b/virtualsmartcard/src/vpicc/SWutils.py similarity index 100% rename from virtualsmartcard/vpicc/SWutils.py rename to virtualsmartcard/src/vpicc/SWutils.py diff --git a/virtualsmartcard/vpicc/SmartcardFilesystem.py b/virtualsmartcard/src/vpicc/SmartcardFilesystem.py similarity index 100% rename from virtualsmartcard/vpicc/SmartcardFilesystem.py rename to virtualsmartcard/src/vpicc/SmartcardFilesystem.py diff --git a/virtualsmartcard/vpicc/SmartcardSAM.py b/virtualsmartcard/src/vpicc/SmartcardSAM.py similarity index 100% rename from virtualsmartcard/vpicc/SmartcardSAM.py rename to virtualsmartcard/src/vpicc/SmartcardSAM.py diff --git a/virtualsmartcard/vpicc/TLVutils.py b/virtualsmartcard/src/vpicc/TLVutils.py similarity index 100% rename from virtualsmartcard/vpicc/TLVutils.py rename to virtualsmartcard/src/vpicc/TLVutils.py diff --git a/virtualsmartcard/vpicc/VirtualSmartcard.py b/virtualsmartcard/src/vpicc/VirtualSmartcard.py similarity index 100% rename from virtualsmartcard/vpicc/VirtualSmartcard.py rename to virtualsmartcard/src/vpicc/VirtualSmartcard.py diff --git a/virtualsmartcard/vpicc/utils.py b/virtualsmartcard/src/vpicc/utils.py similarity index 100% rename from virtualsmartcard/vpicc/utils.py rename to virtualsmartcard/src/vpicc/utils.py diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard.in b/virtualsmartcard/src/vpicc/virtualsmartcard.in new file mode 100644 index 0000000..1c80d67 --- /dev/null +++ b/virtualsmartcard/src/vpicc/virtualsmartcard.in @@ -0,0 +1,4 @@ +#!/bin/sh + +cd "PYTHONDIR" +PYTHONBIN "PYTHONDIR/VirtualSmartcard.py" "$@"