| 1 | #!/usr/bin/env python |
|---|
| 2 | |
|---|
| 3 | import os |
|---|
| 4 | import sys |
|---|
| 5 | import glob |
|---|
| 6 | from distutils.core import setup, Extension |
|---|
| 7 | |
|---|
| 8 | translations = [] |
|---|
| 9 | for po in glob.glob('messages/*.po'): |
|---|
| 10 | translations.append((os.path.join("share", "otolog4linux", "messages"), [po,])) |
|---|
| 11 | mo = "%s.gmo" % os.path.splitext(po)[0] |
|---|
| 12 | os.system("msgfmt -o " + mo + " " + po) |
|---|
| 13 | if os.access(mo, os.F_OK): |
|---|
| 14 | translations.append((os.path.join("share", "otolog4linux", "messages"), [mo,])) |
|---|
| 15 | |
|---|
| 16 | data_files = [ |
|---|
| 17 | ('share/otolog4linux', ['LICENSE', 'README', 'README.ja']), |
|---|
| 18 | ('share/applications', ['data/otolog4linux.desktop']), |
|---|
| 19 | ('share/otolog4linux', ['data/otolog4linux_install.py']), |
|---|
| 20 | ('share/otolog4linux', ['data/otolog4linux_win32.pyw']), |
|---|
| 21 | ('share/icons', ['data/otolog4linux.png', 'data/otolog4linux.wic']), |
|---|
| 22 | ] + translations |
|---|
| 23 | for f in glob.glob('data/plugins/*.py'): |
|---|
| 24 | if os.access(f, os.F_OK): |
|---|
| 25 | data_files.append(('share/otolog4linux/plugins', [f,])) |
|---|
| 26 | |
|---|
| 27 | def scripts(): |
|---|
| 28 | files = [ "otolog4linux" ] |
|---|
| 29 | if sys.platform == "win32" or \ |
|---|
| 30 | (len(sys.argv) >= 2 and sys.argv[1] == 'bdist_wininst'): |
|---|
| 31 | files.append("data/otolog4linux_install.py") |
|---|
| 32 | return files |
|---|
| 33 | |
|---|
| 34 | setup( |
|---|
| 35 | name="otolog4linux", |
|---|
| 36 | url="http://mattn.kaoriya.net/", |
|---|
| 37 | description="otolog controller for linux", |
|---|
| 38 | author="Yasuhiro Matsumoto", |
|---|
| 39 | author_email="mattn.jp@gmail.com", |
|---|
| 40 | version="0.05", |
|---|
| 41 | scripts=scripts(), |
|---|
| 42 | packages=["otolog4linux"], |
|---|
| 43 | package_dir={'otolog4linux': 'src', 'otolog4linux/plugins': 'src/plugins'}, |
|---|
| 44 | data_files=data_files, |
|---|
| 45 | license = 'GPL', |
|---|
| 46 | long_description=""" |
|---|
| 47 | Otolog is music logging service. The music information |
|---|
| 48 | which you are playing in iTunes was distributed from otolog server. |
|---|
| 49 | This application get the information from the un*x multimedia player, |
|---|
| 50 | and post the otolog server. |
|---|
| 51 | """ |
|---|
| 52 | ) |
|---|
| 53 | |
|---|