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
|
#!/usr/bin/env python3
from partmgr.core.version import VERSION_STRING
from distutils.core import setup
import sys
try:
import py2exe
except ImportError as e:
py2exe = None
try:
if py2exe and "py2exe" in sys.argv:
raise ImportError
from cx_Freeze import setup, Executable
cx_Freeze = True
except ImportError as e:
cx_Freeze = False
freezeExecutables = [ ("partmgr-gui", None), ]
extraKeywords = {}
if py2exe:
extraKeywords["console"] = [ s for s, e in freezeExecutables ]
if cx_Freeze:
executables = []
for script, exe in freezeExecutables:
if exe:
if os.name.lower() in ("nt", "ce"):
exe += ".exe"
executables.append(Executable(script = script,
targetName = exe))
else:
executables.append(Executable(script = script))
extraKeywords["executables"] = executables
extraKeywords["options"] = {
"build_exe" : {
"packages" : [ "partmgr", ],
}
}
setup( name = "partmgr",
version = VERSION_STRING,
description = "Part manager",
license = "GNU General Public License v2 or later",
author = "Michael Buesch",
author_email = "m@bues.ch",
url = "http://bues.ch/h/partmgr",
packages = [ "partmgr",
"partmgr/core",
"partmgr/pricefetch",
"partmgr/gui", ],
scripts = [ "partmgr-gui",
"partmgr-import-partdb", ],
keywords = [ ],
classifiers = [
],
# long_description = open("README.txt").read(),
**extraKeywords
)
|