-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathsetup.py
73 lines (56 loc) · 2.18 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
import os
import shutil
import stat
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def post_install():
path = '/usr/local/bin/woeusbgui' # I give up, I have no clue how to get bin path that is used by pip
shutil.copy2(this_directory + '/WoeUSB/woeusbgui', path) # I'll just hard code it until someone finds better way
shutil.copy2(this_directory + '/miscellaneous/com.github.woeusb.woeusb-ng.policy', "/usr/share/polkit-1/actions")
try:
os.makedirs('/usr/share/icons/WoeUSB-ng')
except FileExistsError:
pass
shutil.copy2(this_directory + '/WoeUSB/data/icon.ico', '/usr/share/icons/WoeUSB-ng/icon.ico')
shutil.copy2(this_directory + '/miscellaneous/WoeUSB-ng.desktop', "/usr/share/applications/WoeUSB-ng.desktop")
os.chmod('/usr/share/applications/WoeUSB-ng.desktop',
stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH | stat.S_IEXEC) # 755
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
# TODO
develop.run(self)
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
post_install()
install.run(self)
setup(
name='WoeUSB-ng',
version='0.2.12',
description='WoeUSB-ng is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. This is a rewrite of original WoeUSB. ',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/WoeUSB/WoeUSB-ng',
author='Jakub Szymański',
author_email='jakubmateusz@poczta.onet.pl',
license='GPL-3',
zip_safe=False,
packages=['WoeUSB'],
include_package_data=True,
scripts=[
'WoeUSB/woeusb',
],
install_requires=[
'termcolor',
'wxPython',
],
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand
}
)