| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
from distutils.core import setup, Extension |
|---|
| 7 |
from sys import version_info as pyver |
|---|
| 8 |
from os import path |
|---|
| 9 |
import platform |
|---|
| 10 |
|
|---|
| 11 |
description = '''A complete PKCS#11 wrapper for Python. |
|---|
| 12 |
You can use any PKCS#11 (aka CryptoKi) module such as the PSM which comes |
|---|
| 13 |
as part of mozilla or the various modules supplied by vendors of hardware |
|---|
| 14 |
crypto tokens, and almost all PKCS#11 functions and data types. The wrapper |
|---|
| 15 |
has been generated with the help of the SWIG compiler.''' |
|---|
| 16 |
|
|---|
| 17 |
classifiers = ["Development Status :: 5 - Production/Stable", |
|---|
| 18 |
"Intended Audience :: Developers", |
|---|
| 19 |
"License :: OSI Approved :: GNU General Public License (GPL)", |
|---|
| 20 |
"Natural Language :: English", |
|---|
| 21 |
"Operating System :: Microsoft :: Windows", |
|---|
| 22 |
"Operating System :: OS Independent", |
|---|
| 23 |
"Operating System :: Unix", |
|---|
| 24 |
"Programming Language :: C", |
|---|
| 25 |
"Programming Language :: C++", |
|---|
| 26 |
"Programming Language :: Python", |
|---|
| 27 |
"Topic :: Security :: Cryptography", |
|---|
| 28 |
"Topic :: Software Development :: Libraries :: Python Modules"] |
|---|
| 29 |
|
|---|
| 30 |
lib_dirs = [] |
|---|
| 31 |
inc_dirs = ["src"] |
|---|
| 32 |
|
|---|
| 33 |
if path.exists("/usr/local"): |
|---|
| 34 |
lib_dirs.append("/usr/local/lib") |
|---|
| 35 |
inc_dirs.append("/usr/local/include") |
|---|
| 36 |
source_files = ["src/ck_attribute_smart.cpp", |
|---|
| 37 |
"src/pkcs11lib.cpp", |
|---|
| 38 |
"src/pykcs11string.cpp", |
|---|
| 39 |
"src/utility.cpp", |
|---|
| 40 |
"src/pykcs11.cpp"] |
|---|
| 41 |
define_macros = [] |
|---|
| 42 |
extra_compile_args =[] |
|---|
| 43 |
extra_link_args = [] |
|---|
| 44 |
if (platform.system().lower() == 'windows'): |
|---|
| 45 |
source_files.append("src/dyn_win32.c") |
|---|
| 46 |
source_files.append("pykcs11.rc") |
|---|
| 47 |
source_files.append("src/win32_pykcs11_wrap.cpp") |
|---|
| 48 |
libraries_val = ["python%d%d" % pyver[:2]] |
|---|
| 49 |
extra_compile_args = ["/Fdvc70.pdb", "/Zi", "/GR"] |
|---|
| 50 |
extra_link_args = ["/DEBUG", "/PDB:_LowLevel.pdb", "/SUBSYSTEM:WINDOWS", "/OPT:REF", "/OPT:ICF"] |
|---|
| 51 |
else: |
|---|
| 52 |
source_files.append("src/dyn_unix.c") |
|---|
| 53 |
source_files.append("src/unix_pykcs11_wrap.cpp") |
|---|
| 54 |
libraries_val = ["python%d.%d" % pyver[:2]] |
|---|
| 55 |
|
|---|
| 56 |
setup(name="PyKCS11", |
|---|
| 57 |
version="1.2.0", |
|---|
| 58 |
description="A Full PKCS#11 wrapper for Pyton", |
|---|
| 59 |
keywords="crypto,pki,pkcs11,c++", |
|---|
| 60 |
classifiers=classifiers, |
|---|
| 61 |
platforms="Win32 Unix", |
|---|
| 62 |
long_description=description, |
|---|
| 63 |
author="Giuseppe Amato (Midori)", |
|---|
| 64 |
author_email="paipai at tiscali.it", |
|---|
| 65 |
url="http://www.bit4id.org/trac/pykcs11", |
|---|
| 66 |
download_url="http://www.bit4id.org/trac/pykcs11/wiki/Download", |
|---|
| 67 |
license="GPL", |
|---|
| 68 |
ext_modules=[ |
|---|
| 69 |
Extension( |
|---|
| 70 |
"PyKCS11._LowLevel", |
|---|
| 71 |
sources=source_files, |
|---|
| 72 |
include_dirs = inc_dirs, |
|---|
| 73 |
library_dirs = lib_dirs, |
|---|
| 74 |
libraries = libraries_val, |
|---|
| 75 |
define_macros = define_macros, |
|---|
| 76 |
extra_compile_args = extra_compile_args, |
|---|
| 77 |
extra_link_args = extra_link_args |
|---|
| 78 |
) |
|---|
| 79 |
], |
|---|
| 80 |
py_modules=["PyKCS11.__init__", "PyKCS11.LowLevel"], |
|---|
| 81 |
) |
|---|
| 82 |
|
|---|