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