Skip to content

Commit 6b79d08

Browse files
committed
ADD: Add pyGlobalPlatform to pypi.
1 parent 4448f0c commit 6b79d08

File tree

14 files changed

+423
-278
lines changed

14 files changed

+423
-278
lines changed

pyGlobalPlatform/MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Include the license file
2+
include LICENSE.txt
3+
4+
# Include the data files
5+
recursive-include data *
6+
7+
# If using Python 2.6 or less, then have to include package data, even though
8+
# it's already declared in setup.py
9+
# include sample/*.dat
10+
include src/*.h

pyGlobalPlatform/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A free opensource globalplatform library for java card and smartcard.
2+
pyGlobalPlatform is an open source python globalplatform client library. It depends on the GlobalPlatform project. Using this library, you can use all features of GlobalPlatform project via Python programming language.

pyGlobalPlatform/pyGlobalPlatform/__init__.py

Whitespace-only changes.
File renamed without changes.

pyGlobalPlatform/setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[bdist_wheel]
2+
# This flag says that the code is written to work on both Python 2 and Python
3+
# 3. If at all possible, it is good practice to do this. If you cannot, you
4+
# will need to generate wheels for each Python version that you support.
5+
universal=1

pyGlobalPlatform/setup.py

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
"""A setuptools based setup module.
2+
3+
See:
4+
https://packaging.python.org/en/latest/distributing.html
5+
https://github.com/pypa/sampleproject
6+
"""
7+
8+
# Always prefer setuptools over distutils
9+
from setuptools import setup, find_packages
10+
# To use a consistent encoding
11+
from codecs import open
12+
from os import path, environ
13+
from distutils.extension import Extension
14+
from distutils.util import get_platform, check_environ
15+
16+
here = path.abspath(path.dirname(__file__))
17+
18+
# Get the long description from the README file
19+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
20+
long_description = f.read()
21+
description = 'A free opensource globalplatform library for java card and smartcard.'
22+
23+
24+
include_dirs = []
25+
define_macros = []
26+
library_dirs = []
27+
28+
if 'win32' == get_platform():
29+
gp_include_dir = ''
30+
gp_library_dir = ''
31+
32+
import sys
33+
if 'install' in sys.argv:
34+
if environ.has_key('GLOBALPLATFORM_ROOT'):
35+
gp_include_dir = environ['GLOBALPLATFORM_ROOT']
36+
gp_library_dir = environ['GLOBALPLATFORM_ROOT']
37+
else:
38+
print 'Please set system environ variable GLOBALPLATFORM_ROOT first!'
39+
exit(-1)
40+
41+
include_dirs = [gp_include_dir, ]
42+
define_macros = [('_WIN32', 1), ('WIN32', 1), ]
43+
library_dirs = [gp_library_dir, ]
44+
else:
45+
include_dirs = ['/usr/include/PCSC']
46+
define_macros = []
47+
library_dirs = []
48+
49+
setup(
50+
name='pyGlobalPlatform',
51+
52+
# Versions should comply with PEP440. For a discussion on single-sourcing
53+
# the version across setup.py and the project code, see
54+
# https://packaging.python.org/en/latest/single_source_version.html
55+
version='1.2.16',
56+
57+
description=description,
58+
long_description=long_description,
59+
60+
# The project's main homepage.
61+
url='http://www.javacardos.com/',
62+
63+
# Author details
64+
author='www.JavaCardOS.com',
65+
author_email='[email protected]',
66+
67+
# Choose your license
68+
license='MIT',
69+
70+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
71+
classifiers=[
72+
# How mature is this project? Common values are
73+
# 3 - Alpha
74+
# 4 - Beta
75+
# 5 - Production/Stable
76+
'Development Status :: 5 - Production/Stable',
77+
78+
# Indicate who your project is intended for
79+
'Intended Audience :: Developers',
80+
'Topic :: Software Development :: Build Tools',
81+
82+
# Pick your license as you wish (should match "license" above)
83+
'License :: OSI Approved :: MIT License',
84+
85+
# Specify the Python versions you support here. In particular, ensure
86+
# that you indicate whether you support Python 2, Python 3 or both.
87+
'Programming Language :: Python :: 2',
88+
'Programming Language :: Python :: 2.6',
89+
'Programming Language :: Python :: 2.7',
90+
'Programming Language :: Python :: 3',
91+
'Programming Language :: Python :: 3.3',
92+
'Programming Language :: Python :: 3.4',
93+
'Programming Language :: Python :: 3.5',
94+
],
95+
96+
# What does your project relate to?
97+
keywords='smartcard javacard globalplatform',
98+
99+
# You can just specify the packages manually here if your project is
100+
# simple. Or you can use find_packages().
101+
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
102+
103+
# Alternatively, if you want to distribute just a my_module.py, uncomment
104+
# this:
105+
# py_modules=["my_module"],
106+
107+
# List run-time dependencies here. These will be installed by pip when
108+
# your project is installed. For an analysis of "install_requires" vs pip's
109+
# requirements files see:
110+
# https://packaging.python.org/en/latest/requirements.html
111+
install_requires=['peppercorn'],
112+
113+
# List additional groups of dependencies here (e.g. development
114+
# dependencies). You can install these using the following syntax,
115+
# for example:
116+
# $ pip install -e .[dev,test]
117+
# extras_require={
118+
# 'dev': ['check-manifest'],
119+
# 'test': ['coverage'],
120+
# },
121+
122+
# If there are data files included in your packages that need to be
123+
# installed, specify them here. If using Python 2.6 or less, then these
124+
# have to be included in MANIFEST.in as well.
125+
package_data={
126+
# 'sample': ['package_data.dat'],
127+
},
128+
129+
# Although 'package_data' is the preferred approach, in some case you may
130+
# need to place data files outside of your packages. See:
131+
# http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
132+
# In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
133+
# data_files=[('my_data', ['data/data_file'])],
134+
135+
# To provide executable scripts, use entry points in preference to the
136+
# "scripts" keyword. Entry points provide cross-platform support and allow
137+
# pip to create the appropriate form of executable for the target platform.
138+
entry_points={
139+
# 'console_scripts': [
140+
# 'sample=sample:main',
141+
# ],
142+
},
143+
144+
ext_modules = [
145+
Extension(
146+
'pyGlobalPlatform.pyglobalplatform'
147+
, ['./src/main.cpp', './src/gp_functions.cpp', ]
148+
, include_dirs = include_dirs
149+
, define_macros = define_macros
150+
, libraries = ['globalplatform', ]
151+
, library_dirs = library_dirs
152+
)
153+
],
154+
155+
)

0 commit comments

Comments
 (0)