1 #!/usr/bin/env python2.5
3 from distutils.core import setup
4 from distutils.core import setup
5 from distutils import cmd
6 from distutils.command.install_data import install_data as _install_data
7 from distutils.command.build import build as _build
12 class build_trans(cmd.Command):
13 description = 'Compile .po files into .mo files'
14 def initialize_options(self):
17 def finalize_options(self):
21 po_dir = os.path.join(os.path.dirname(os.curdir), 'po')
22 for path, names, filenames in os.walk(po_dir):
26 src = os.path.join(path, f)
27 dest_path = os.path.join('build', 'locale', lang, 'LC_MESSAGES')
28 dest = os.path.join(dest_path, 'mussorgsky.mo')
29 if not os.path.exists(dest_path):
30 os.makedirs(dest_path)
31 if not os.path.exists(dest):
32 print 'Compiling %s' % src
33 msgfmt.make(src, dest)
35 src_mtime = os.stat(src)[8]
36 dest_mtime = os.stat(dest)[8]
37 if src_mtime > dest_mtime:
38 print 'Compiling %s' % src
39 msgfmt.make(src, dest)
42 sub_commands = _build.sub_commands + [('build_trans', None)]
46 class install_data(_install_data):
49 for lang in os.listdir('build/locale/'):
50 lang_dir = os.path.join('share', 'locale', lang, 'LC_MESSAGES')
51 lang_file = os.path.join('build', 'locale', lang, 'LC_MESSAGES', 'mussorgsky.mo')
52 self.data_files.append( (lang_dir, [lang_file]) )
53 _install_data.run(self)
57 'build_trans': build_trans,
58 'install_data': install_data,
61 SCRIPTS= ['data/mussorgsky']
63 DATA = [('share/applications/hildon', ['data/mussorgsky.desktop']),
64 ('share/dbus-1/services', ['data/mussorgsky.service']),
65 ('share/pixmaps',['data/mussorgsky-icon.png']),
66 ('lib/mussorgsky', ['src/aa_selection_dialog.py',
67 'src/album_art_panel.py',
68 'src/album_art_spec.py',
69 'src/album_art_thread.py',
70 'src/browse_panel.py',
71 'src/download_dialog.py',
72 'src/edit_panel_tm.py',
73 'src/fancy_button.py',
75 'src/mutagen_backend.py',
76 'src/player_backend.py',
77 'src/tracker_backend.py',
81 setup(name = 'mussorgsky',
83 description = 'Music Organizer: metadata editor, album art downloader',
84 author = 'Ivan Frade',
85 author_email = '<ivan.frade@gmail.com>',
86 url = 'http://mussorgsky.garage.maemo.org',
87 license = 'GPL v2 or later',