forked from mbusb/multibootusb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultibootusb.spec
executable file
·99 lines (89 loc) · 3.45 KB
/
multibootusb.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- mode: python -*-
version = open(os.path.join("tools", "version.txt"), 'r').read().strip()
##### include tools in distribution #######
def extra_datas(mydir,exclude=[]):
def rec_glob(p, files):
import os
import glob
for d in glob.glob(p):
if os.path.isfile(d):
files.append(d)
rec_glob("%s/*" % d, files)
files = []
rec_glob("%s/*" % mydir, files)
return [(f, f, 'DATA') for f in files if f not in exclude]
###########################################
import platform
import os
if platform.system() == "Windows":
a = Analysis(['multibootusb'],
pathex=['C:\\Users\\Sundar\\Documents\\multibootusb'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
a.datas += extra_datas('tools')
else:
a = Analysis(['./multibootusb'],
pathex=['/home/sundar/multibootusb'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
a.datas += extra_datas('tools')
"""
# Add the name of libraries/ dll/ binaries which are not required to be included.
a.binaries = a.binaries - TOC([
('libfontconfig.so.1', '', ''),
('libgthread-2.0.so.0', '', ''),
('libaudio.so.2', '', ''),
('libglib-2.0.so.0', '', ''),
('libpng12.so.0', '', ''),
('libQt3Support.so.4', '', ''),
('libbz2.so.1.0', '', ''),
('libz.so.1', '', ''),
('libgobject-2.0.so.0', '', ''),
('libSM.so.6', '', ''),
('libICE.so.6', '', ''),
('libXrender.so.1', '', ''),
('libXext.so.6', '', ''),
('libX11.so.6', '', ''),
('libgcc_s.so.1', '', ''),
('libm.so.6', '', ''),
('libdl.so.2', '', ''),
('librt.so.1', '', ''),
('libGL.so.1', '', ''),
('libX11.so.6', '', ''),
('libpthread.so.0', '', ''),
('libQtSql.so.4', '', ''),
('libQtXml.so.4', '', ''),
('libfreetype.so.6', '', '')])
"""
pyz = PYZ(a.pure)
if platform.system() == "Windows":
#icon='myicon.ico'
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='multibootusb-' + version + '.exe',
#name='multibootusb.exe',
debug=False,
strip=None,
upx=True,
console=False , icon=os.path.join("tools", "multibootusb.ico"), manifest='multibootusb.exe.manifest')
else:
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='multibootusb',
debug=False,
strip=None,
upx=True,
console=False )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='multibootusb')