Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaussel committed May 17, 2007
0 parents commit 95778bc
Show file tree
Hide file tree
Showing 140 changed files with 18,577 additions and 0 deletions.
457 changes: 457 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
include LICENSE
include MANIFEST.in
include README
include smartcard/ACKS
include smartcard/ChangeLog
include smartcard/LICENSE
include smartcard/README
include smartcard/TODO
include smartcard/scard/gemalto.ver
include smartcard/scard/helpers.c
include smartcard/scard/helpers.h
include smartcard/scard/memlog.h
include smartcard/scard/PcscDefs.i
include smartcard/scard/PcscTypemaps.i
include smartcard/scard/scard.def
include smartcard/scard/scard.i
include smartcard/scard/scard.rc
include smartcard/scard/winscarddll.c
include smartcard/scard/winscarddll.h
recursive-include smartcard/wx *.ico
recursive-include smartcard/Examples *.txt *.py *.ico
include smartcard/test/configcheck.py
recursive-include smartcard/test/framework *.txt *.py
recursive-include smartcard/test/frameworkpcsc *.txt *.py
recursive-include smartcard/test/scard *.txt *.py
recursive-include smartcard/doc *.html *.jpg *.css *.js *.png *.txt



18 changes: 18 additions & 0 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Metadata-Version: 1.0
Name: pyscard
Version: 1.6.0
Summary: Smartcard module for Python.
Home-page: http://www.gemalto.com
Author: Jean-Daniel Aussel
Author-email: [email protected]
License: GNU LESSER GENERAL PUBLIC LICENSE
Download-URL: http://www.gemalto.com/pyscard-1.6.0.zip
Description: Smartcard package for Python
Platform: linux
Platform: win32
Classifier: Development Status :: 1.6.0 - Release
Classifier: License :: GNU LESSER GENERAL PUBLIC LICENSE
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Unix
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Security :: Smartcards
207 changes: 207 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
-------------------------------------------------------------------------------
pyscard smartcard library for python
-------------------------------------------------------------------------------
http://pyscard.sourceforge.net/
-------------------------------------------------------------------------------

Copyright 2001-2007 gemalto
Author: Jean-Daniel Aussel, mailto:[email protected]

This file is part of pyscard.

pyscard is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option) any
later version.

pyscard is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with pyscard; if not, write to the Free Software Foundation, Inc., 51
Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

-------------------------------------------------------------------------------
Last update : pyscard 1.6.0 (May 2007)
-------------------------------------------------------------------------------

pyscard is a python module adding smart cards support to python.

It consists of the smartcard.scard module, an extension module wrapping Windows
smart card base components (also known as PCSC) on Windows, and PCSC lite on
linux, and of the smartcard module, a python framework hiding PCSC complexity.


-------------------------------------------------------------------------------
Documentation
-------------------------------------------------------------------------------

All documentation is provided in the smartcard/doc directory of the source
distribution. Examples are provided in the smartcard/Examples directory of the
source distribution. The binary distribution does not include any
documentation, tests scripts or examples.


-------------------------------------------------------------------------------
Installation
-------------------------------------------------------------------------------

The pyscard library is packaged using the standard distutils python module.

Installation on windows
-----------------------

Installing on windows from the binary distribution
--------------------------------------------------

1. download the binary msi installer or self-executable installer
2. execute the installer

The binary msi installer and self-executable installer are packaged for a
specific version of python, and have name similar to
pyscard-1.6.0.win32-py2.5.msi and pyscard-1.6.0.win32-py2.5.exe for
python 2.5.


Installing on windows from the source distribution
---------------------------------------------------

1. you will need swig 1.3.31 from http://www.swig.org, and a C compiler.

By default, Visual Studio 2003 is required for building the c language wrapper
for python 2.5, and Visual Studio .Net or VisualC++ 6 for python 2.4. You might
use another release by fiddling with the python/Lib/distutils/msvccompiler.py
file that detects the compiler.

2. download the source distribution

The source distribution is available as pyscard-1.6.0.zip for windows,
and pyscard-1.6.0.tar.gz for linux.

3. unzip the source distribution, open a console and type the following:

setup.py build_ext install

This will build pyscard and install it in the site-packages directory of
your python distribution, e.g. c:\python25\Lib\site-packages\smartcard.

This install procedure does not install the documentation, examples or test
files.

Installation on linux:
----------------------

Installing on linux from the binary distribution:
-------------------------------------------------

1. download the binary distribution

The binary distribution is either an archive file or a rpm file, with
names similar to pyscard-1.6.0-1.i386.rpm for the rpm distribution,
or pyscard-1.6.0.linux-i686.tar.gz for the archive distribution.

2. untar the binary distribution

With root privilege from a terminal, extract the archive from /, or
install the rpm.

Installing on linux from the source distribution
------------------------------------------------

1. you will need gcc, swig 1.3.31 (http://www.swig.org), and pcsc-lite
(http://pcsclite.alioth.debian.org/)

2. download the source distribution

The source distribution is available as pyscard-1.6.0.zip or
pyscard-1.6.0.tar.gz.

3. untar the source distribution

4. from a terminal with root privileges, type the following:

/usr/bin/python setup.py build_ext install

This will build pyscard and install it in the site-packages directory of
your python distribution, e.g. /usr/lib/python2.4/site-packages/smartcard.


-------------------------------------------------------------------------------
Developer documentation, unit tests and examples
-------------------------------------------------------------------------------
The developer documentation is in the smartcard/doc directory of the source
distribution.

Examples are located in the smartcard/Examples directory, and the pyunit unit
tests in the smartcard/test directory.

-------------------------------------------------------------------------------
Build instructions for packagers
-------------------------------------------------------------------------------

Building a binary distribution for Windows
------------------------------------------

To build a binary distribution from the source distribution, you will need a C
compiler and swig 1.3.31 (same requirements as for installing from the source
distribution).

In the root directory of the source distribution, execute the following command
in a console:

setup.py build_ext bdist_msi
setup.py build_ext bdist_wininst

This will build the msi installer and self-executable installer in the dist
directory, with names similar to pyscard-1.6.0.win32-py2.5.msi and
pyscard-1.6.0.win32-py2.5.exe for python 2.5, and
pyscard-1.6.0.win32-py2.4.msi and pyscard-1.6.0.win32-py2.4.exe for
python 2.4.

Building a binary distribution for linux
----------------------------------------

To build a binary distribution from the source distribution, you will need
gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the
source distribution).

In the root directory of the source distribution, execute the following
command in a terminal:

/usr/bin/python setup.py build_ext bdist

This will build a package similar to pyscard-1.6.0.linux-i686.tar.gz
containing a tree

Building a rpm distribution for linux
----------------------------------------

To build a rpm distribution from the source distribution, you will need
gcc, swig 1.3.31 and pcsc-lite (same requirements as for installing from the
source distribution).

In the root directory of the source distribution, execute the following
command in a terminal:

/usr/bin/python setup.py build bdist_rpm

If you have rpm 4.1 or above, you will need to add the
%_unpackaged_files_terminate_build 0 options to the /etc/rpm/macros file,
e.g.:

echo "%_unpackaged_files_terminate_build 0" >> /etc/rpm/macros

This will build in the dist directory a binary distribution with a name
similar to pyscard-1.6.0-1.i386.rpm.


-------------------------------------------------------------------------------
Issue Tracking
-------------------------------------------------------------------------------
If you encounter a bug, please report it in the SourceForge bug tracker at
http://sourceforge.net/tracker/?group_id=196342&atid=957072
https://sourceforge.net/tracker/?group_id=196342&atid=957072


-jda
119 changes: 119 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
#! /usr/bin/env python
"""Setup file for distutils
__author__ = "http://www.gemalto.com"
Copyright 2001-2007 gemalto
Author: Jean-Daniel Aussel, mailto:[email protected]
This file is part of pyscard.
pyscard is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
pyscard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with pyscard; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""

from distutils import core
from distutils.core import Extension
from distutils.util import get_platform
from distutils.command.build_ext import build_ext
import glob, os, sys

if sys.version[0:1] == '1':
raise RuntimeError, ("pyscard requires Python 2.x to build.")

if 'win32'==get_platform():
platform__cc_defines=[('WIN32', '100')]
platform_swig_opts=['-DWIN32']
platform_sources=['smartcard/scard/scard.rc']
platform_libraries=['winscard']
platform_include_dirs=[]
platform_extra_compile_args=[]
platform_extra_link_args=[]
elif 'linux-i586'==get_platform() or 'linux-i686'==get_platform():
platform__cc_defines=[('PCSCLITE', '1')]
platform_swig_opts=['-DPCSCLITE']
platform_sources=[]
platform_libraries=['pcsclite']
platform_include_dirs=['/usr/include/PCSC']
platform_extra_compile_args=[]#['-ggdb', '-O0']
platform_extra_link_args=[]#['-ggdb']
else:
platform_cc_defines=[]
platform_sources=[]
platform_swig_opts=[]
platform_libraries=[]
platform_include_dirs=[]
platform_extra_compile_args=[]
platform_extra_link_args=[]


kw = {'name':"pyscard",
'version':"1.6.0",
'description':"Smartcard module for Python.",
'author':"Jean-Daniel Aussel",
'author_email':"[email protected]",
'url':"http://www.gemalto.com",
'long_description':'Smartcard package for Python',
'license':'GNU LESSER GENERAL PUBLIC LICENSE',
'platforms':['linux','win32'],
'packages' : [ "smartcard",
"smartcard/pcsc",
"smartcard/reader",
"smartcard/scard",
"smartcard/sw",
"smartcard/util",
"smartcard/wx",
],
'package_dir' : { "":"." },
'package_data' : {
"smartcard" : [
"ACKS",
"ChangeLog",
"LICENSE",
"README",
"TODO",
],
"smartcard/wx" : ["resources/*.ico"],
} ,

# the _scard.pyd extension to build
'ext_modules':[Extension("smartcard.scard._scard",
define_macros=platform__cc_defines,
include_dirs=['smartcard/scard/']+platform_include_dirs,
sources=["smartcard/scard/helpers.c",
"smartcard/scard/winscarddll.c",
"smartcard/scard/scard.i"]+platform_sources,
libraries=platform_libraries,
extra_compile_args=platform_extra_compile_args,
extra_link_args=platform_extra_link_args,
swig_opts=['-outdir','smartcard/scard']+platform_swig_opts)],
}

# If we're running >Python 2.3, add extra information
if hasattr(core, 'setup_keywords'):
if 'classifiers' in core.setup_keywords:
kw['classifiers'] = [
'Development Status :: 1.6.0 - Release',
'License :: GNU LESSER GENERAL PUBLIC LICENSE',
'Intended Audience :: Developers',
'Operating System :: Unix',
'Operating System :: Microsoft :: Windows',
'Topic :: Security :: Smartcards',
]
if 'download_url' in core.setup_keywords:
kw['download_url'] = ('http://www.gemalto.com/'
'%s-%s.zip' % (kw['name'], kw['version']) )

core.setup(**kw)

14 changes: 14 additions & 0 deletions smartcard/ACKS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Acknowledgements
----------------

This list is sorted in alphabetical order, and is probably incomplete.
I'd like to thank everybody who contributed in any way, with code, bug
reports, and comments.

-jda

Michel Beziat
Antonio Aranda
Nodir Gylianov
Luc Duche

Loading

0 comments on commit 95778bc

Please sign in to comment.