summaryrefslogtreecommitdiff
path: root/setup.py
blob: 91741093a728d6803e5aff34bb4a899fa426f3d1 (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
#!/usr/bin/python

import glob
import os
import re

from distutils.core import setup


def get_debian_version():
    """look what Debian version we have"""
    version = None
    changelog = "debian/changelog"
    if os.path.exists(changelog):
        head = open(changelog).readline()
        match = re.compile(r".*\((.*)\).*").match(head)
        if match:
            version = match.group(1)
    return version

SCRIPTS = [
    'amo-changelog',
    'dh_xul-ext',
    'install-xpi',
    'xpi-pack',
    'xpi-repack',
    'xpi-unpack',
    'moz-version',
]

if __name__ == '__main__':
    setup(
        name='mozilla-devscripts',
        version=get_debian_version(),
        scripts=SCRIPTS,
        py_modules=['moz_version'],
        data_files=[
            ('share/doc/mozilla-devscripts', ['README']),
            ('share/man/man1', glob.glob("man/*.1")),
            ('share/mozilla-devscripts', ['data/xpi.mk'] + glob.glob('data/xul-app-data.csv.*')),
            ('share/perl5/Debian/Debhelper/Buildsystem', ['perl/Debian/Buildsystem/xul_ext.pm']),
            ('share/perl5/Debian/Debhelper/Sequence', ['perl/Debian/Sequence/xul_ext.pm']),
        ],
    )