3
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
from distutils.core import setup
23
description='Olive - Graphical frontend for Bazaar-NG',
24
author='Szilveszter Farkas (Phanatic)',
25
author_email='szilveszter.farkas@gmail.com',
26
url='https://launchpad.net/products/olive/',
27
packages=['olive', 'olive.backend', 'olive.frontend',
28
'olive.frontend.gtk', 'olive.frontend.gtk.viz'],
29
scripts=['olive-gtk'],
30
data_files=[('share/olive', ['olive.glade',
43
'icons/refresh.png']),
44
('share/applications', ['olive-gtk.desktop']),
45
('share/pixmaps', ['icons/olive-gtk.png'])
2
"""GTK+ Frontends for various Bazaar commands."""
6
from distutils.core import setup, Command
7
from distutils.command.install_data import install_data
8
from distutils.command.build import build
13
description = "Run unit tests"
17
def initialize_options(self):
20
def finalize_options(self):
23
def get_command_name(self):
27
from bzrlib.tests import TestLoader, TestSuite, TextTestRunner
28
import __init__ as bzrgtk
29
runner = TextTestRunner()
32
suite.addTest(bzrgtk.test_suite())
33
result = runner.run(suite)
34
return result.wasSuccessful()
37
class CreateCredits(Command):
38
description = "Create credits file"
40
user_options = [("url=", None, "URL of branch")]
42
def initialize_options(self):
45
def finalize_options(self):
48
def get_command_name(self):
49
return 'build_credits'
52
from bzrlib.plugin import load_plugins; load_plugins()
53
from bzrlib.branch import Branch
54
from bzrlib.plugins.stats.cmds import find_credits
58
branch = Branch.open(self.url)
59
credits = find_credits(branch.repository, branch.last_revision())
61
pickle.dump(credits, file("credits.pickle", 'w'))
65
def is_versioned(cmd):
66
from bzrlib.errors import NotBranchError
68
from bzrlib.branch import Branch
71
except NotBranchError:
75
class BuildData(build):
76
sub_commands = build.sub_commands[:]
77
sub_commands.append(('build_credits', is_versioned))
80
class InstallData(install_data):
84
self.data_files.extend(self._nautilus_plugin())
85
install_data.run(self)
88
subprocess.check_call('gtk-update-icon-cache '
89
'-f -t /usr/share/icons/hicolor')
93
def _nautilus_plugin(self):
95
if sys.platform[:5] == 'linux':
96
cmd = os.popen('pkg-config --variable=pythondir nautilus-python',
98
res = cmd.readline().strip()
102
files.append((dest, ['nautilus-bzr.py']))
106
if __name__ == '__main__':
107
version = bzr_plugin_version[:3]
108
version_string = ".".join([str(x) for x in version])
111
version = version_string,
112
maintainer = "Jelmer Vernooij",
113
maintainer_email = "jelmer@samba.org",
114
description = "GTK+ Frontends for various Bazaar commands",
115
license = "GNU GPL v2 or later",
116
scripts = ['bzr-handle-patch', 'bzr-notify'],
117
url = "http://bazaar-vcs.org/BzrGtk",
119
"bzrlib.plugins.gtk": ".",
120
"bzrlib.plugins.gtk.viz": "viz",
121
"bzrlib.plugins.gtk.annotate": "annotate",
122
"bzrlib.plugins.gtk.tests": "tests",
123
"bzrlib.plugins.gtk.branchview": "branchview",
124
"bzrlib.plugins.gtk.preferences": "preferences",
127
"bzrlib.plugins.gtk",
128
"bzrlib.plugins.gtk.viz",
129
"bzrlib.plugins.gtk.annotate",
130
"bzrlib.plugins.gtk.tests",
131
"bzrlib.plugins.gtk.branchview",
132
"bzrlib.plugins.gtk.preferences",
134
data_files=[ ('share/bzr-gtk', ['credits.pickle']),
135
('share/bzr-gtk/icons', ['icons/commit.png',
136
'icons/commit16.png',
146
'icons/sign-bad.png',
149
'icons/sign-unknown.png',
152
'icons/bzr-icon-64.png']),
153
('share/applications', ['bazaar-properties.desktop',
154
'bzr-handle-patch.desktop',
155
'bzr-notify.desktop']),
156
('share/application-registry', ['bzr-gtk.applications']),
157
('share/pixmaps', ['icons/bzr-icon-64.png']),
158
('share/icons/hicolor/scalable/apps', ['icons/bzr-panel.svg']),
159
('share/icons/hicolor/scalable/emblems',
160
['icons/emblem-bzr-added.svg',
161
'icons/emblem-bzr-conflict.svg',
162
'icons/emblem-bzr-controlled.svg',
163
'icons/emblem-bzr-modified.svg',
164
'icons/emblem-bzr-removed.svg',
165
'icons/emblem-bzr-ignored.svg'])
167
cmdclass={'install_data': InstallData,
168
'build_credits': CreateCredits,