Lines 20-26
Link Here
|
20 |
u""" |
20 |
u""" |
21 |
Installation script for Scribes. |
21 |
Installation script for Scribes. |
22 |
|
22 |
|
23 |
This module installs Scribes' data files and modules on the host system. |
23 |
This module installs Scribes' data files and modules on the host system. |
24 |
Software dependency checks are also performed to ensure that the host system has |
24 |
Software dependency checks are also performed to ensure that the host system has |
25 |
all the required software to run Scribes. |
25 |
all the required software to run Scribes. |
26 |
|
26 |
|
Lines 34-138
Link Here
|
34 |
@contact: mystilleef@gmail.com |
34 |
@contact: mystilleef@gmail.com |
35 |
""" |
35 |
""" |
36 |
|
36 |
|
37 |
from sys import version_info, exit |
|
|
38 |
from os import putenv |
39 |
from commands import getstatusoutput |
40 |
from distutils.core import setup |
37 |
from distutils.core import setup |
41 |
|
38 |
|
42 |
|
39 |
# Trove classification |
43 |
def check_dependencies(): |
|
|
44 |
u""" |
45 |
Check for Scribes' runtime software dependencies. |
46 |
|
47 |
The function aborts the installation process if runtime software |
48 |
dependencies are not met by the host system. |
49 |
""" |
50 |
|
51 |
if version_info[:3] < (2, 4, 0): |
52 |
|
53 |
print "You need Python version 2.4 or later to run Scribes." |
54 |
exit(1) |
55 |
|
56 |
try: |
57 |
|
58 |
import gdbm |
59 |
|
60 |
except ImportError: |
61 |
|
62 |
print "You need Python version 2.4 compiled with gdbm to run Scribes." |
63 |
exit(1) |
64 |
|
65 |
try: |
66 |
|
67 |
import gtk |
68 |
|
69 |
if gtk.pygtk_version < (2, 8, 0): |
70 |
|
71 |
raise ImportError |
72 |
|
73 |
except ImportError: |
74 |
|
75 |
print "You need PyGTK version 2.8 or later to run Scribes." |
76 |
exit(1) |
77 |
|
78 |
try: |
79 |
|
80 |
import gnome |
81 |
|
82 |
if gnome.gnome_python_version < (2, 12, 0): |
83 |
|
84 |
raise ImportError |
85 |
|
86 |
except ImportError: |
87 |
|
88 |
print "You need GNOME Python version 2.12 or later to run Scribes" |
89 |
exit(1) |
90 |
|
91 |
try: |
92 |
|
93 |
import gtksourceview |
94 |
|
95 |
except ImportError: |
96 |
|
97 |
print "You need the gtksourceview module in GNOME Python Extras version" |
98 |
print " 2.12 or later to run Scribes." |
99 |
exit(1) |
100 |
|
101 |
try: |
102 |
|
103 |
import gtkspell |
104 |
|
105 |
except ImportError: |
106 |
|
107 |
print "You need the gtkspell module in GNOME Python Extras version" |
108 |
print " 2.12 or later to run Scribes." |
109 |
exit(1) |
110 |
|
111 |
# Check to see if Yelp is installed on the host system |
112 |
|
113 |
cmd = "which yelp" |
114 |
err, out = getstatusoutput(cmd) |
115 |
|
116 |
if err: |
117 |
|
118 |
print "You need Yelp version 2.12 or later to run Scribes." |
119 |
exit(1) |
120 |
|
121 |
# Check to see if GConf is installed on the host system |
122 |
|
123 |
cmd = "which gconftool-2" |
124 |
err, out = getstatusoutput(cmd) |
125 |
|
126 |
if err: |
127 |
|
128 |
print "You need GConf version 2.12 or later to run Scribes." |
129 |
exit(1) |
130 |
|
131 |
return |
132 |
|
133 |
check_dependencies() |
134 |
|
135 |
# Trove classification |
136 |
|
40 |
|
137 |
classifiers = """ |
41 |
classifiers = """ |
138 |
Development Status :: 1 - Alpha |
42 |
Development Status :: 1 - Alpha |
Lines 151-157
Link Here
|
151 |
Topic :: Software Development |
55 |
Topic :: Software Development |
152 |
Topic :: Text Editors |
56 |
Topic :: Text Editors |
153 |
|
57 |
|
154 |
""" |
58 |
""" |
155 |
|
59 |
|
156 |
|
60 |
|
157 |
################################################################################ |
61 |
################################################################################ |
Lines 172-178
Link Here
|
172 |
license="GNU GPL v2 and above", |
76 |
license="GNU GPL v2 and above", |
173 |
packages=["Scribes"], |
77 |
packages=["Scribes"], |
174 |
data_files=[("share/applications", ["data/scribes.desktop"]), |
78 |
data_files=[("share/applications", ["data/scribes.desktop"]), |
175 |
("share/application-registry", |
79 |
("share/application-registry", |
176 |
["data/scribes.application"]), |
80 |
["data/scribes.application"]), |
177 |
("share/scribes/", ["data/scribes_toolbar_ui.xml"]), |
81 |
("share/scribes/", ["data/scribes_toolbar_ui.xml"]), |
178 |
("share/gnome/help/scribes/C", ["data/scribes.xml"]), |
82 |
("share/gnome/help/scribes/C", ["data/scribes.xml"]), |
Lines 180-235
Link Here
|
180 |
("share/locale/ru/LC_MESSAGES/",["data/po/ru/scribes.mo"]), |
84 |
("share/locale/ru/LC_MESSAGES/",["data/po/ru/scribes.mo"]), |
181 |
("share/locale/pt_BR/LC_MESSAGES/",["data/po/pt_BR/scribes.mo"]), |
85 |
("share/locale/pt_BR/LC_MESSAGES/",["data/po/pt_BR/scribes.mo"]), |
182 |
("share/omf/scribes", ["data/scribes-C.omf"]), |
86 |
("share/omf/scribes", ["data/scribes-C.omf"]), |
183 |
("share/gnome/help/scribes/C/figures", |
87 |
("share/gnome/help/scribes/C/figures", |
184 |
["data/scribes_window.png", "data/scribes_toolbar.png", |
88 |
["data/scribes_window.png", "data/scribes_toolbar.png", |
185 |
"data/scribes_editing.png", "data/scribes_status.png"])], |
89 |
"data/scribes_editing.png", "data/scribes_status.png"])], |
186 |
scripts=["scribes"],) |
90 |
scripts=["scribes"],) |
187 |
|
|
|
188 |
|
189 |
################################################################################ |
190 |
# |
191 |
# GConf Installation |
192 |
# |
193 |
################################################################################ |
194 |
|
195 |
# Get gconf's default source |
196 |
|
197 |
cmd = "gconftool-2 --get-default-source" |
198 |
err, out = getstatusoutput(cmd) |
199 |
|
200 |
# Set up the gconf environment variable. |
201 |
|
202 |
putenv('GCONF_CONFIG_SOURCE', out) |
203 |
|
204 |
# Install gconf to the default source |
205 |
|
206 |
cmd = "gconftool-2 --makefile-install-rule data/scribes.schemas" |
207 |
err, out = getstatusoutput(cmd) |
208 |
|
209 |
if out: |
210 |
|
211 |
print "installing GConf schema files" |
212 |
|
213 |
if err: |
214 |
|
215 |
print 'Error: installation of gconf schema files failed: %s' % out |
216 |
|
217 |
# Kill the GConf daemon |
218 |
|
219 |
cmd = "killall gconfd-2" |
220 |
err, out = getstatusoutput(cmd) |
221 |
|
222 |
if err: |
223 |
|
224 |
print "Problem shutting down gconf." |
225 |
|
226 |
# Start the GConf daemon |
227 |
|
228 |
cmd = "gconftool-2 --spawn" |
229 |
err, out = getstatusoutput(cmd) |
230 |
|
231 |
if err: |
232 |
|
233 |
print "Problem restarting down gconf." |
234 |
|
235 |
print "scribes installation complete" |