3
from distutils.core import setup
4
import distutils.command.install_data
5
import distutils.command.clean
6
from distutils.dir_util import remove_tree
8
import subprocess, glob, os.path
10
class my_install_data(distutils.command.install_data.install_data):
12
# install files from etc/
13
for (root, _, files) in os.walk('etc'):
14
self.data_files.append((os.path.join('/', root),
15
[os.path.join(root, f) for f in files]))
18
subprocess.call(['make', '-C', 'po', 'build-mo'])
19
for filepath in glob.glob('po/mo/*/LC_MESSAGES/*.mo'):
20
lang = filepath[len('po/mo/'):]
21
targetpath = os.path.dirname(os.path.join('share/locale',lang))
22
self.data_files.append((targetpath, [filepath]))
24
distutils.command.install_data.install_data.run(self)
27
d = os.path.join(self.install_dir, 'share', 'icons', 'hicolor', 'scalable',
30
l = os.path.join (d, 'text-x-apport.svg')
33
os.symlink(os.path.join('..', 'apps', 'apport.svg'), l)
35
class my_clean(distutils.command.clean.clean):
37
distutils.command.clean.clean.run(self)
40
modir = os.path.join('po', 'mo')
41
if os.path.exists(modir):
42
remove_tree(modir, self.dry_run)
6
import DistUtilsExtra.auto
9
print >> sys.stderr, 'To build Apport you need https://launchpad.net/python-distutils-extra'
12
assert DistUtilsExtra.auto.__version__ >= '2.2', 'needs DistUtilsExtra.auto >= 2.2'
14
DistUtilsExtra.auto.setup(name='apport',
45
15
author='Martin Pitt',
46
16
author_email='martin.pitt@ubuntu.com',
47
maintainer='Martin Pitt',
48
maintainer_email='martin.pitt@ubuntu.com',
49
17
url='https://wiki.ubuntu.com/Apport',
51
19
description='intercept, process, and report crashes and bug reports',
53
py_modules=['problem_report', 'apport_python_hook'],
54
data_files=[('share/apport', ['gtk/apport-gtk.ui'] + glob.glob('kde/*.ui')),
55
('share/icons/hicolor/scalable/apps', ['apport/apport.svg']),
56
('share/mime/packages', glob.glob('xdg-mime/*')),
22
data_files=[('share/mime/packages', glob('xdg-mime/*')),
23
('share/apport', glob('kde/*.ui')), #TODO: use pykdeuic modules
57
24
('share/apport/testsuite/', ['test-apport', 'test-hooks', 'run-tests']),
58
('share/doc/apport/', glob.glob('doc/*.txt') + glob.glob('doc/*.pdf')),
59
('share/apport/package-hooks/', glob.glob('package-hooks/*')),
60
('share/apport/general-hooks/', glob.glob('general-hooks/*')),
25
('share/doc/apport/', glob('doc/*.txt')),
62
scripts=['bin/apport', 'bin/apport-checkreports', 'bin/apport-retrace',
63
'bin/apport-unpack', 'bin/package_hook',
64
'bin/kernel_crashdump', 'bin/gcc_ice_hook', 'gtk/apport-gtk',
65
'kde/apport-kde', 'cli/apport-cli', 'bin/dupdb-admin',
66
'bin/kernel_oops', 'bin/apportcheckresume'],
67
packages=['apport', 'apport.crashdb_impl'],
70
'install_data': my_install_data,
27
scripts=['gtk/apport-gtk', 'kde/apport-kde', 'cli/apport-cli'],