-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
104 lines (90 loc) · 4.17 KB
/
setup.py
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
99
100
101
102
103
104
"""
Cache901 - GeoCaching Software for the Asus EEE PC 901
Copyright (C) 2008, Michael J. Pedersen <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""
# py2exe: http://www.py2exe.org/
# py2app: http://pypi.python.org/pypi/py2app/
# easy dmg: http://www.versiontracker.com/dyn/moreinfo/macosx/26358
# OSX Issue:
# GPSBabel could not run correctly from the app bundle, but had already been
# release. As a result, the app bundle requires the svn version of
# Python-GPSBabel. That version will be released when the next version of
# Cache901 comes out.
# OSX Serial issue:
# When installing pyserial on OSX, an egg is created. py2app doesn't
# support eggs correctly. As a result, the serial module was not being
# included, and I could not make it happen. The fix I employed (which is
# far from ideal) was to execute the following commands:
# mv /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyserial-2.4-py2.5.egg/serial /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
# rm -rf /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyserial-2.4-py2.5.egg
# After that, the serial module was correctly included
# OSX Issue:
# Seems that macholib has problems with the way these options are for OSX.
# Had to correct by installing an updated version. Used this command:
# sudo easy_install "macholib==dev"
from setuptools import setup
import os, os.path, sys
try:
import py2exe
except ImportError, e:
pass
try:
import py2app
except ImportError, e:
pass
dependencies = ['pyserial', 'gpsbabel', 'wxPython-common>=2.8', 'sqlalchemy<=0.5.9', 'sqlalchemy-migrate', 'pysqlite']
if sys.platform == "win32":
#dependencies.append('pywin32')
datafiles = [('cache901', [os.sep.join(['cache901', 'shield.ico']), os.sep.join(['osfiles', 'gpsbabel.exe']), os.sep.join(['osfiles', 'libexpat.dll'])],) ]
elif sys.platform == "darwin":
datafiles = []
else:
datafiles = []
setup(name='Cache901',
version="0.7.1",
description='Paperless Geocaching Tool',
author='Michael Pedersen',
author_email='[email protected] ',
url='http://www.cache901.org/',
entry_points = {
'gui_scripts': [
'geocache901 = cache901.app:psycomain'
]
},
packages=['cache901', ],
package_data={'cache901' : ['shield.ico', ]},
install_requires=dependencies,
zip_safe=False,
# Combined options for py2app and py2exe
options = {
"py2exe": {
"dll_excludes": ["user32.dll", "ole32.dll", "kernel32.dll", "rpcrt4.dll", "oleaut32.dll", "shell32.dll", "shlwapi.dll", "ntdll.dll", "comdlg32.dll", "wsock32.dll", "comctl32.dll", "advapi32.dll", "ws2_32.dll", "gdi32.dll", "winmm.dll", "ws2help.dll", "mswsock.dll"]
},
"py2app" : {
"resources": [os.sep.join(['cache901', 'shield.ico']), os.sep.join(['osfiles', 'gpsbabel'])],
"iconfile": "shield.icns"
}
},
# py2exe options below here
data_files = datafiles,
windows=[{
'script' : 'geocache901.py',
'icon_resources' : [(1, os.sep.join(['cache901', 'shield.ico']))]
}],
# py2app options below here
app = ['geocache901.py', ]
)
if sys.platform=="win32":
os.rename(os.sep.join(['dist', 'cache901', 'gpsbabel.exe']), os.sep.join(['dist', 'gpsbabel.exe']))
os.rename(os.sep.join(['dist', 'cache901', 'libexpat.dll']), os.sep.join(['dist', 'libexpat.dll']))