-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·191 lines (141 loc) · 5.02 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/usr/bin/env python
"""
/**********************************************************
Organization :AsymptopiaSoftware | Software@theLimit
Website :www.asymptopia.org
Support :www.asymptopia.org/forum
Author :Charles B. Cosse
Email :[email protected]
Copyright :(C) 2006-2015 Asymptopia Software
License :GPLv3
***********************************************************/
"""
import os,sys
from setuptools import setup
APPNAME='TuxWordSmith'
setup(name='tuxwordsmith',
version='0.8.1',
description='pygame program that will teach your kids to add, subtract and multiply',
url='http://www.asymptopia.org',
author='Charles B. Cosse',
author_email='[email protected]',
include_package_data=True,
license='GPLV3',
packages=[APPNAME],)
for sitepkgdir in sys.path:
if sitepkgdir[-13:]=='site-packages':break
rm_path=os.path.join('/var/games/',APPNAME)
if os.path.exists(rm_path):
cmd="rm -rf %s"%rm_path
os.system(cmd)
rm_path=os.path.join(sitepkgdir,APPNAME)
if os.path.exists(rm_path):
cmd="rm -rf %s"%rm_path
print cmd
os.system(cmd)
if len(sys.argv)>1 and sys.argv[1]=='uninstall':
print 'application sucessfully removed.'
sys.exit()
#Added 1/6/08 b/c Macs don't (apparantly) have /var/games by default (some linux distros may not, either)
if not os.path.exists('/var'):os.mkdir('/var')
if not os.path.exists('/var/games'):os.mkdir('/var/games')
if not os.path.exists('/var/games/TuxWordSmith'):os.mkdir('/var/games/TuxWordSmith')
path='/var/games/TuxWordSmith'
cmd="cp -r xdxf Font README INSTALL CHANGES VERSION %s"%(path)
os.system(cmd)
cmd="chmod -R 755 /var/games/%s"%(APPNAME)
os.system(cmd)
cmd="cp .tws_config_master %s"%(path)
print cmd
os.system(cmd)
path=os.path.join(sitepkgdir,APPNAME)
if not os.path.exists(path):os.mkdir(path)
cmd="cp -r %s %s"%(APPNAME,sitepkgdir)
print cmd
os.system(cmd)
cmd="cp tuxwordsmith.py /usr/local/bin/tuxwordsmith"
print cmd
os.system(cmd)
cmd="chmod +x /usr/local/bin/%s"%('tuxwordsmith')
print cmd
os.system(cmd)
cmd="chmod -R 755 %s/%s"%(sitepkgdir,APPNAME)
print cmd
os.system(cmd)
##########################################################
print '*********************************************'
print '* *'
print '* Setup Complete *'
print '* *'
print '* Run: /usr/local/bin/tuxwordsmith -help *'
print '* *'
print '* Checkout more software at: *'
print '* http://www.asymptopia.org *'
print '* *'
print '*********************************************'
#!/usr/bin/env python
"""
/**********************************************************
Organization :AsymptopiaSoftware | Software@theLimit
Website :www.asymptopia.org
Author :Charles B. Cosse
Email :[email protected]
Copyright :(C) 2006-2010 Asymptopia Software
License :GPLv3
***********************************************************/
"""
import os,sys
APPNAME='TuxWordSmith'
for sitepkgdir in sys.path:
if sitepkgdir[-13:]=='site-packages':break
rm_path=os.path.join('/var/games/',APPNAME)
if os.path.exists(rm_path):
cmd="rm -rf %s"%rm_path
os.system(cmd)
rm_path=os.path.join(sitepkgdir,APPNAME)
if os.path.exists(rm_path):
cmd="rm -rf %s"%rm_path
print cmd
os.system(cmd)
if len(sys.argv)>1 and sys.argv[1]=='uninstall':
print 'application sucessfully removed.'
sys.exit()
#Added 1/6/08 b/c Macs don't (apparantly) have /var/games by default (some linux distros may not, either)
if not os.path.exists('/var'):os.mkdir('/var')
if not os.path.exists('/var/games'):os.mkdir('/var/games')
if not os.path.exists('/var/games/TuxWordSmith'):os.mkdir('/var/games/TuxWordSmith')
path='/var/games/TuxWordSmith'
cmd="cp -r Font %s"%(path)
os.system(cmd)
cmd="cp -r xdxf %s"%(path)
os.system(cmd)
cmd="chmod -R 755 /var/games/%s"%(APPNAME)
os.system(cmd)
cmd="cp .tws_config_master %s"%(path)
print cmd
os.system(cmd)
path=os.path.join(sitepkgdir,APPNAME)
if not os.path.exists(path):os.mkdir(path)
cmd="cp -r %s %s"%(APPNAME,sitepkgdir)
print cmd
os.system(cmd)
cmd="cp tuxwordsmith.py /usr/local/bin/tuxwordsmith"
print cmd
os.system(cmd)
cmd="chmod +x /usr/local/bin/%s"%('tuxwordsmith')
print cmd
os.system(cmd)
cmd="chmod -R 755 %s/%s"%(sitepkgdir,APPNAME)
print cmd
os.system(cmd)
##########################################################
print '*********************************************'
print '* *'
print '* Setup Complete *'
print '* *'
print '* Run: /usr/local/bin/tuxwordsmith -help *'
print '* *'
print '* Checkout more software at: *'
print '* http://www.asymptopia.org *'
print '* *'
print '*********************************************'