from distutils.core import setup from distutils.command.build import build import os, glob class BuildQm(build): for po in glob.glob('po/*.po'): os.system('lconvert {} -o i18n/mageiawelcome_{}.ts'.format(po, os.path.splitext(os.path.basename(po))[0])) for ts in glob.glob('i18n/*.ts'): os.system('lrelease {0} -qm {1}'.format(ts, (ts[:-2]+'qm'))) os.system("rm -f i18n/*.ts") os.system('msgfmt --desktop --template=usr/share/applications/template_mageiawelcome.desktop -d po -o usr/share/applications/mageiawelcome.desktop') data_files = [("bin",["usr/bin/mageiawelcome","usr/bin/mageiawelcome-launcher"]), ("share/applications/", ["usr/share/applications/mageiawelcome.desktop"]), ("share/icons/hicolor/scalable/apps/", ["qml/icons/scalable/apps/mageiawelcome.svg"]), ("share/mageiawelcome/",glob.glob('qml/*.py')), ("share/mageiawelcome/",glob.glob('qml/*.qml')), ("share/mageiawelcome/img",glob.glob('qml/img/*.png')), ("share/mageiawelcome/translations/",glob.glob('i18n/*.qm')), ("etc/xdg/autostart/",["etc/xdg/autostart/mageiawelcome.desktop"]), ] setup( name = 'mageiawelcome', version = '1.20', license = 'GNU General Public License v3 (GPLv3)', url = 'http://gitweb.mageia.org/software/mageiawelcome', description = 'Welcome Screen shows important information of the Mageia distribution.', platforms = ['Linux'], author = 'Daniel Napora', author_email = 'napcok@gmail.com', data_files = data_files, cmdclass = {'build_qm': BuildQm,}, )