82
82
class InstallData(install_data):
86
84
self.data_files.extend(self._compile_po_files())
87
85
self.data_files.extend(self._nautilus_plugin())
88
86
install_data.run(self)
91
subprocess.check_call('gtk-update-icon-cache '
92
'-f -t /usr/share/icons/hicolor')
89
subprocess.check_call('gtk-update-icon-cache -f -t /usr/share/icons/hicolor')
96
93
def _compile_po_files(self):
99
96
# Don't install language files on Win32
100
97
if sys.platform == 'win32':
104
101
for po in glob.glob(os.path.join(PO_DIR,'*.po')):
105
102
lang = os.path.basename(po[:-3])
106
103
# It's necessary to compile in this directory (not in po_dir)
107
104
# because install_data can't rename file
108
105
mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
110
107
directory = os.path.dirname(mo)
111
108
if not os.path.exists(directory):
112
109
info('creating %s' % directory)
113
110
os.makedirs(directory)
114
112
if newer(po, mo):
115
113
# True if mo doesn't exist
116
114
cmd = 'msgfmt -o %s %s' % (mo, po)
117
115
info('compiling %s -> %s' % (po, mo))
118
116
if os.system(cmd) != 0:
119
117
raise SystemExit('Error while running msgfmt')
120
dest = os.path.dirname(
121
os.path.join('share', 'locale', lang,
122
'LC_MESSAGES', 'olive-gtk.mo'))
119
dest = os.path.dirname(os.path.join('share', 'locale', lang, 'LC_MESSAGES', 'olive-gtk.mo'))
123
120
data_files.append((dest, [mo]))
124
122
return data_files
126
124
def _nautilus_plugin(self):
128
126
if sys.platform[:5] == 'linux':
129
cmd = os.popen('pkg-config --variable=pythondir nautilus-python',
127
cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
131
128
res = cmd.readline().strip()
132
129
ret = cmd.close()
135
133
files.append((dest, ['nautilus-bzr.py']))
139
if __name__ == '__main__':
143
maintainer = "Jelmer Vernooij",
144
maintainer_email = "jelmer@samba.org",
145
description = "GTK+ Frontends for various Bazaar commands",
146
license = "GNU GPL v2 or later",
147
scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
148
url = "http://bazaar-vcs.org/BzrGtk",
150
"bzrlib.plugins.gtk": ".",
151
"bzrlib.plugins.gtk.viz": "viz",
152
"bzrlib.plugins.gtk.annotate": "annotate",
153
"bzrlib.plugins.gtk.olive": "olive",
154
"bzrlib.plugins.gtk.tests": "tests",
155
"bzrlib.plugins.gtk.branchview": "branchview",
156
"bzrlib.plugins.gtk.preferences": "preferences",
159
"bzrlib.plugins.gtk",
160
"bzrlib.plugins.gtk.viz",
161
"bzrlib.plugins.gtk.annotate",
162
"bzrlib.plugins.gtk.olive",
163
"bzrlib.plugins.gtk.tests",
164
"bzrlib.plugins.gtk.branchview",
165
"bzrlib.plugins.gtk.preferences",
141
maintainer = "Jelmer Vernooij",
142
maintainer_email = "jelmer@samba.org",
143
description = "GTK+ Frontends for various Bazaar commands",
144
license = "GNU GPL v2 or later",
145
scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
146
url = "http://bazaar-vcs.org/BzrGtk",
148
"bzrlib.plugins.gtk": ".",
149
"bzrlib.plugins.gtk.viz": "viz",
150
"bzrlib.plugins.gtk.annotate": "annotate",
151
"bzrlib.plugins.gtk.olive": "olive",
152
"bzrlib.plugins.gtk.tests": "tests",
153
"bzrlib.plugins.gtk.branchview": "branchview",
154
"bzrlib.plugins.gtk.preferences": "preferences",
157
"bzrlib.plugins.gtk",
158
"bzrlib.plugins.gtk.viz",
159
"bzrlib.plugins.gtk.annotate",
160
"bzrlib.plugins.gtk.olive",
161
"bzrlib.plugins.gtk.tests",
162
"bzrlib.plugins.gtk.branchview",
163
"bzrlib.plugins.gtk.preferences",
167
data_files=[('share/olive', ['cmenu.ui',
169
('share/bzr-gtk', ['credits.pickle']),
170
('share/bzr-gtk/icons', ['icons/commit.png',
171
'icons/commit16.png',
181
'icons/olive-gtk.png',
182
'icons/oliveicon2.png',
183
'icons/sign-bad.png',
186
'icons/sign-unknown.png',
189
'icons/bzr-icon-64.png']),
190
('share/applications', ['olive-gtk.desktop',
191
'bazaar-properties.desktop',
192
'bzr-handle-patch.desktop',
193
'bzr-notify.desktop']),
194
('share/application-registry', ['bzr-gtk.applications']),
195
('share/pixmaps', ['icons/olive-gtk.png',
196
'icons/bzr-icon-64.png']),
197
('share/icons/hicolor/scalable/emblems',
198
['icons/emblem-bzr-added.svg',
199
'icons/emblem-bzr-conflict.svg',
200
'icons/emblem-bzr-controlled.svg',
201
'icons/emblem-bzr-modified.svg',
202
'icons/emblem-bzr-removed.svg',
203
'icons/emblem-bzr-ignored.svg'])
205
cmdclass={'install_data': InstallData,
206
'build_credits': CreateCredits,
165
data_files=[('share/olive', ['cmenu.ui',
167
('share/bzr-gtk', ['credits.pickle']),
168
('share/bzr-gtk/icons', ['icons/commit.png',
169
'icons/commit16.png',
179
'icons/olive-gtk.png',
180
'icons/oliveicon2.png',
181
'icons/sign-bad.png',
184
'icons/sign-unknown.png',
187
'icons/bzr-icon-64.png']),
188
('share/applications', ['olive-gtk.desktop',
189
'bazaar-properties.desktop',
190
'bzr-handle-patch.desktop',
191
'bzr-notify.desktop']),
192
('share/application-registry', ['bzr-gtk.applications']),
193
('share/pixmaps', ['icons/olive-gtk.png', 'icons/bzr-icon-64.png']),
194
('share/icons/hicolor/scalable/emblems',
195
['icons/emblem-bzr-added.svg',
196
'icons/emblem-bzr-conflict.svg',
197
'icons/emblem-bzr-controlled.svg',
198
'icons/emblem-bzr-modified.svg',
199
'icons/emblem-bzr-removed.svg'])
201
cmdclass={'install_data': InstallData,
202
'build_credits': CreateCredits,