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 import install as _install
7 from distutils.command.install_data import install_data as _install_data
8 from distutils.command.build import build as _build
13 class build_trans(cmd.Command):
14 description = 'Compile .po files into .mo files'
15 def initialize_options(self):
18 def finalize_options(self):
22 po_dir = os.path.join(os.path.dirname(os.curdir), 'po')
23 for path, names, filenames in os.walk(po_dir):
27 src = os.path.join(path, f)
28 dest_path = os.path.join('build', 'locale', lang, 'LC_MESSAGES')
29 dest = os.path.join(dest_path, 'mussorgsky.mo')
30 if not os.path.exists(dest_path):
31 os.makedirs(dest_path)
32 if not os.path.exists(dest):
33 print 'Compiling %s' % src
34 msgfmt.make(src, dest)
36 src_mtime = os.stat(src)[8]
37 dest_mtime = os.stat(dest)[8]
38 if src_mtime > dest_mtime:
39 print 'Compiling %s' % src
40 msgfmt.make(src, dest)
43 sub_commands = _build.sub_commands + [('build_trans', None)]
47 class install_data(_install_data):
50 for lang in os.listdir('build/locale/'):
51 lang_dir = os.path.join('share', 'locale', lang, 'LC_MESSAGES')
52 lang_file = os.path.join('build', 'locale', lang, 'LC_MESSAGES', 'mussorgsky.mo')
53 self.data_files.append( (lang_dir, [lang_file]) )
54 _install_data.run(self)
58 'build_trans': build_trans,
59 'install_data': install_data,
62 SCRIPTS= ['data/mussorgsky']
64 DATA = [('share/applications/hildon', ['data/mussorgsky.desktop']),
65 ('share/dbus-1/services', ['data/mussorgsky.service']),
66 ('share/pixmaps',['data/mussorgsky-icon.png']),
67 ('lib/mussorgsky', ['src/aa_selection_dialog.py',
68 'src/album_art_panel.py',
69 'src/album_art_spec.py',
70 'src/album_art_thread.py',
71 'src/browse_panel.py',
72 'src/download_dialog.py',
73 'src/edit_panel_tm.py',
74 'src/fancy_button.py',
76 'src/mutagen_backend.py',
77 'src/player_backend.py',
78 'src/tracker_backend.py',
82 setup(name = 'mussorgsky',
84 description = 'Music Organizer: metadata editor, album art downloader',
85 author = 'Ivan Frade',
86 author_email = '<ivan.frade@gmail.com>',
87 url = 'http://mussorgsky.garage.maemo.org',
88 license = 'GPL v2 or later',