This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
69 lines (62 loc) · 2.34 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
import sys
import pkgconfig
from setuptools import setup, Extension
from distutils.version import StrictVersion
PACKAGE_VERSION = '0.0.8'
# retrieve the README
def read(fname):
f = open(os.path.join(os.path.dirname(__file__), fname))
cnt = f.read()
f.close()
return cnt
libraries = ['gwenhywfar', 'aqbanking']
depCompilationArgs = ['-Wunused-variable', '-Wunused-function', '-DPACKAGE_VERSION="' + PACKAGE_VERSION + '"']
depLibraryDirs = []
# check for aqbanking dependency
if not pkgconfig.exists('aqbanking'):
sys.stderr.write('Need aqbanking development package installed for compilation.' + os.linesep)
sys.exit(1)
else:
for library in libraries:
depCompilationArgs += pkgconfig.cflags(library).split(' ')
depCompilationArgs += pkgconfig.libs(library).split(' ')
libPath = pkgconfig.variables(library)['libdir']
if libPath not in depLibraryDirs:
depLibraryDirs.append(libPath)
# furthermore remember the c++ gui!
if StrictVersion(pkgconfig.modversion('aqbanking').replace('beta', '').replace('alpha', '')) >= StrictVersion('5.8.1'):
depCompilationArgs.append('-DSUPPORT_APPREGISTRATION')
depCompilationArgs += ['-DFINTS_REGISTRATION_KEY="8DEDB89E7B0F7DAE207CB948C"']
sys.stderr.write('FinTS App registration enabled' + os.linesep)
else:
sys.stderr.write('FinTS App registration disabled' + os.linesep)
depCompilationArgs += ['-DFENQUEJOB']
if '--debug' in sys.argv:
depCompilationArgs += ['-O0', '-g', '-std=gnu++11', '-Wunused-function', '-DDEBUGSTDERR']
module1 = Extension('aqbanking',
libraries = libraries + ['gwengui-cpp',],
extra_compile_args=depCompilationArgs,
library_dirs=depLibraryDirs,
sources = ['aqbanking/pyaqhandler.cpp', 'aqbanking/aqbanking.cpp']
)
setup (
name = 'python-aqbanking',
version = PACKAGE_VERSION,
description = 'This is a python wrapper for AqBanking',
long_description = read('README.md'),
license = 'GPLv3+',
keywords = 'aqbanking banking hbci financial',
author = 'Lukas Schreiner',
author_email = '[email protected]',
url = 'https://github.com/monofox/python-aqbanking',
ext_modules = [module1],
packages = ['aqbanking'],
classifiers = [
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Intended Audience :: Developers',
'Environment :: No Input/Output (Daemon)',
'Programming Language :: Python :: 3 :: Only'
]
)