All distros bump to 1.0.7-6
[ejpi] / setup.py
index 1e25ab3..8387afc 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,34 @@ except ImportError:
        print 'sdist_maemo command not available'
 
 from distutils.core import setup
-from ejpi import constants
+
+
+#[[[cog
+#      import cog
+#      from ejpi import constants
+#      cog.outl('APP_NAME="%s"' % constants.__app_name__)
+#      cog.outl('PRETTY_APP_NAME="%s"' % constants.__pretty_app_name__)
+#      cog.outl('VERSION="%s"' % constants.__version__)
+#      cog.outl('BUILD="%s"' % constants.__build__)
+#      cog.outl('DESKTOP_FILE_PATH="%s"' % DESKTOP_FILE_PATH)
+#      cog.outl('INPUT_DESKTOP_FILE="%s"' % INPUT_DESKTOP_FILE)
+#      cog.outl('ICON_CATEGORY="%s"' % ICON_CATEGORY)
+#      cog.outl('ICON_SIZES=[%s]' % ICON_SIZES)
+#]]]
+APP_NAME="ejpi"
+PRETTY_APP_NAME="e**(j pi) + 1 = 0"
+VERSION="1.0.6"
+BUILD="9"
+DESKTOP_FILE_PATH="/usr/share/applications"
+INPUT_DESKTOP_FILE="data/ubuntu/ejpi.desktop"
+ICON_CATEGORY="apps"
+ICON_SIZES=[32,48]
+#[[[end]]] (checksum: fb3742cf699ff6d0e1aab0ec61d503e7)
+
+CHANGES = """* Support for PySide
+* XDG Support
+""".strip()
+BUGTRACKER_URL = "https://bugs.maemo.org/enter_bug.cgi?product=ejpi"
 
 
 def is_package(path):
@@ -42,13 +69,9 @@ def find_packages(path, base="", includeRoot=False):
                                yield mname
 
 
-changes = ""
-icon = "data/%s.png" % constants.__app_name__
-
-
 setup(
-       name=constants.__app_name__,
-       version=constants.__version__,
+       name=APP_NAME,
+       version=VERSION,
        description="RPN calculator designed for touchscreens",
        long_description="RPN calculator designed for touchscreens",
        author="Ed Page",
@@ -60,77 +83,86 @@ setup(
        scripts=[
                "ejpi-calc",
        ],
-       packages=list(find_packages(constants.__app_name__, includeRoot=True)),
+       packages=list(find_packages(APP_NAME, includeRoot=True)),
+       package_data={
+               "ejpi.plugins": ["*.ini", "images/*.png"],
+       },
        data_files=[
-               #[[[cog
-               #       import cog
-               #       cog.outl('              ("%s", ["data/%%s.desktop" %% constants.__app_name__]),' % desktopFilePath)
-               #]]]
-               ("/usr/share/applications", ["data/%s.desktop" % constants.__app_name__]),
-               #[[[end]]]
-               ("/usr/share/icons/hicolor/22x22/apps", ["data/icons/22/%s.png" % constants.__app_name__]),
-               ("/usr/share/icons/hicolor/28x28/apps", ["data/icons/28/%s.png" % constants.__app_name__]),
-               ("/usr/share/icons/hicolor/32x32/apps", ["data/icons/32/%s.png" % constants.__app_name__]),
-               ("/usr/share/icons/hicolor/48x48/apps", ["data/icons/48/%s.png" % constants.__app_name__]),
-               ("/usr/share/icons/hicolor/scalable/apps", ["data/%s.svg" % constants.__app_name__]),
+               (DESKTOP_FILE_PATH, [INPUT_DESKTOP_FILE]),
+               ("/usr/share/icons/hicolor/scalable/apps", ["data/%s.svg" % APP_NAME]),
+       ] +
+       [
+               (
+                       "/usr/share/icons/hicolor/%sx%s/%s" % (size, size, ICON_CATEGORY),
+                       ["data/icons/%s/%s.png" % (size, APP_NAME)]
+               )
+               for size in ICON_SIZES
        ],
        requires=[
                "PySide",
+               "pyxdg",
        ],
        cmdclass={
+               'sdist_ubuntu': sdist_maemo,
                'sdist_diablo': sdist_maemo,
                'sdist_fremantle': sdist_maemo,
                'sdist_harmattan': sdist_maemo,
        },
        options={
+               "sdist_ubuntu": {
+                       "debian_package": APP_NAME,
+                       "section": "math",
+                       "copyright": "lgpl",
+                       "changelog": CHANGES,
+                       "buildversion": str(BUILD),
+                       "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg",
+                       "architecture": "any",
+               },
                "sdist_diablo": {
-                       "debian_package": constants.__app_name__,
-                       "Maemo_Display_Name": constants.__pretty_app_name__,
-                       #"Maemo_Upgrade_Description": changes,
-                       "Maemo_Bugtracker": "https://bugs.maemo.org/enter_bug.cgi?product=ejpi",
-                       "Maemo_Icon_26": "data/icons/48/%s.png" % constants.__app_name__,
-                       "MeeGo_Desktop_Entry_Filename": constants.__app_name__,
-                       #"MeeGo_Desktop_Entry": "",
+                       "debian_package": APP_NAME,
+                       "Maemo_Display_Name": PRETTY_APP_NAME,
+                       #"Maemo_Upgrade_Description": CHANGES,
+                       "Maemo_Bugtracker": BUGTRACKER_URL,
+                       "Maemo_Icon_26": "data/icons/26/%s.png" % APP_NAME,
                        "section": "user/science",
                        "copyright": "lgpl",
-                       "changelog": changes,
-                       "buildversion": str(constants.__build__),
-                       "depends": "python, python-qt4-core, python-qt4-gui",
+                       "changelog": CHANGES,
+                       "buildversion": str(BUILD),
+                       "depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python-xdg, python-simplejson",
                        "architecture": "any",
                },
                "sdist_fremantle": {
-                       "debian_package": constants.__app_name__,
-                       "Maemo_Display_Name": constants.__pretty_app_name__,
-                       #"Maemo_Upgrade_Description": changes,
-                       "Maemo_Bugtracker": "https://bugs.maemo.org/enter_bug.cgi?product=ejpi",
-                       "Maemo_Icon_26": "data/icons/48/%s.png" % constants.__app_name__,
-                       "MeeGo_Desktop_Entry_Filename": constants.__app_name__,
-                       #"MeeGo_Desktop_Entry": "",
+                       "debian_package": APP_NAME,
+                       "Maemo_Display_Name": PRETTY_APP_NAME,
+                       #"Maemo_Upgrade_Description": CHANGES,
+                       "Maemo_Bugtracker": BUGTRACKER_URL,
+                       "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
                        "section": "user/science",
                        "copyright": "lgpl",
-                       "changelog": changes,
-                       "buildversion": str(constants.__build__),
-                       "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.maemo5",
+                       "changelog": CHANGES,
+                       "buildversion": str(BUILD),
+                       #"depends": "python2.5, python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5, python-xdg",
+                       "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtmaemo5, python-xdg, python-simplejson",
                        "architecture": "any",
                },
                "sdist_harmattan": {
-                       "debian_package": constants.__app_name__,
-                       "Maemo_Display_Name": constants.__pretty_app_name__,
-                       #"Maemo_Upgrade_Description": changes,
-                       "Maemo_Bugtracker": "https://bugs.maemo.org/enter_bug.cgi?product=ejpi",
-                       "Maemo_Icon_26": "data/icons/26/%s.png" % constants.__app_name__,
-                       "MeeGo_Desktop_Entry_Filename": constants.__app_name__,
+                       "debian_package": APP_NAME,
+                       "Maemo_Display_Name": PRETTY_APP_NAME,
+                       #"Maemo_Upgrade_Description": CHANGES,
+                       "Maemo_Bugtracker": BUGTRACKER_URL,
+                       "Maemo_Icon_26": "data/icons/48/%s.png" % APP_NAME,
+                       "MeeGo_Desktop_Entry_Filename": APP_NAME,
                        #"MeeGo_Desktop_Entry": "",
                        "section": "user/science",
                        "copyright": "lgpl",
-                       "changelog": changes,
-                       "buildversion": str(constants.__build__),
-                       "depends": "python, python-pyside.qtcore, python-pyside.qtgui",
+                       "changelog": CHANGES,
+                       "buildversion": str(BUILD),
+                       "depends": "python, python-pyside.qtcore, python-pyside.qtgui, python-xdg",
                        "architecture": "any",
                },
                "bdist_rpm": {
                        "requires": "REPLACEME",
-                       "icon": icon,
+                       "icon": "data/icons/48/%s.png" % APP_NAME,
                        "group": "REPLACEME",
                },
        },