Support a gPodder icon theme on Maemo 4
[gpodder.git] / setup.py
blobfce6e31377fc7739e5da83f268c7c81803ca9645
1 #!/usr/bin/env python
4 # gPodder - A media aggregator and podcast client
5 # Copyright (c) 2005-2009 Thomas Perl and the gPodder Team
7 # gPodder is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # gPodder is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 import glob
22 import os
23 import re
24 import sys
25 from distutils.core import setup
27 # build targets
28 (DEFAULT, MAEMO) = range(2)
30 # import the gpodder module locally for module metadata
31 sys.path.insert(0, 'src')
32 import gpodder
34 # build target
35 if 'TARGET' in os.environ:
36 if os.environ['TARGET'].strip().lower() == 'maemo':
37 target = MAEMO
38 else:
39 target = DEFAULT
41 # search for translations and repare to install
42 translation_files = []
43 for mofile in glob.glob('data/locale/*/LC_MESSAGES/gpodder.mo'):
44 modir = os.path.dirname(mofile).replace('data', 'share')
45 translation_files.append((modir, [mofile]))
47 if not len(translation_files) and not 'clean' in sys.argv:
48 print >>sys.stderr, """
49 Warning: No translation files. (Did you forget to run "make messages"?)
50 """
52 # files to install
53 inst_manpages = glob.glob( 'doc/man/*.1')
54 inst_share_ui = glob.glob('data/ui/*.ui')
55 inst_share_ui_desktop = glob.glob('data/ui/desktop/*.ui')
56 inst_share_ui_maemo = glob.glob('data/ui/maemo/*.ui')
57 inst_share_gpodder = [ 'data/credits.txt' ]
58 inst_desktop = [ 'data/gpodder.desktop' ]
59 inst_desktop_maemo = [ 'data/maemo/gpodder.desktop' ]
61 inst_icons = [ 'data/gpodder.png' ]
62 inst_icons_64 = [ 'data/icons/64/gpodder.png' ]
63 inst_icons_40 = [ 'data/icons/40/gpodder.png' ]
64 inst_icons_26 = [ 'data/icons/26/gpodder.png' ]
65 inst_icons_24 = [ 'data/icons/24/gpodder.png' ]
66 inst_icons_22 = [ 'data/icons/22/gpodder.png' ]
67 inst_icons_16 = [ 'data/icons/16/gpodder.png' ]
68 inst_icons_svg = [ 'data/gpodder.svg' ]
70 data_files = [
71 ('share/man/man1', inst_manpages),
72 ('share/gpodder/ui', inst_share_ui),
73 ('share/pixmaps', inst_icons),
74 ('share/gpodder', inst_share_gpodder),
77 packages = [
78 'gpodder',
79 'gpodder.gtkui',
80 'gpodder.gtkui.interface',
83 # target-specific installation data files
84 if target == DEFAULT:
85 data_files += [
86 ('share/gpodder/ui/desktop', inst_share_ui_desktop),
87 ('share/applications', inst_desktop),
88 ('share/icons/hicolor/scalable/apps', inst_icons_svg),
89 ('share/icons/hicolor/48x48/apps', inst_icons),
90 ('share/icons/hicolor/24x24/apps', inst_icons_24),
91 ('share/icons/hicolor/22x22/apps', inst_icons_22),
92 ('share/icons/hicolor/16x16/apps', inst_icons_16),
94 packages += [
95 'gpodder.gtkui.desktop',
97 elif target == MAEMO:
98 data_files += [
99 ('share/gpodder/ui/maemo', inst_share_ui_maemo),
100 ('share/applications/hildon', inst_desktop_maemo),
101 ('share/icons/hicolor/scalable/apps', inst_icons_64),
102 ('share/icons/hicolor/40x40/apps', inst_icons_40),
103 ('share/icons/hicolor/26x26/apps', inst_icons_26),
105 packages += [
106 'gpodder.gtkui.maemo',
109 author, email = re.match(r'^(.*) <(.*)>$', gpodder.__author__).groups()
111 setup(
112 name = 'gpodder',
113 version = gpodder.__version__,
114 package_dir = { '':'src' },
115 packages = packages,
116 description = 'media aggregator',
117 author = author,
118 author_email = email,
119 url = gpodder.__url__,
120 scripts = glob.glob('bin/*'),
121 data_files = data_files + translation_files