terminator/setup.py

61 lines
1.7 KiB
Python
Raw Normal View History

2007-07-28 03:37:57 +00:00
#!/usr/bin/env python
from distutils.core import setup
2007-12-29 03:01:28 +00:00
from distutils.command.install_data import install_data
from distutils.dep_util import newer
from distutils.log import info
import glob
import os
import sys
class InstallData(install_data):
def run (self):
self.data_files.extend (self._compile_po_files ())
install_data.run (self)
def _compile_po_files (self):
data_files = []
# Don't install language files on win32
if sys.platform == 'win32':
return data_files
PO_DIR = 'po'
for po in glob.glob (os.path.join (PO_DIR,'*.po')):
lang = os.path.basename(po[:-3])
mo = os.path.join('build', 'mo', lang, 'terminator.mo')
directory = os.path.dirname(mo)
if not os.path.exists(directory):
info('creating %s' % directory)
os.makedirs(directory)
if newer(po, mo):
# True if mo doesn't exist
cmd = 'msgfmt -o %s %s' % (mo, po)
info('compiling %s -> %s' % (po, mo))
if os.system(cmd) != 0:
raise SystemExit('Error while running msgfmt')
dest = os.path.dirname(os.path.join('share', 'locale', lang, 'LC_MESSAGES', 'terminator.mo'))
data_files.append((dest, [mo]))
return data_files
2007-07-28 03:37:57 +00:00
setup(name='Terminator',
version='0.8',
2007-07-28 03:37:57 +00:00
description='Terminator, the robot future of terminals',
author='Chris Jones',
author_email='cmsj@tenshu.net',
2007-07-28 12:10:30 +00:00
url='http://www.tenshu.net/terminator/',
license='GPL v2',
scripts=['terminator'],
2007-12-29 02:27:39 +00:00
data_files=[
('share/applications', ['terminator.desktop']),
2008-01-05 01:21:39 +00:00
('share/man/man1', ['doc/terminator.1']),
2007-12-29 02:27:39 +00:00
],
2007-12-29 03:01:28 +00:00
cmdclass={'install_data': InstallData}
2007-07-28 03:37:57 +00:00
)