Added
Link Here
|
1 |
#!/usr/local/bin/python3.9 |
2 |
# -*- coding: utf-8 -*- |
3 |
# vim: set expandtab tabstop=4 shiftwidth=4: |
4 |
|
5 |
from setuptools import setup, find_packages |
6 |
from setuptools.command.install import install |
7 |
import os |
8 |
import shutil |
9 |
|
10 |
config_dir = '/usr/local/etc/xsser' |
11 |
core_dir = '/usr/local/etc/xsser/core' |
12 |
doc_dir = '/usr/local/etc/xsser/doc' |
13 |
gtk_dir = '/usr/local/etc/xsser/gtk' |
14 |
|
15 |
for path in [config_dir, core_dir, doc_dir, gtk_dir]: |
16 |
os.makedirs(path, exist_ok=True) |
17 |
|
18 |
dirs = ['core', 'doc', 'gtk'] |
19 |
|
20 |
for i in dirs: |
21 |
local_dir = i # Assuming 'core' is in the current working directory |
22 |
target_dir = '/usr/local/etc/xsser/' + i |
23 |
|
24 |
if os.path.exists(local_dir): |
25 |
for item in os.listdir(local_dir): |
26 |
local_item = os.path.join(local_dir, item) |
27 |
target_item = os.path.join(target_dir, item) |
28 |
|
29 |
# Check if the item is a file and copy it |
30 |
if os.path.isfile(local_item): |
31 |
shutil.copy(local_item, target_item) |
32 |
# Check if the item is a directory and copy it recursively |
33 |
elif os.path.isdir(local_item): |
34 |
shutil.copytree(local_item, target_item, dirs_exist_ok=True) |
35 |
|
36 |
image_files = [] |
37 |
doc_files = [] |
38 |
gtk_doc_files = [] |
39 |
|
40 |
for afile in os.listdir('doc'): |
41 |
if afile != '.svn': |
42 |
doc_files.append('doc/' + afile) |
43 |
for afile in os.listdir('gtk/docs'): |
44 |
if afile != '.svn': |
45 |
gtk_doc_files.append('gtk/docs/' + afile) |
46 |
data_files = ['gtk/images/world.png', |
47 |
'gtk/images/xsser.jpg', |
48 |
'gtk/images/xssericon_16x16.png', |
49 |
'gtk/images/xssericon_24x24.png', |
50 |
'gtk/map/GeoIP.dat'] |
51 |
gtk_files = ['gtk/xsser.ui'] |
52 |
gtk_app_files = ['gtk/xsser.desktop'] |
53 |
|
54 |
setup( |
55 |
name="xsser", |
56 |
version="1.8.4", |
57 |
packages=['core', 'core.fuzzing', 'core.post', 'core.driver', 'gtk'], # Explicitly list the packages |
58 |
data_files=[('/usr/share/doc/xsser/', doc_files), |
59 |
('/usr/share/xsser/gtk/images/', data_files), |
60 |
('/usr/share/xsser/gtk/docs/', gtk_doc_files), |
61 |
('/usr/share/applications/', gtk_app_files), |
62 |
('/usr/share/xsser/gtk/', gtk_files)], |
63 |
entry_points={ |
64 |
'console_scripts': ['xsser = xsser:main'], |
65 |
}, |
66 |
test_suite="tests", |
67 |
) |