-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathsetup.py
91 lines (84 loc) · 3.17 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python3
#
# setup.py
#
# Copyright (C) 2013-2014 Ashwin Menon <[email protected]>
# Copyright (C) 2015-2024 Track Master Steve <[email protected]>
#
# You may redistribute it and/or modify it under the terms of the
# GNU General Public License, as published by the Free Software
# Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Alienfx is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with alienfx. If not, write to:
# The Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor
# Boston, MA 02110-1301, USA.
#
try:
from setuptools import setup, find_packages
except ImportError:
print("ImportError: Unable to import 'setup' and 'find_packages' from setuptools.")
#import ez_setup
#ez_setup.use_setuptools()
#from setuptools import setup, find_packages
import os
import os.path
from pkg_resources import resource_filename
import shutil
data_files = [
("share/applications", ["alienfx/data/share/applications/alienfx.desktop"]),
("share/icons/hicolor/scalable/apps", ["alienfx/data/icons/hicolor/scalable/apps/alienfx.svg"]),
("share/icons/hicolor/48x48/apps", ["alienfx/data/icons/hicolor/48x48/apps/alienfx.png"]),
('share/pixmaps', ["alienfx/data/pixmaps/alienfx.png"]),
("share/man/man1", ["docs/man/alienfx.1"])
]
entry_points = {
"console_scripts": [
"alienfx = alienfx.ui.console:start",
],
"gui_scripts": [
"alienfx-gtk = alienfx.ui.gtkui:start"
]
}
setup(
name = "alienfx",
version = "2.4.3",
fullname = "AlienFX Configuration Utility",
description = "AlienFX Configuration Utility",
author = "Track Master Steve",
author_email = "[email protected]",
keywords = "alienfx alienware",
long_description = """AlienFX is a utility that allows you to configure
the lights of your Alienware computer.""",
url = "https://github.com/trackmastersteve/alienfx",
license = "GPLv3",
install_requires = ["pyusb>=1.2.1"],
data_files = data_files,
entry_points = entry_points,
packages = find_packages(),
package_data = {"alienfx": [
"ui/gtkui/glade/*.glade",
"data/icons/hicolor/scalable/apps/*.svg",
"data/themes/default.json",
"data/etc/udev/rules.d/10-alienfx.rules"
]}
)
# Copy the udev rules file
udev_file = resource_filename("alienfx", "data/etc/udev/rules.d/10-alienfx.rules")
udev_rules_dir = "/etc/udev/rules.d/"
try:
if not os.path.exists(udev_rules_dir):
print("Udev rules directory {} does not exist. Will not copy udev rules file.".format(udev_rules_dir))
elif not os.access(udev_rules_dir, os.W_OK):
print("Udev rules directory {} is not writable. Will not copy udev rules file.".format(udev_rules_dir))
else:
shutil.copy(udev_file, udev_rules_dir)
except IOError:
print("Unable to copy udev rules file {} to {}".format(udev_file, udev_rules_dir))