1 | # -*- coding: iso-8859-2 -*-
|
---|
2 |
|
---|
3 | import sys
|
---|
4 | import os
|
---|
5 | from glob import glob
|
---|
6 | from distutils.core import setup
|
---|
7 |
|
---|
8 | scriptdir=os.path.dirname(sys.argv[0])
|
---|
9 | sys.path.insert(0, os.path.join(scriptdir, "src"))
|
---|
10 |
|
---|
11 | import mlx.const
|
---|
12 | import mlx.update
|
---|
13 |
|
---|
14 | data_files = [("sounds", glob(os.path.join("sounds", "*.*")))]
|
---|
15 | for language in ["en", "hu"]:
|
---|
16 | data_files.append((os.path.join("doc", "manual", language),
|
---|
17 | glob(os.path.join("doc", "manual", language, "*.*"))))
|
---|
18 | data_files.append((os.path.join("locale", language, "LC_MESSAGES"),
|
---|
19 | [os.path.join("locale", language, "LC_MESSAGES",
|
---|
20 | "mlx.mo")]))
|
---|
21 | data_files.append(("", ["logo.png",
|
---|
22 | "conn_grey.png", "conn_red.png", "conn_green.png"]))
|
---|
23 | if os.name=="nt":
|
---|
24 | import py2exe
|
---|
25 |
|
---|
26 | data_files.append(("", ["logo.ico"]))
|
---|
27 |
|
---|
28 | msvcrDir = os.environ["MSVCRDIR"] if "MSVCRDIR" in os.environ else None
|
---|
29 | if msvcrDir:
|
---|
30 | data_files.append(("Microsoft.VC90.CRT", glob(os.path.join(msvcrDir, "*.*"))))
|
---|
31 |
|
---|
32 | gtkRuntimeDir = os.environ["GTKRTDIR"] if "GTKRTDIR" in os.environ else None
|
---|
33 | if gtkRuntimeDir:
|
---|
34 | path = os.path.join("lib", "gtk-2.0", "2.10.0", "engines")
|
---|
35 | data_files.append((os.path.join("library", path),
|
---|
36 | [os.path.join(gtkRuntimeDir, path, "libwimp.dll")]))
|
---|
37 |
|
---|
38 | path = os.path.join("share", "themes", "MS-Windows", "gtk-2.0")
|
---|
39 | data_files.append((os.path.join("library", path),
|
---|
40 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
41 |
|
---|
42 | path = os.path.join("share", "locale", "hu", "LC_MESSAGES")
|
---|
43 | data_files.append((os.path.join("library", path),
|
---|
44 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
45 | path = os.path.join("share", "icons", "hicolor")
|
---|
46 | data_files.append((os.path.join("library", path),
|
---|
47 | glob(os.path.join(gtkRuntimeDir, path, "*"))))
|
---|
48 |
|
---|
49 | with open("mlx-common.nsh", "wt") as f:
|
---|
50 | print >>f, '!define MLX_VERSION "%s"' % (mlx.const.VERSION)
|
---|
51 | f.close()
|
---|
52 |
|
---|
53 | long_description="""MAVA Logger X
|
---|
54 |
|
---|
55 | This is a program to log and evaluate the actions
|
---|
56 | of a pilot flying a virtual Malév flight operated
|
---|
57 | by MAVA."""
|
---|
58 |
|
---|
59 | setup(name = "mlx",
|
---|
60 | version = mlx.const.VERSION,
|
---|
61 | description = "MAVA Logger X",
|
---|
62 | long_description = long_description,
|
---|
63 | author = "István Váradi",
|
---|
64 | author_email = "ivaradi@gmail.com",
|
---|
65 | url = "http://mlx.varadiistvan.hu",
|
---|
66 | package_dir = { "" : "src" },
|
---|
67 | packages = ["mlx", "mlx.gui"],
|
---|
68 | requires = ["pyuipc", "xplra"],
|
---|
69 | windows = [{ "script" : "runmlx.py",
|
---|
70 | "icon_resources" : [(1, "logo.ico")]},
|
---|
71 | { "script" : "mlxupdate.py",
|
---|
72 | "uac_info" : "requireAdministrator"}],
|
---|
73 | options = { "py2exe" : { "includes": "gio, pango, atk, pangocairo",
|
---|
74 | "skip_archive": True} },
|
---|
75 | zipfile = "library/.",
|
---|
76 | data_files = data_files,
|
---|
77 | platforms = ["Win32", "Linux"],
|
---|
78 | license = "Public Domain"
|
---|
79 | )
|
---|
80 |
|
---|
81 | if os.name=="nt":
|
---|
82 | mlx.update.buildManifest(os.path.join(scriptdir, "dist"))
|
---|
83 | with open(os.path.join(scriptdir, "dist", "Uninstall.conf"), "wt") as f:
|
---|
84 | print >> f, "StartMenuFolder=MAVA Logger X"
|
---|
85 | print >> f, "LinkName=MAVA Logger X"
|
---|