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 # ('share/dbus-1/services', ['data/mussorgsky.service']),
65 DATA = [('share/applications', ['data/mussorgsky.desktop']),
66 ('share/icons/hicolor/64x64/apps',['data/mussorgsky-icon.png']),
67 ('lib/mussorgsky', ['src/aa_search.py',
74 'src/mussorgsky-qml.py',
75 'src/mutagen_backend.py',
76 'src/player_backend.py',
77 'src/tracker_backend_dbus.py',
79 ('lib/mussorgsky/qml', ["ui/AlbumsPage.qml",
80 "ui/Alternatives.qml",
84 "ui/UIConstants.js"])]
86 setup(name = 'mussorgsky',
88 description = 'Music Organizer: metadata editor, album art downloader',
89 author = 'Ivan Frade',
90 author_email = '<ivan.frade@gmail.com>',
91 url = 'http://mussorgsky.garage.maemo.org',
92 license = 'GPL v2 or later',