Mon, 12 May 2008 11:04:53 +0200 <thp@perli.net>
[gpodder/nikosapi.git] / setup.py
blob4eae814915a2ecf01aa3f700a39136f97e4bdaff
1 #!/usr/bin/env python
4 # gPodder - A media aggregator and podcast client
5 # Copyright (c) 2005-2008 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 from distutils.core import setup
25 # build targets
26 (DEFAULT, MAEMO) = range(2)
28 # read the version from the gpodder main program
29 gpodder_version = os.popen( "cat bin/gpodder |grep ^__version__.*=|cut -d\\\" -f2").read().strip()
31 # translations
32 languages = [ "de", "fr", "sv", "it", "pt", "es", "nl", "ru", "uk", "gl", "cs" ]
33 translation_files = []
35 # build target
36 if 'TARGET' in os.environ:
37 if os.environ['TARGET'].strip().lower() == 'maemo':
38 target = MAEMO
39 else:
40 target = DEFAULT
42 # add translated files to translations dictionary
43 for l in languages:
44 translation_files.append( ("share/locale/%s/LC_MESSAGES" % l, [ "data/locale/%s/LC_MESSAGES/gpodder.mo" % l ]) )
46 # files to install
47 inst_manpages = glob.glob( 'doc/man/*.1')
48 inst_share = [ 'data/gpodder.glade' ]
49 inst_desktop = [ 'data/gpodder.desktop' ]
50 inst_desktop_maemo = [ 'data/maemo/gpodder.desktop' ]
52 inst_icons = [ 'data/gpodder.png' ]
53 inst_icons_64 = [ 'data/icons/64/gpodder.png' ]
54 inst_icons_40 = [ 'data/icons/40/gpodder.png' ]
55 inst_icons_26 = [ 'data/icons/26/gpodder.png' ]
56 inst_icons_24 = [ 'data/icons/24/gpodder.png' ]
57 inst_icons_22 = [ 'data/icons/22/gpodder.png' ]
58 inst_icons_16 = [ 'data/icons/16/gpodder.png' ]
59 inst_icons_svg = [ 'data/gpodder.svg' ]
61 data_files = [
62 ('share/man/man1', inst_manpages),
63 ('share/gpodder', inst_share),
64 ('share/pixmaps', inst_icons),
67 # target-specific installation data files
68 if target == DEFAULT:
69 data_files += [
70 ('share/applications', inst_desktop),
71 ('share/icons/hicolor/scalable/apps', inst_icons_svg),
72 ('share/icons/hicolor/48x48/apps', inst_icons),
73 ('share/icons/hicolor/24x24/apps', inst_icons_24),
74 ('share/icons/hicolor/22x22/apps', inst_icons_22),
75 ('share/icons/hicolor/16x16/apps', inst_icons_16),
77 elif target == MAEMO:
78 data_files += [
79 ('share/applications/hildon', inst_desktop_maemo),
80 ('share/icons/hicolor/scalable/apps', inst_icons_64),
81 ('share/icons/hicolor/40x40/apps', inst_icons_40),
82 ('share/icons/hicolor/26x26/apps', inst_icons_26),
86 setup(
87 name = 'gpodder',
88 version = gpodder_version,
89 package_dir = { '':'src' },
90 packages = [ 'gpodder' ],
91 description = 'media aggregator',
92 author = 'Thomas Perl',
93 author_email = 'thp@thpinfo.com',
94 url = 'http://www.gpodder.org/',
95 scripts = [ 'bin/gpodder' ],
96 data_files = data_files + translation_files