Include manpages.
[laditools.git] / setup.py
blobe723be103a00afa932ae0c102506291915ec9076
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~rc8"
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',
88 '-w', size, '-h', size,
89 os.path.join(scalabledir, category, filename),
90 os.path.join(sizecategorydir, newfilename)])
92 build_icons.build_icons.run(self)
94 class clean_extra(clean_i18n.clean_i18n):
95 def run(self):
96 clean_i18n.clean_i18n.run(self)
98 for path, dirs, files in os.walk('.'):
99 for f in files:
100 f = os.path.join(path, f)
101 if f.endswith('.pyc'):
102 self.spawn(['rm', f])
103 for d in dirs:
104 if d == '__pycache__':
105 self.spawn(['rm', '-r', os.path.join(path,d)])
107 for path, dirs, files in os.walk('./data/icons'):
108 if path.endswith('icons'):
109 for d in dirs:
110 if d != 'scalable':
111 self.spawn(['rm', '-r', os.path.join(path,d)])
112 break
114 setup(name='laditools',
115 version=laditools_version,
116 author='Marc-Olivier Barre, Nedko Arnaudov and Alessio Treglia',
117 author_email='linux-audio-dev@lists.linuxaudio.org',
118 license='GPL-3',
119 url='https://launchpad.net/laditools',
120 download_url='https://launchpad.net/laditools/+download',
121 description=pkg_short_desc,
122 long_description=pkg_long_desc,
123 packages=['laditools', 'laditools.gtk'],
124 scripts=pkg_scripts,
125 data_files=pkg_data_files,
126 cmdclass={
127 'build' : my_build_extra,
128 'build_i18n' : build_i18n.build_i18n,
129 'build_icons' : build_icons_extra,
130 'clean' : clean_extra}