/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
126.1.31 by Szilveszter Farkas (Phanatic)
We also support other versions than 2.4.
1
#!/usr/bin/python
83 by Jelmer Vernooij
Merge Olive code.
2
"""GTK+ Frontends for various Bazaar commands."""
0.8.10 by Szilveszter Farkas (Phanatic)
2006-07-16 Szilveszter Farkas <Szilveszter.Farkas@gmail.com>
3
4
from distutils.core import setup
0.9.1 by Stéphane Raimbault
Work on translation.
5
from distutils.command.install_data import install_data
6
from distutils.dep_util import newer
7
from distutils.log import info
0.8.74 by Szilveszter Farkas (Phanatic)
Fix the Win32 build/install issue.
8
import glob
0.9.1 by Stéphane Raimbault
Work on translation.
9
import os
0.8.74 by Szilveszter Farkas (Phanatic)
Fix the Win32 build/install issue.
10
import sys
0.9.1 by Stéphane Raimbault
Work on translation.
11
12
class InstallData(install_data):
126.1.30 by Szilveszter Farkas (Phanatic)
Added the ability to install the Nautilus plugin (Fixed: #75603)
13
    def run(self):
14
        self.data_files.extend(self._compile_po_files())
15
        # Disable for now - performance issues
16
        #self.data_files.extend(self._nautilus_plugin())
17
        install_data.run(self)
18
    
19
    def _compile_po_files(self):
20
        data_files = []
21
        
22
        # Don't install language files on Win32
23
        if sys.platform == 'win32':
24
            return data_files
25
        
26
        PO_DIR = 'po'
27
        for po in glob.glob(os.path.join(PO_DIR,'*.po')):
28
            lang = os.path.basename(po[:-3])
29
            # It's necessary to compile in this directory (not in po_dir)
30
            # because install_data can't rename file
31
            mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
32
            
33
            directory = os.path.dirname(mo)
34
            if not os.path.exists(directory):
35
                info('creating %s' % directory)
36
                os.makedirs(directory)
37
            
38
            if newer(po, mo):
39
                # True if mo doesn't exist
40
                cmd = 'msgfmt -o %s %s' % (mo, po)
41
                info('compiling %s -> %s' % (po, mo))
42
                if os.system(cmd) != 0:
43
                    raise SystemExit('Error while running msgfmt')
44
                
45
                dest = os.path.dirname(os.path.join('share', 'locale', lang, 'LC_MESSAGES', 'olive-gtk.mo'))
46
                data_files.append((dest, [mo]))
47
        
48
        return data_files
49
    
50
    def _nautilus_plugin(self):
51
        files = []
52
        if sys.platform[:5] == 'linux':
53
            cmd = os.popen('pkg-config --variable=pythondir nautilus-python', 'r')
54
            res = cmd.readline()
55
            ret = cmd.close()
56
            
57
            if ret is None:
58
                dest = res[5:]
59
                files.append((dest, ['nautilus-bzr.py']))
60
        
61
        return files
83 by Jelmer Vernooij
Merge Olive code.
62
63
64
setup(
91.1.10 by Jelmer Vernooij
Fix name for bzr-gtk (closes: #67933), update version number.
65
    name = "bzr-gtk",
137 by Jelmer Vernooij
Warn about incompatible versions (taken from bzrtools, thanks Aaron).
66
    version = "0.14.0",
83 by Jelmer Vernooij
Merge Olive code.
67
    maintainer = "Jelmer Vernooij",
68
    maintainer_email = "jelmer@samba.org",
69
    description = "GTK+ Frontends for various Bazaar commands",
70
    license = "GNU GPL v2",
71
    scripts=['olive-gtk'],
72
    package_dir = {
73
        "bzrlib.plugins.gtk": ".",
74
        "bzrlib.plugins.gtk.viz": "viz", 
66.2.13 by Jelmer Vernooij
Install olive.
75
        "bzrlib.plugins.gtk.annotate": "annotate",
126.1.34 by Szilveszter Farkas (Phanatic)
Install test suite.
76
        "bzrlib.plugins.gtk.olive": "olive",
77
        "bzrlib.plugins.gtk.tests": "tests"
83 by Jelmer Vernooij
Merge Olive code.
78
        },
79
    packages = [
80
		"olive",
81
        "bzrlib.plugins.gtk",
82
        "bzrlib.plugins.gtk.viz",
66.2.13 by Jelmer Vernooij
Install olive.
83
        "bzrlib.plugins.gtk.annotate",
126.1.34 by Szilveszter Farkas (Phanatic)
Install test suite.
84
        "bzrlib.plugins.gtk.olive",
85
        "bzrlib.plugins.gtk.tests"
83 by Jelmer Vernooij
Merge Olive code.
86
        ],
0.8.31 by Szilveszter Farkas (Phanatic)
Added new artwork.
87
      data_files=[('share/olive', ['olive.glade',
88
                                   'oliveicon2.png',
89
                                   'cmenu.ui',
0.14.7 by Alexander Belchenko
Make olive.glade universal by using the same path to icon resources
90
                                  ]),
91
                  ('share/olive/icons', [\
0.8.31 by Szilveszter Farkas (Phanatic)
Added new artwork.
92
                                   'icons/commit.png',
0.8.34 by Szilveszter Farkas (Phanatic)
Some artwork revamp; added 16x16 icons to the menu.
93
                                   'icons/commit16.png',
0.8.31 by Szilveszter Farkas (Phanatic)
Added new artwork.
94
                                   'icons/diff.png',
0.8.34 by Szilveszter Farkas (Phanatic)
Some artwork revamp; added 16x16 icons to the menu.
95
                                   'icons/diff16.png',
96
                                   'icons/log.png',
97
                                   'icons/log16.png',
98
                                   'icons/pull.png',
99
                                   'icons/pull16.png',
100
                                   'icons/push.png',
101
                                   'icons/push16.png',
0.8.47 by Szilveszter Farkas (Phanatic)
Added Desktop entry.
102
                                   'icons/refresh.png']),
0.8.48 by Szilveszter Farkas (Phanatic)
Some small tweaks in the .desktop file.
103
                  ('share/applications', ['olive-gtk.desktop']),
104
                  ('share/pixmaps', ['icons/olive-gtk.png'])
0.9.1 by Stéphane Raimbault
Work on translation.
105
                 ],
83 by Jelmer Vernooij
Merge Olive code.
106
	cmdclass={'install_data': InstallData}
107
)