Merge branch 'master' into qt
[gc-dialer] / support / builddeb.py
index 6805808..779317c 100755 (executable)
@@ -30,30 +30,33 @@ __email__ = "eopage@byu.net"
 __version__ = constants.__version__
 __build__ = constants.__build__
 __changelog__ = """
-* Fixed a minor packaging issue
+* Fixing a call-out bug
+* Adding error messages to cases that in theory should never be hit but are
+* Protecting some code paths that should never have needed it but do
+* Fixing a bug about not properly recovering from a failed login
 """.strip()
 
 
 __postinstall__ = """#!/bin/sh -e
 
 gtk-update-icon-cache -f /usr/share/icons/hicolor
-rm -f ~/.dialcentral/notifier.log
-rm -f ~/.dialcentral/dialcentral.log
-"""
+rm -f ~/.%(name)s/%(name)s.log
+rm -f ~/.%(name)s/notifier.log
+""" % {"name": constants.__app_name__}
 
 __preremove__ = """#!/bin/sh -e
 
-python /usr/lib/dialcentral/alarm_handler.py -d || true
+python /opt/dialcentral/lib/alarm_handler.py -d || true
 """
 
 
-def find_files(path):
+def find_files(prefix, path):
        for root, dirs, files in os.walk(path):
                for file in files:
-                       if file.startswith("src-"):
+                       if file.startswith(prefix+"-"):
                                fileParts = file.split("-")
                                unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
-                               assert unused == "src"
+                               assert unused == prefix
                                relPath = os.sep.join(relPathParts)
                                yield relPath, file, newName
 
@@ -78,21 +81,17 @@ def build_package(distribution):
        p.prettyName = constants.__pretty_app_name__
        p.description = __description__
        p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
-       p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
        p.author = __author__
        p.mail = __email__
        p.license = "lgpl"
        p.depends = ", ".join([
                "python2.6 | python2.5",
-               "python-gtk2 | python2.5-gtk2",
-               "python-xml | python2.5-xml",
-               "python-dbus | python2.5-dbus",
+               "python-simplejson",
        ])
-       maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
        p.depends += {
-               "debian": ", python-glade2",
-               "diablo": maemoSpecificDepends + ", python2.5-conic",
-               "fremantle": maemoSpecificDepends + ", python-glade2, python-alarm",
+               "debian": ", python-qt4",
+               "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
+               "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
        }[distribution]
        p.recommends = ", ".join([
        ])
@@ -113,9 +112,17 @@ def build_package(distribution):
                "diablo": "26x26-dialcentral.png",
                "fremantle": "64x64-dialcentral.png", # Fremantle natively uses 48x48
        }[distribution]
-       p["/usr/bin"] = [ "dialcentral.py" ]
-       for relPath, files in unflatten_files(find_files(".")).iteritems():
-               fullPath = "/usr/lib/dialcentral"
+       p["/opt/%s/bin" % __appname__] = [ "%s.py" % __appname__ ]
+       for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
+               fullPath = "/opt/%s/lib" % __appname__
+               if relPath:
+                       fullPath += os.sep+relPath
+               p[fullPath] = list(
+                       "|".join((oldName, newName))
+                       for (oldName, newName) in files
+               )
+       for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
+               fullPath = "/opt/%s/share" % __appname__
                if relPath:
                        fullPath += os.sep+relPath
                p[fullPath] = list(