-
Notifications
You must be signed in to change notification settings - Fork 25
/
setup.py
64 lines (55 loc) · 2.56 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
from setuptools import setup
from setuptools.command.sdist import sdist
import glob
import sys
data_files = []
ui_files = glob.glob('data/ui/*.ui')
css_files = glob.glob('data/css/*.css')
img_files = glob.glob('data/img/*.png')
polkit_files = glob.glob('org.fedoraproject.pkexec.blivet-gui.policy')
desktop_files = glob.glob('blivet-gui.desktop')
man_files = glob.glob('man/blivet-gui.1')
appdata_files = glob.glob('appdata/*.xml')
data_files.append(('share/blivet-gui/ui', ui_files))
data_files.append(('share/blivet-gui/css', css_files))
data_files.append(('share/blivet-gui/img', img_files))
data_files.append(('share/polkit-1/actions', polkit_files))
data_files.append(('share/applications', desktop_files))
data_files.append(('share/man/man1', man_files))
data_files.append(('share/appdata', appdata_files))
for size in ("16x16", "22x22", "24x24", "32x32", "48x48", "64x64", "256x256"):
icons = glob.glob('data/icons/hicolor/' + size + '/blivet-gui.png')
data_files.append(('share/icons/hicolor/' + size + '/apps', icons))
# Extend the sdist command
class blivet_gui_sdist(sdist):
user_options = sdist.user_options + [('mode=', None, "specify mode for sdist; one of 'release', 'normal'"),]
def initialize_options(self):
sdist.initialize_options(self)
self.mode = None # pylint: disable=attribute-defined-outside-init
def finalize_options(self):
sdist.finalize_options(self)
if self.mode not in (None, 'release', 'normal'):
raise AttributeError('Unknown mode %s' % self.mode)
def make_release_tree(self, base_dir, files):
# Run the parent command first
sdist.make_release_tree(self, base_dir, files)
if self.mode == "release":
# Run translation-canary in release mode to remove any bad translations
sys.path.append('translation-canary')
from translation_canary.translated import testSourceTree # pylint: disable=import-error
testSourceTree(base_dir, releaseMode=True)
setup(
name='blivet-gui',
cmdclass={"sdist": blivet_gui_sdist},
packages=['blivetgui'],
version='2.6.0',
description = 'Tool for data storages configuration',
author='Vojtech Trefny',
author_email='[email protected]',
url='http://github.com/storaged-project/blivet-gui',
package_dir={'blivetgui' : 'blivetgui'},
package_data={'blivetgui' : ['visualization/*.py', 'communication/*.py',
'dialogs/*.py', 'data/icons/hicolor/*/apps/blivet-gui.png']},
data_files=data_files,
scripts = ['blivet-gui', 'blivet-gui-daemon']
)