-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
69 lines (61 loc) · 2.22 KB
/
setup.py
File metadata and controls
69 lines (61 loc) · 2.22 KB
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
"""
libinjection module for python
Copyright 2012, 2013, 2014 Nick Galbreath
nickg@client9.com
BSD License -- see COPYING.txt for details
"""
import os
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
def get_libinjection_version():
"""Read the libinjection version from the upstream source file, if available."""
version_file = os.path.join(os.path.dirname(__file__),
'upstream', 'src', 'libinjection_sqli.c')
if os.path.exists(version_file):
with open(version_file, encoding="utf-8") as f:
for line in f:
if '#define LIBINJECTION_VERSION' in line and '__clang_analyzer__' not in line:
# Extract version string from: #define LIBINJECTION_VERSION "x.y.z"
parts = line.strip().split('"')
if len(parts) >= 2:
return parts[1]
return 'undefined'
LIBINJECTION_VERSION = get_libinjection_version()
MODULE = Extension(
'libinjection._libinjection', [
'libinjection/libinjection_wrap.c',
'libinjection/libinjection_sqli.c',
'libinjection/libinjection_html5.c',
'libinjection/libinjection_xss.c'
],
swig_opts=['-Wextra', '-builtin'],
define_macros = [('LIBINJECTION_VERSION', '"{}"'.format(LIBINJECTION_VERSION))],
include_dirs = [],
libraries = [],
library_dirs = [],
)
setup (
name = 'libinjection',
version = '3.9.1',
description = 'Wrapper around libinjection c-code to detect sqli',
author = 'Nick Galbreath',
author_email = 'nickg@client9.com',
url = 'https://libinjection.client9.com/',
ext_modules = [MODULE],
packages = ['libinjection'],
long_description = '''
wrapper around libinjection
''',
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Topic :: Database',
'Topic :: Security',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
'Topic :: Internet :: Log Analysis',
'Topic :: Internet :: WWW/HTTP'
]
)