forked from freenas/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreenas-cli.spec
71 lines (63 loc) · 1.88 KB
/
freenas-cli.spec
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
# -*- mode: python -*-
import glob
import platform
block_cipher = None
def resource_path(relative_path):
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
a = Analysis(['freenas/cli/repl.py'],
pathex=['.'],
binaries=None,
datas=None,
hiddenimports=['freenas.cli.output.ascii', 'freenas.cli.complete', 'Queue', 'curses', 'pyte'],
hookspath=None,
runtime_hooks=None,
excludes=None,
win_no_prefer_redirects=None,
win_private_assemblies=None,
cipher=block_cipher)
a.datas += [
('freenas/cli/parser.py', resource_path('freenas/cli/parser.py'), 'DATA'),
('freenas/cli/parsetab.py', resource_path('freenas/cli/parsetab.py'), 'DATA'),
('freenas/cli/complete.py', resource_path('freenas/cli/complete.py'), 'DATA')
]
for f in glob.glob('freenas/cli/plugins/*'):
if not os.path.isfile(f):
continue
a.datas += [(f, resource_path(f), 'DATA')]
for f in glob.glob('freenas/cli/output/*'):
if not os.path.isfile(f):
continue
a.datas += [(f, resource_path(f), 'DATA')]
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
if platform.system() == 'Windows':
exe = EXE(pyz,
a.binaries,
a.datas,
a.scripts,
exclude_binaries=False,
name='freenas-cli',
debug=False,
strip=None,
upx=True,
console=True)
elif platform.system() == 'Darwin':
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='freenas-cli',
debug=False,
strip=None,
upx=True,
console=True)
app = BUNDLE(exe,
a.binaries,
a.zipfiles,
a.datas,
name='freenas-cli.framework',
icon=None,
bundle_identifier='org.freenas.cli')