switched to autotools
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@103 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
0
virtualsmartcard/ChangeLog
Normal file
0
virtualsmartcard/ChangeLog
Normal file
@@ -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`.
|
|
||||||
@@ -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
|
|
||||||
2
virtualsmartcard/Makefile.am
Normal file
2
virtualsmartcard/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
SUBDIRS = src
|
||||||
0
virtualsmartcard/NEWS
Normal file
0
virtualsmartcard/NEWS
Normal file
1
virtualsmartcard/src/Makefile.am
Normal file
1
virtualsmartcard/src/Makefile.am
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SUBDIRS = vpcd vpicc
|
||||||
27
virtualsmartcard/src/vpcd/Makefile.am
Normal file
27
virtualsmartcard/src/vpcd/Makefile.am
Normal file
@@ -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)
|
||||||
4
virtualsmartcard/src/vpcd/reader.conf.in
Normal file
4
virtualsmartcard/src/vpcd/reader.conf.in
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FRIENDLYNAME "Virtual PCD"
|
||||||
|
DEVICENAME /dev/null
|
||||||
|
LIBPATH TARGET
|
||||||
|
CHANNELID 0
|
||||||
4
virtualsmartcard/src/vpicc/virtualsmartcard.in
Normal file
4
virtualsmartcard/src/vpicc/virtualsmartcard.in
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd "PYTHONDIR"
|
||||||
|
PYTHONBIN "PYTHONDIR/VirtualSmartcard.py" "$@"
|
||||||
Reference in New Issue
Block a user