3
2
"""GTK+ Frontends for various Bazaar commands."""
5
6
from distutils.core import setup, Command
6
7
from distutils.command.install_data import install_data
7
8
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]))
126
93
def _nautilus_plugin(self):
128
95
if sys.platform[:5] == 'linux':
139
106
if __name__ == '__main__':
107
version = bzr_plugin_version[:3]
108
version_string = ".".join([str(x) for x in version])
141
110
name = "bzr-gtk",
111
version = version_string,
143
112
maintainer = "Jelmer Vernooij",
144
113
maintainer_email = "jelmer@samba.org",
145
114
description = "GTK+ Frontends for various Bazaar commands",
146
115
license = "GNU GPL v2 or later",
147
scripts = ['olive-gtk', 'bzr-handle-patch', 'bzr-notify'],
116
scripts = ['bzr-handle-patch', 'bzr-notify'],
148
117
url = "http://bazaar-vcs.org/BzrGtk",
150
119
"bzrlib.plugins.gtk": ".",
151
120
"bzrlib.plugins.gtk.viz": "viz",
152
121
"bzrlib.plugins.gtk.annotate": "annotate",
153
"bzrlib.plugins.gtk.olive": "olive",
154
122
"bzrlib.plugins.gtk.tests": "tests",
155
123
"bzrlib.plugins.gtk.branchview": "branchview",
156
124
"bzrlib.plugins.gtk.preferences": "preferences",
159
127
"bzrlib.plugins.gtk",
160
128
"bzrlib.plugins.gtk.viz",
161
129
"bzrlib.plugins.gtk.annotate",
162
"bzrlib.plugins.gtk.olive",
163
130
"bzrlib.plugins.gtk.tests",
164
131
"bzrlib.plugins.gtk.branchview",
165
132
"bzrlib.plugins.gtk.preferences",
167
data_files=[('share/olive', ['cmenu.ui',
169
('share/bzr-gtk', ['credits.pickle']),
134
data_files=[ ('share/bzr-gtk', ['credits.pickle']),
170
135
('share/bzr-gtk/icons', ['icons/commit.png',
171
136
'icons/commit16.png',
172
137
'icons/diff.png',
187
150
'icons/tag-16.png',
189
152
'icons/bzr-icon-64.png']),
190
('share/applications', ['olive-gtk.desktop',
191
'bazaar-properties.desktop',
153
('share/applications', ['bazaar-properties.desktop',
192
154
'bzr-handle-patch.desktop',
193
155
'bzr-notify.desktop']),
194
156
('share/application-registry', ['bzr-gtk.applications']),
195
('share/pixmaps', ['icons/olive-gtk.png',
196
'icons/bzr-icon-64.png']),
157
('share/pixmaps', ['icons/bzr-icon-64.png']),
158
('share/icons/hicolor/scalable/apps', ['icons/bzr-panel.svg']),
197
159
('share/icons/hicolor/scalable/emblems',
198
160
['icons/emblem-bzr-added.svg',
199
161
'icons/emblem-bzr-conflict.svg',