4 # gPodder - A media aggregator and podcast client
5 # Copyright (c) 2005-2010 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/>.
25 from distutils
.core
import setup
28 (DEFAULT
, MAEMO
) = range(2)
30 # import the gpodder module locally for module metadata
31 sys
.path
.insert(0, 'src')
34 # if we are running "setup.py sdist", include all targets (see below)
35 building_source
= ('sdist' in sys
.argv
)
38 if 'TARGET' in os
.environ
:
39 if os
.environ
['TARGET'].strip().lower() == 'maemo':
44 # search for translations and repare to install
45 translation_files
= []
46 for mofile
in glob
.glob('data/locale/*/LC_MESSAGES/gpodder.mo'):
47 modir
= os
.path
.dirname(mofile
).replace('data', 'share')
48 translation_files
.append((modir
, [mofile
]))
50 if not len(translation_files
) and not 'clean' in sys
.argv
:
51 print >>sys
.stderr
, """
52 Warning: No translation files. (Did you forget to run "make messages"?)
56 inst_manpages
= glob
.glob( 'doc/man/*.1')
57 inst_share_ui
= glob
.glob('data/ui/*.ui')
58 inst_share_ui_desktop
= glob
.glob('data/ui/desktop/*.ui')
59 inst_share_ui_maemo
= glob
.glob('data/ui/maemo/*.ui')
60 inst_share_ui_frmntl
= glob
.glob('data/ui/frmntl/*.ui')
61 inst_share_gpodder
= [ 'data/credits.txt' ]
62 inst_desktop
= [ 'data/gpodder.desktop' ]
63 inst_desktop_maemo
= [ 'data/maemo/gpodder.desktop' ]
64 inst_share_dbus_services
= ['data/org.gpodder.service']
66 inst_icons
= [ 'data/gpodder.png' ]
67 inst_icons_64
= [ 'data/icons/64/gpodder.png' ]
68 inst_icons_40
= [ 'data/icons/40/gpodder.png' ]
69 inst_icons_26
= [ 'data/icons/26/gpodder.png' ]
70 inst_icons_24
= [ 'data/icons/24/gpodder.png' ]
71 inst_icons_22
= [ 'data/icons/22/gpodder.png' ]
72 inst_icons_16
= [ 'data/icons/16/gpodder.png' ]
73 inst_icons_svg
= [ 'data/gpodder.svg' ]
76 ('share/man/man1', inst_manpages
),
77 ('share/gpodder/ui', inst_share_ui
),
78 ('share/pixmaps', inst_icons
),
79 ('share/gpodder', inst_share_gpodder
),
80 ('share/dbus-1/services',inst_share_dbus_services
),
86 'gpodder.gtkui.interface',
89 # target-specific installation data files
90 if target
== DEFAULT
or building_source
:
92 ('share/gpodder/ui/desktop', inst_share_ui_desktop
),
93 ('share/applications', inst_desktop
),
94 ('share/icons/hicolor/scalable/apps', inst_icons_svg
),
95 ('share/icons/hicolor/48x48/apps', inst_icons
),
96 ('share/icons/hicolor/24x24/apps', inst_icons_24
),
97 ('share/icons/hicolor/22x22/apps', inst_icons_22
),
98 ('share/icons/hicolor/16x16/apps', inst_icons_16
),
101 'gpodder.gtkui.desktop',
103 additional_scripts
= []
105 if target
== MAEMO
or building_source
:
107 ('share/gpodder/ui/maemo', inst_share_ui_maemo
),
108 ('share/gpodder/ui/frmntl', inst_share_ui_frmntl
),
109 ('share/applications/hildon', inst_desktop_maemo
),
110 ('share/icons/hicolor/scalable/apps', inst_icons_64
),
111 ('share/icons/hicolor/40x40/apps', inst_icons_40
),
112 ('share/icons/hicolor/26x26/apps', inst_icons_26
),
115 'gpodder.gtkui.maemo',
116 'gpodder.gtkui.frmntl',
118 additional_scripts
= [
119 'data/maemo/gpodder-mplayer',
122 author
, email
= re
.match(r
'^(.*) <(.*)>$', gpodder
.__author
__).groups()
126 version
= gpodder
.__version
__,
127 package_dir
= { '':'src' },
129 description
= 'media aggregator',
131 author_email
= email
,
132 url
= gpodder
.__url
__,
133 scripts
= glob
.glob('bin/*') + additional_scripts
,
134 data_files
= data_files
+ translation_files