Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 106964 | Differences between
and this patch

Collapse All | Expand All

(-)setup.py (-145 / +1 lines)
Lines 17-23 Link Here
17
# along with Scribes; if not, write to the Free Software
17
# along with Scribes; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
20
21
u"""
20
u"""
22
Installation script for Scribes.
21
Installation script for Scribes.
23
22
Lines 35-137 Link Here
35
@contact: mystilleef@gmail.com
34
@contact: mystilleef@gmail.com
36
"""
35
"""
37
36
38
39
from sys import version_info, exit
37
from sys import version_info, exit
40
from os import putenv
38
from os import putenv
41
from commands import getstatusoutput
39
from commands import getstatusoutput
42
from distutils.core import setup
40
from distutils.core import setup
43
from Scribes.info import version
41
from Scribes.info import version
44
42
45
46
def check_dependencies():
47
	u"""
48
	Check for Scribes' runtime software dependencies.
49
50
	The function aborts the installation process if runtime software
51
	dependencies are not met by the host system.
52
53
	"""
54
55
	try:
56
57
		import pygtk
58
		pygtk.require("2.0")
59
		import gtk
60
61
		if gtk.pygtk_version < (2, 8, 0):
62
63
			raise ImportError
64
65
	except ImportError:
66
67
		print "You need PyGTK version 2.8 or later to run Scribes."
68
		exit(1)
69
70
	try:
71
72
		import pygtk
73
		pygtk.require("2.0")
74
		import gnome
75
76
		if gnome.gnome_python_version < (2, 12, 0):
77
78
			raise ImportError
79
80
	except ImportError:
81
82
		print "You need GNOME Python version 2.12 or later to run Scribes"
83
		exit(1)
84
85
	try:
86
87
		import pygtk
88
		pygtk.require("2.0")
89
		import gtksourceview
90
91
	except ImportError:
92
93
		print "You need the gtksourceview module in GNOME Python Extras version"
94
		print " 2.12 or later to run Scribes."
95
		exit(1)
96
97
	try:
98
99
		import pygtk
100
		pygtk.require("2.0")
101
		import gtkspell
102
103
	except ImportError:
104
105
		print "You need the gtkspell module in GNOME Python Extras version"
106
		print " 2.12 or later to run Scribes."
107
		exit(1)
108
109
	# Check to see if Yelp is installed on the host system
110
111
	cmd = "which yelp"
112
	err, out = getstatusoutput(cmd)
113
114
	if err:
115
116
		print "You need Yelp version 2.12 or later to run Scribes."
117
		exit(1)
118
119
	# Check to see if GConf is installed on the host system
120
121
	cmd = "which gconftool-2"
122
	err, out = getstatusoutput(cmd)
123
124
	if err:
125
126
		print "You need GConf version 2.12 or later to run Scribes."
127
		exit(1)
128
129
	return
130
131
check_dependencies()
132
133
# Trove classification
43
# Trove classification
134
135
classifiers = """
44
classifiers = """
136
Development Status :: 1 - Alpha
45
Development Status :: 1 - Alpha
137
Environment :: X11 Applications :: GTK
46
Environment :: X11 Applications :: GTK
Lines 148-164 Link Here
148
Topic :: Documentation
57
Topic :: Documentation
149
Topic :: Software Development
58
Topic :: Software Development
150
Topic :: Text Editors
59
Topic :: Text Editors
151
152
"""
60
"""
153
61
154
155
################################################################################
156
#
157
#								Setup
158
#
159
################################################################################
160
161
162
setup(name="scribes",
62
setup(name="scribes",
163
	version=version,
63
	version=version,
164
	description="Text editor for GNOME.",
64
	description="Text editor for GNOME.",
Lines 170-175 Link Here
170
	license="GNU GPL v2 and above",
70
	license="GNU GPL v2 and above",
171
	packages=["Scribes"],
71
	packages=["Scribes"],
172
	data_files=[
72
	data_files=[
73
		("/etc/gconf/schemas", ["data/scribes.schemas"]),
173
		("share/applications", ["data/scribes.desktop"]),
74
		("share/applications", ["data/scribes.desktop"]),
174
		("share/application-registry", ["data/scribes.application"]),
75
		("share/application-registry", ["data/scribes.application"]),
175
		("share/pixmaps", ["data/scribes.svg"]),
76
		("share/pixmaps", ["data/scribes.svg"]),
Lines 188-235 Link Here
188
		"data/scribes_editing.png", "data/scribes_status.png"])
89
		"data/scribes_editing.png", "data/scribes_status.png"])
189
	],
90
	],
190
	scripts=["scribes"],)
91
	scripts=["scribes"],)
191
192
193
################################################################################
194
#
195
#							GConf Installation
196
#
197
################################################################################
198
199
# Get gconf's default source
200
cmd = "gconftool-2 --get-default-source"
201
err, out = getstatusoutput(cmd)
202
203
# Set up the gconf environment variable.
204
putenv('GCONF_CONFIG_SOURCE', out)
205
206
# Install gconf to the default source
207
cmd = "gconftool-2 --makefile-install-rule data/scribes.schemas"
208
err, out = getstatusoutput(cmd)
209
210
if out:
211
212
	print "installing GConf schema files"
213
214
if err:
215
216
    print 'Error: installation of gconf schema files failed: %s' % out
217
218
# Kill the GConf daemon
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
cmd = "gconftool-2 --spawn"
228
err, out = getstatusoutput(cmd)
229
230
if err:
231
232
	print "Problem restarting down gconf."
233
234
print "scribes installation complete"
235

Return to bug 106964