summaryrefslogtreecommitdiff
path: root/setup.py
blob: ad484128baf02a45d1f4efbdee7fd8d4102cc4c8 (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
#!/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(".*\((.*)\).*").match(head)
        if match:
            version = match.group(1)
    return version

SCRIPTS = [
    '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=[os.path.join('src', s) for s in SCRIPTS],
          py_modules=['src/moz_version'],
          data_files=[('share/doc/mozilla-devscripts', ['README']),
                      ('share/man/man1', glob.glob("man/*.1")),
                      ('share/mozilla-devscripts',
                       ['src/xpi.mk'] + glob.glob('src/xul-app-data.csv.*')),
                      ('share/perl5/Debian/Debhelper/Buildsystem',
                       ['src/Buildsystem/xul_ext.pm']),
                      ('share/perl5/Debian/Debhelper/Sequence',
                       ['src/Sequence/xul_ext.pm']),
                     ],
    )