Browse code

add setup.py

Hanno Böck authored on23/12/2019 18:15:16
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,62 @@
1
+#!/usr/bin/python3
2
+
3
+import os
4
+import glob
5
+import pathlib
6
+import shutil
7
+import setuptools
8
+import setuptools.command.install
9
+
10
+
11
+class install_freewvsdb(setuptools.command.install.install):
12
+    def run(self):
13
+        dbpaths = ['/var/lib/freewvs/',
14
+                   str(pathlib.Path.home()) + "/.cache/freewvs/"]
15
+
16
+        target = False
17
+        for dbpath in dbpaths:
18
+            if not os.path.isdir(dbpath):
19
+                try:
20
+                    os.makedirs(dbpath)
21
+                except PermissionError:
22
+                    continue
23
+            if os.access(dbpath, os.W_OK):
24
+                target = dbpath
25
+                break
26
+        for j in glob.glob("freewvsdb/*.json"):
27
+            shutil.copy(j, target)
28
+        setuptools.command.install.install.run(self)
29
+
30
+
31
+f = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md'))
32
+readme = f.read()
33
+f.close()
34
+
35
+setuptools.setup(
36
+    name='freewvs',
37
+    version="0.1.0",
38
+    description="A free web vulnerability scanner",
39
+    long_description=readme,
40
+    long_description_content_type='text/markdown',
41
+    url='https://freewvs.schokokeks.org/',
42
+    packages=[],
43
+    scripts=['freewvs', 'update-freewvsdb'],
44
+    python_requires='>=3',
45
+    license="CC0",
46
+    keywords=['security', 'vulnerability', 'web'],
47
+    classifiers=[
48
+        'Development Status :: 4 - Beta',
49
+        'Intended Audience :: System Administrators',
50
+        'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
51
+        'Natural Language :: English',
52
+        'Programming Language :: Python :: 3',
53
+        'Programming Language :: Python :: 3 :: Only',
54
+        'Programming Language :: Python :: 3.5',
55
+        'Programming Language :: Python :: 3.6',
56
+        'Programming Language :: Python :: 3.7',
57
+        'Programming Language :: Python :: 3.8',
58
+    ],
59
+    cmdclass={
60
+        'install': install_freewvsdb
61
+    }
62
+)