17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
19
from distutils.core import setup
20
from distutils.command.install_data import install_data
21
from distutils.dep_util import newer
22
from distutils.log import info
27
class InstallData(install_data):
29
self.data_files.extend(self._compile_po_files())
30
install_data.run(self)
32
def _compile_po_files(self):
35
# Don't install language files on Win32
36
if sys.platform == 'win32':
40
for po in glob.glob(os.path.join(PO_DIR,'*.po')):
41
lang = os.path.basename(po[:-3])
42
# It's necessary to compile in this directory (not in po_dir)
43
# because install_data can't rename file
44
mo = os.path.join('build', 'mo', lang, 'olive-gtk.mo')
46
directory = os.path.dirname(mo)
47
if not os.path.exists(directory):
48
info('creating %s' % directory)
49
os.makedirs(directory)
52
# True if mo doesn't exist
53
cmd = 'msgfmt -o %s %s' % (mo, po)
54
info('compiling %s -> %s' % (po, mo))
55
if os.system(cmd) != 0:
56
raise SystemExit('Error while running msgfmt')
58
dest = os.path.dirname(os.path.join('share', 'locale', lang, 'LC_MESSAGES', 'olive-gtk.mo'))
59
data_files.append((dest, [mo]))
21
63
setup(name='Olive',
23
description='Olive - Graphical frontend for Bazaar-NG',
65
description='Olive - Graphical frontend for Bazaar',
24
66
author='Szilveszter Farkas (Phanatic)',
25
67
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'],
68
url='http://bazaar-vcs.org/Olive',
29
70
scripts=['olive-gtk'],
30
71
data_files=[('share/olive', ['olive.glade',