2007-03-18 17:11:34 +01:00
|
|
|
#!/usr/bin/env python
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2006-04-07 22:22:30 +02:00
|
|
|
#
|
2007-08-29 20:30:26 +02:00
|
|
|
# gPodder - A media aggregator and podcast client
|
2009-02-01 21:22:21 +01:00
|
|
|
# Copyright (c) 2005-2009 Thomas Perl and the gPodder Team
|
2006-04-07 22:22:30 +02:00
|
|
|
#
|
2007-08-29 20:30:26 +02:00
|
|
|
# gPodder is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2006-04-07 22:22:30 +02:00
|
|
|
#
|
2007-08-29 20:30:26 +02:00
|
|
|
# gPodder is distributed in the hope that it will be useful,
|
2006-04-07 22:22:30 +02:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-29 20:30:26 +02:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-04-07 22:22:30 +02:00
|
|
|
#
|
2005-11-21 19:21:25 +01:00
|
|
|
|
|
|
|
import glob
|
|
|
|
import os
|
2009-05-07 16:26:07 +02:00
|
|
|
import re
|
|
|
|
import sys
|
2005-11-21 19:21:25 +01:00
|
|
|
from distutils.core import setup
|
|
|
|
|
2008-04-06 02:19:03 +02:00
|
|
|
# build targets
|
|
|
|
(DEFAULT, MAEMO) = range(2)
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2009-05-07 16:26:07 +02:00
|
|
|
# import the gpodder module locally for module metadata
|
|
|
|
sys.path.insert(0, 'src')
|
|
|
|
import gpodder
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2008-04-06 02:19:03 +02:00
|
|
|
# build target
|
|
|
|
if 'TARGET' in os.environ:
|
|
|
|
if os.environ['TARGET'].strip().lower() == 'maemo':
|
|
|
|
target = MAEMO
|
|
|
|
else:
|
|
|
|
target = DEFAULT
|
|
|
|
|
2009-05-07 16:26:07 +02:00
|
|
|
# search for translations and repare to install
|
|
|
|
translation_files = []
|
|
|
|
for mofile in glob.glob('data/locale/*/LC_MESSAGES/gpodder.mo'):
|
|
|
|
modir = os.path.dirname(mofile).replace('data', 'share')
|
|
|
|
translation_files.append((modir, [mofile]))
|
|
|
|
|
|
|
|
if not len(translation_files) and not 'clean' in sys.argv:
|
|
|
|
print >>sys.stderr, """
|
|
|
|
Warning: No translation files. (Did you forget to run "make messages"?)
|
|
|
|
"""
|
2006-04-05 17:00:31 +02:00
|
|
|
|
|
|
|
# files to install
|
2005-11-21 19:21:25 +01:00
|
|
|
inst_manpages = glob.glob( 'doc/man/*.1')
|
2009-05-08 14:28:53 +02:00
|
|
|
inst_share_ui = glob.glob('data/ui/*.ui')
|
2009-09-02 00:05:51 +02:00
|
|
|
inst_share_ui_desktop = glob.glob('data/ui/desktop/*.ui')
|
|
|
|
inst_share_ui_maemo = glob.glob('data/ui/maemo/*.ui')
|
2009-08-24 20:59:21 +02:00
|
|
|
inst_share_gpodder = [ 'data/credits.txt' ]
|
|
|
|
inst_desktop = [ 'data/gpodder.desktop' ]
|
|
|
|
inst_desktop_maemo = [ 'data/maemo/gpodder.desktop' ]
|
2005-11-21 19:21:25 +01:00
|
|
|
|
2007-03-25 21:55:28 +02:00
|
|
|
inst_icons = [ 'data/gpodder.png' ]
|
2008-04-07 23:05:52 +02:00
|
|
|
inst_icons_64 = [ 'data/icons/64/gpodder.png' ]
|
2008-04-06 02:19:03 +02:00
|
|
|
inst_icons_40 = [ 'data/icons/40/gpodder.png' ]
|
|
|
|
inst_icons_26 = [ 'data/icons/26/gpodder.png' ]
|
2007-03-25 21:55:28 +02:00
|
|
|
inst_icons_24 = [ 'data/icons/24/gpodder.png' ]
|
|
|
|
inst_icons_22 = [ 'data/icons/22/gpodder.png' ]
|
|
|
|
inst_icons_16 = [ 'data/icons/16/gpodder.png' ]
|
|
|
|
inst_icons_svg = [ 'data/gpodder.svg' ]
|
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
data_files = [
|
|
|
|
('share/man/man1', inst_manpages),
|
2009-05-08 14:28:53 +02:00
|
|
|
('share/gpodder/ui', inst_share_ui),
|
2008-04-07 11:47:49 +02:00
|
|
|
('share/pixmaps', inst_icons),
|
2009-08-24 20:59:21 +02:00
|
|
|
('share/gpodder', inst_share_gpodder),
|
2005-11-21 19:21:25 +01:00
|
|
|
]
|
|
|
|
|
2008-04-06 02:19:03 +02:00
|
|
|
# target-specific installation data files
|
|
|
|
if target == DEFAULT:
|
|
|
|
data_files += [
|
2009-09-02 00:05:51 +02:00
|
|
|
('share/gpodder/ui/desktop', inst_share_ui_desktop),
|
2008-04-06 02:19:03 +02:00
|
|
|
('share/applications', inst_desktop),
|
|
|
|
('share/icons/hicolor/scalable/apps', inst_icons_svg),
|
|
|
|
('share/icons/hicolor/48x48/apps', inst_icons),
|
|
|
|
('share/icons/hicolor/24x24/apps', inst_icons_24),
|
|
|
|
('share/icons/hicolor/22x22/apps', inst_icons_22),
|
|
|
|
('share/icons/hicolor/16x16/apps', inst_icons_16),
|
|
|
|
]
|
|
|
|
elif target == MAEMO:
|
|
|
|
data_files += [
|
2009-09-02 00:05:51 +02:00
|
|
|
('share/gpodder/ui/maemo', inst_share_ui_maemo),
|
2008-04-06 02:19:03 +02:00
|
|
|
('share/applications/hildon', inst_desktop_maemo),
|
2008-04-07 23:05:52 +02:00
|
|
|
('share/icons/hicolor/scalable/apps', inst_icons_64),
|
2008-04-06 02:19:03 +02:00
|
|
|
('share/icons/hicolor/40x40/apps', inst_icons_40),
|
|
|
|
('share/icons/hicolor/26x26/apps', inst_icons_26),
|
|
|
|
]
|
|
|
|
|
2009-05-07 16:26:07 +02:00
|
|
|
author, email = re.match(r'^(.*) <(.*)>$', gpodder.__author__).groups()
|
2008-04-06 02:19:03 +02:00
|
|
|
|
2005-11-21 19:21:25 +01:00
|
|
|
setup(
|
2006-04-05 17:00:31 +02:00
|
|
|
name = 'gpodder',
|
2009-05-07 16:26:07 +02:00
|
|
|
version = gpodder.__version__,
|
2005-11-21 19:21:25 +01:00
|
|
|
package_dir = { '':'src' },
|
2009-08-24 19:31:58 +02:00
|
|
|
packages = [
|
|
|
|
'gpodder',
|
|
|
|
'gpodder.gtkui',
|
|
|
|
'gpodder.gtkui.interface',
|
|
|
|
'gpodder.gtkui.maemo',
|
|
|
|
],
|
2006-04-05 17:00:31 +02:00
|
|
|
description = 'media aggregator',
|
2009-05-07 16:26:07 +02:00
|
|
|
author = author,
|
|
|
|
author_email = email,
|
|
|
|
url = gpodder.__url__,
|
|
|
|
scripts = glob.glob('bin/*'),
|
2006-04-05 17:00:31 +02:00
|
|
|
data_files = data_files + translation_files
|
2005-11-21 19:21:25 +01:00
|
|
|
)
|
|
|
|
|