2010-07-08 20:01:03 +02:00
|
|
|
#!/usr/bin/python
|
2010-07-05 06:17:08 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2010-07-06 17:16:41 +02:00
|
|
|
#Created by Mika Bostrom, released into the public domain as far as legally possible.
|
2010-07-05 06:17:08 +02:00
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2010-07-06 17:16:41 +02:00
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2010-07-05 06:17:08 +02:00
|
|
|
|
2009-08-22 16:36:44 +02:00
|
|
|
# Python packaging for fpdb
|
|
|
|
|
|
|
|
from distutils.core import setup
|
2010-08-23 15:35:01 +02:00
|
|
|
from distutils.command.install_data import install_data as INST
|
|
|
|
|
|
|
|
import glob, string, os
|
|
|
|
|
|
|
|
|
|
|
|
class inst_translations(INST):
|
|
|
|
|
|
|
|
# Return triples for installations
|
|
|
|
def __locales(self, rootdir):
|
|
|
|
_globstr = '%s/*/*/*.mo' % rootdir
|
|
|
|
paths = glob.glob(_globstr)
|
|
|
|
_locales = []
|
|
|
|
for p in paths:
|
|
|
|
rp = string.split(p, '/', 2)
|
|
|
|
(lang, loc, mo) = string.split(rp[2], '/')
|
|
|
|
_locales.append( (lang, loc, mo) )
|
|
|
|
return _locales
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
locales = self.__locales('pyfpdb/locale')
|
|
|
|
for (lang, loc, mo_file) in locales:
|
|
|
|
lang_dir = os.path.join('share', 'locale', lang, loc)
|
|
|
|
lang_file = os.path.join('pyfpdb/locale', lang, loc, mo_file)
|
|
|
|
self.data_files.append( (lang_dir, [lang_file]) )
|
|
|
|
INST.run(self)
|
|
|
|
|
|
|
|
|
|
|
|
commands = {
|
|
|
|
'install_data': inst_translations
|
|
|
|
}
|
2009-08-22 16:36:44 +02:00
|
|
|
|
|
|
|
setup(name = 'fpdb',
|
|
|
|
description = 'Free Poker Database',
|
2010-07-08 10:26:16 +02:00
|
|
|
version = '0.20',
|
2009-08-22 16:36:44 +02:00
|
|
|
author = 'FPDB team',
|
|
|
|
author_email = 'fpdb-main@lists.sourceforge.net',
|
|
|
|
packages = ['fpdb'],
|
|
|
|
package_dir = { 'fpdb' : 'pyfpdb' },
|
2010-08-23 15:35:01 +02:00
|
|
|
cmdclass = commands,
|
2009-08-22 16:36:44 +02:00
|
|
|
data_files = [
|
2009-10-21 19:24:46 +02:00
|
|
|
('/usr/share/pixmaps',
|
2009-10-27 14:24:49 +01:00
|
|
|
['gfx/fpdb-icon.png', 'gfx/fpdb-icon2.png',
|
|
|
|
'gfx/fpdb-cards.png'
|
|
|
|
]),
|
2009-10-21 19:24:46 +02:00
|
|
|
('/usr/share/applications',
|
|
|
|
['files/fpdb.desktop']),
|
|
|
|
('/usr/share/python-fpdb',
|
2009-10-23 12:06:33 +02:00
|
|
|
['pyfpdb/logging.conf', 'pyfpdb/Cards01.png',
|
|
|
|
'pyfpdb/HUD_config.xml.example'
|
|
|
|
])
|
2009-10-21 19:24:46 +02:00
|
|
|
]
|
2009-08-22 16:36:44 +02:00
|
|
|
)
|