Fix for Debian bug#671366
[laditools.git] / setup.py
blobdc1f7d03816405ae879ac40e7bd579ab027274c2
1 #!/usr/bin/python
3 # LADITools - Linux Audio Desktop Integration Tools
4 # setup.py - Setup script for the LADITools suite
5 # Copyright (C) 2011-2012 Alessio Treglia <quadrispro@ubuntu.com>
6 # Copyright (C) 2007-2008, Marc-Olivier Barre <marco@marcochapeau.org>
7 # Copyright (C) 2007-2008, Nedko Arnaudov <nedko@arnaudov.name>
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 import os
23 import sys
24 import subprocess
25 import glob
26 from distutils.core import setup
27 from distutils.command.clean import clean
28 from DistUtilsExtra.command import *
30 laditools_version = "1.0"
31 get_commit_script = "gitcommit.sh"
32 pkg_short_desc = "Linux Audio Desktop Integration Tools"
33 pkg_long_desc = """LADITools is a set of tools aiming to achieve the goals of the LADI project to improve desktop integration and user workflow of Linux audio system based on JACK and ladish. Those tools take advantage of the D-Bus interfaces recently added to JACK and ladish to ease the configuration and use of those two great softwares.
35 The following tools are included:
36 * g15ladi - a JACK monitor for g15 keyboards
37 * ladi-control-center - graphical configuration tool to setup JACK's configuration
38 * ladi-player - convenient VLC-style application to control JACK and manage studios
39 * ladi-system-log - JACK, ladish and a2jmidid log viewer
40 * ladi-system-tray - system indicator that allows users to start, stop and monitor
41 JACK, as well as start some JACK related applications
42 * wmladi - Window Maker dockapp for controlling the LADI system"""
43 pkg_data_files = [('share/laditools/data', glob.glob('data/*.ui')),
44 ('share/laditools/data', glob.glob('data/*.svg'))]
45 pkg_scripts = ['g15ladi',
46 'ladi-control-center',
47 'ladi-player',
48 'ladi-system-log',
49 'ladi-system-tray',
50 'wmladi',]
52 os.environ['XGETTEXT_ARGS'] = "--language=Python"
54 if not os.getenv("LADI_RELEASE") and \
55 os.path.isfile(get_commit_script):
56 commit = subprocess.check_output(["sh", get_commit_script]).strip()
57 laditools_version += "~" + commit
59 iconsizelist = "16 22 24 32 48 64 96 128 256".split()
61 class my_build_extra(build_extra.build_extra):
62 def run(self):
63 data_files = self.distribution.data_files
65 for manpage in glob.glob('data/*.[0-9]'):
66 filename = os.path.split(manpage)[-1]
67 subdir = 'man%s' % filename[-1]
68 path = os.path.join('share', 'man', subdir)
69 print manpage
70 data_files.append((path, (manpage,)))
72 build_extra.build_extra.run(self)
74 class build_icons_extra(build_icons.build_icons):
75 def run(self):
76 icondir = os.path.join('data', 'icons')
77 scalabledir = os.path.join(icondir, "scalable")
78 categories = os.listdir(scalabledir)
80 for size in iconsizelist:
81 sizedir = os.path.join(icondir, "%(size)sx%(size)s" % {'size':size})
82 for category in categories:
83 sizecategorydir = os.path.join(sizedir, category)
84 self.spawn(['mkdir', '-p', sizecategorydir])
85 for filename in os.listdir(os.path.join(scalabledir, category)):
86 newfilename = filename.rstrip('svg') + 'png'
87 self.spawn(['rsvg-convert',
88 '-f', 'png',
89 '-w', size, '-h', size,
90 os.path.join(scalabledir, category, filename),
91 '-o', os.path.join(sizecategorydir, newfilename)])
93 build_icons.build_icons.run(self)
95 class clean_extra(clean_i18n.clean_i18n):
96 def run(self):
97 clean_i18n.clean_i18n.run(self)
99 for path, dirs, files in os.walk('.'):
100 for f in files:
101 f = os.path.join(path, f)
102 if f.endswith('.pyc'):
103 self.spawn(['rm', f])
104 for d in dirs:
105 if d == '__pycache__':
106 self.spawn(['rm', '-r', os.path.join(path,d)])
108 for path, dirs, files in os.walk('./data/icons'):
109 if path.endswith('icons'):
110 for d in dirs:
111 if d != 'scalable':
112 self.spawn(['rm', '-r', os.path.join(path,d)])
113 break
115 setup(name='laditools',
116 version=laditools_version,
117 author='Marc-Olivier Barre, Nedko Arnaudov and Alessio Treglia',
118 author_email='linux-audio-dev@lists.linuxaudio.org',
119 license='GPL-3',
120 url='https://launchpad.net/laditools',
121 download_url='https://launchpad.net/laditools/+download',
122 description=pkg_short_desc,
123 long_description=pkg_long_desc,
124 packages=['laditools', 'laditools.gtk'],
125 scripts=pkg_scripts,
126 data_files=pkg_data_files,
127 cmdclass={
128 'build' : my_build_extra,
129 'build_i18n' : build_i18n.build_i18n,
130 'build_icons' : build_icons_extra,
131 'clean' : clean_extra}