diff options
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 21 |
1 files changed, 18 insertions, 3 deletions
| @@ -1,6 +1,9 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
| 2 | 2 | ||
| 3 | import os | 3 | import os |
| 4 | import sys | ||
| 5 | import glob | ||
| 6 | import subprocess | ||
| 4 | 7 | ||
| 5 | from distutils.core import setup | 8 | from distutils.core import setup |
| 6 | 9 | ||
| @@ -12,21 +15,33 @@ from mat import mat | |||
| 12 | if os.path.exists('MANIFEST'): | 15 | if os.path.exists('MANIFEST'): |
| 13 | os.remove('MANIFEST') | 16 | os.remove('MANIFEST') |
| 14 | 17 | ||
| 18 | |||
| 19 | def l10n(): | ||
| 20 | ''' | ||
| 21 | Compile .po files to .mo | ||
| 22 | ''' | ||
| 23 | for language in glob.glob('locale/*'): | ||
| 24 | fpath = os.path.join(language, 'LC_MESSAGES', 'mat-gui.po') | ||
| 25 | output = fpath[:-2] + 'mo' | ||
| 26 | subprocess.call(['msgfmt', fpath, '-o', output]) | ||
| 27 | yield output | ||
| 28 | |||
| 15 | setup( | 29 | setup( |
| 16 | name = 'MAT', | 30 | name = 'MAT', |
| 17 | version = mat.__version__, | 31 | version = mat.__version__, |
| 18 | description = 'Metadata Anonymisation Toolkit', | 32 | description = 'Metadata Anonymisation Toolkit', |
| 19 | long_decription = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', | 33 | long_description = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', |
| 20 | author = mat.__author__, | 34 | author = mat.__author__, |
| 21 | author_email = 'julien.voisin@dustri.org', | 35 | author_email = 'julien.voisin@dustri.org', |
| 22 | platforms = 'linux', | 36 | platforms = 'linux', |
| 23 | license = 'GPLv2', | 37 | license = 'GPLv2', |
| 24 | url = 'https://mat.boum.org', | 38 | url = 'https://mat.boum.org', |
| 25 | packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'], | 39 | packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'], |
| 26 | scripts = ['mat-cli', 'mat-gui'], | 40 | scripts = ['mat-cli', 'mat-gui'], |
| 27 | data_files = [ | 41 | data_files = [ |
| 28 | ( 'share/applications', [ 'mat.desktop' ] ), | 42 | ( 'share/applications', ['mat.desktop'] ), |
| 29 | ( 'share/mat', ['FORMATS'] ), | 43 | ( 'share/mat', ['FORMATS'] ), |
| 30 | ( 'share/doc/mat', ['README', 'TODO'] ), | 44 | ( 'share/doc/mat', ['README', 'TODO'] ), |
| 45 | ( 'share/mat/locale/', [i for i in l10n()] ), | ||
| 31 | ], | 46 | ], |
| 32 | ) | 47 | ) |
