2
3
"""GTK+ Frontends for various Bazaar commands."""
6
5
from distutils.core import setup, Command
7
6
from distutils.command.install_data import install_data
8
7
from distutils.command.build import build
8
from distutils.dep_util import newer
9
from distutils.log import info
96
def _compile_po_files(self):
99
# Don't install language files on Win32
100
if sys.platform == 'win32':
104
for po in glob.glob(os.path.join(PO_DIR,'*.po')):
105
lang = os.path.basename(po[:-3])
106
# It's necessary to compile in this directory (not in po_dir)
107
# because install_data can't rename file
108
mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
110
directory = os.path.dirname(mo)
111
if not os.path.exists(directory):
112
info('creating %s' % directory)
113
os.makedirs(directory)
115
# True if mo doesn't exist
116
cmd = 'msgfmt -o %s %s' % (mo, po)
117
info('compiling %s -> %s' % (po, mo))
118
if os.system(cmd) != 0:
119
raise SystemExit('Error while running msgfmt')
120
dest = os.path.dirname(
121
os.path.join('share', 'locale', lang,
122
'LC_MESSAGES', 'olive-gtk.mo'))
123
data_files.append((dest, [mo]))
93
126
def _nautilus_plugin(self):
95
128
if sys.platform[:5] == 'linux':
106
139
if __name__ == '__main__':
107
version = bzr_plugin_version[:3]
108
version_string = ".".join([str(x) for x in version])
110
141
name = "bzr-gtk",
111
version = version_string,
112
143
maintainer = "Jelmer Vernooij",
113
144
maintainer_email = "jelmer@samba.org",
114
145
description = "GTK+ Frontends for various Bazaar commands",
115
146
license = "GNU GPL v2 or later",
116
scripts = ['bzr-handle-patch', 'bzr-notify'],
147
scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
117
148
url = "http://bazaar-vcs.org/BzrGtk",
119
150
"bzrlib.plugins.gtk": ".",
120
151
"bzrlib.plugins.gtk.viz": "viz",
121
152
"bzrlib.plugins.gtk.annotate": "annotate",
153
"bzrlib.plugins.gtk.olive": "olive",
122
154
"bzrlib.plugins.gtk.tests": "tests",
123
155
"bzrlib.plugins.gtk.branchview": "branchview",
124
156
"bzrlib.plugins.gtk.preferences": "preferences",
127
159
"bzrlib.plugins.gtk",
128
160
"bzrlib.plugins.gtk.viz",
129
161
"bzrlib.plugins.gtk.annotate",
162
"bzrlib.plugins.gtk.olive",
130
163
"bzrlib.plugins.gtk.tests",
131
164
"bzrlib.plugins.gtk.branchview",
132
165
"bzrlib.plugins.gtk.preferences",
134
data_files=[ ('share/bzr-gtk', ['credits.pickle']),
167
data_files=[('share/olive', ['cmenu.ui',
169
('share/bzr-gtk', ['credits.pickle']),
135
170
('share/bzr-gtk/icons', ['icons/commit.png',
136
171
'icons/commit16.png',
137
172
'icons/diff.png',
150
187
'icons/tag-16.png',
152
189
'icons/bzr-icon-64.png']),
153
('share/applications', ['bazaar-properties.desktop',
190
('share/applications', ['olive-gtk.desktop',
191
'bazaar-properties.desktop',
154
192
'bzr-handle-patch.desktop',
155
193
'bzr-notify.desktop']),
156
194
('share/application-registry', ['bzr-gtk.applications']),
157
('share/pixmaps', ['icons/bzr-icon-64.png']),
195
('share/pixmaps', ['icons/olive-gtk.png',
196
'icons/bzr-icon-64.png']),
158
197
('share/icons/hicolor/scalable/emblems',
159
198
['icons/emblem-bzr-added.svg',
160
199
'icons/emblem-bzr-conflict.svg',