summaryrefslogtreecommitdiff
path: root/setup.py
blob: 784716386bd7418de7326d0d94285d2f1cb66eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python

import os
import sys
import glob
import subprocess

from distutils.core import setup

from mat import mat

#Remove MANIFEST file, since distutils
#doesn't properly update it when
#the contents of directories changes.
if os.path.exists('MANIFEST'):
    os.remove('MANIFEST')


def l10n():
    '''
        Compile .po files to .mo
    '''
    for language in glob.glob('locale/*'):
        fpath = os.path.join(language, 'LC_MESSAGES', 'mat-gui.po')
        output = fpath[:-2] + 'mo'
        subprocess.call(['msgfmt', fpath, '-o', output])
        yield output

setup(
    name              = 'MAT',
    version           = mat.__version__,
    description       = 'Metadata Anonymisation Toolkit',
    long_description  = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir',
    author            = mat.__author__,
    author_email      = 'julien.voisin@dustri.org',
    platforms         = 'linux',
    license           = 'GPLv2',
    url               = 'https://mat.boum.org',
    packages          = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'],
    scripts           = ['mat-cli', 'mat-gui'],
    data_files        = [
        ( 'share/applications', ['mat.desktop'] ),
        ( 'share/mat', ['FORMATS'] ),
        ( 'share/doc/mat', ['README', 'TODO'] ),
        ( 'share/mat/locale/', [i for i in l10n()] ),
    ],
)