Cleanup: removal of mer, making things cleaner, etc
[quicknote] / support / builddeb.py
index c3455e6..4e83f67 100755 (executable)
@@ -10,13 +10,44 @@ except ImportError:
 
 import constants
 
+
 __appname__ = constants.__app_name__
-__description__ = "Simple note taking application in a similar vein as PalmOS Memos"
+__description__ = """Simple note taking application in a similar vein as PalmOS Memos
+.
+Homepage: http://quicknote.garage.maemo.org/
+"""
 __author__ = "Christoph Wurstle"
 __email__ = "n800@axique.net"
 __version__ = constants.__version__
-__build__ = 0
-__changelog__ = '''
+__build__ = constants.__build__
+__changelog__ = """
+0.7.11
+ * Tiny speed improvement to startup
+
+0.7.10
+ * Moved history to the (app)menu
+ * Moved search to Ctrl+f and (app)menu
+ * Switched category selection over to a touch selector entry, making it prettier and easier
+ * Deleting empty notes no longer prompts the user
+ * Cleaned up the history dialog a smidge
+ * Ctrl+w/q to quit
+ * Bug fix: not very consistent when a category is visible in dialogs
+
+0.7.9
+ * UI Tweak: Removed "New Note..." due to weirdness and duplicated behavior
+ * UI Tweak: Added App Menu to access some category functionality
+ * Bugfix: Move To Category
+ * Bugfix: Removed carriage return on Ctrl+Enter
+ * Added .deb package support
+
+0.7.8
+ * Spell checking (Desktop only)
+ * Fixing the application title
+ * Fremantle Support
+ * Ctrl+i and Ctrl+o to zoom in/out the interface
+ * Ctrl+enter to fullscreen app
+ * Ctrl+l to copy to clipboard the application debug log
+
 0.7.7
  * Slight modifications to the note history and SQL dialogs
  * On zoom, also hiding the history status and button
@@ -43,14 +74,14 @@ __changelog__ = '''
 
 0.7.0
   * Initial Release.
-'''
+"""
 
 
-__postinstall__ = '''#!/bin/sh -e
+__postinstall__ = """#!/bin/sh -e
 
 gtk-update-icon-cache -f /usr/share/icons/hicolor
-exit 0
-'''
+rm -f ~/.quicknote/quicknote.log
+"""
 
 
 def find_files(path, root):
@@ -75,26 +106,49 @@ def unflatten_files(files):
        return d
 
 
-if __name__ == "__main__":
+def build_package(distribution):
        try:
                os.chdir(os.path.dirname(sys.argv[0]))
        except:
                pass
 
+       py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
        p = py2deb.Py2deb(__appname__)
+       p.prettyName = constants.__pretty_app_name__
        p.description = __description__
+       p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=quicknote"
+       p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
        p.author = __author__
        p.mail = __email__
-       p.license = "lgpl"
-       p.depends = "python2.5, python2.5-gtk2"
-       p.section = "user/other"
+       p.license = "gpl"
+       p.depends = ", ".join([
+               "python2.6 | python2.5",
+               "python-gtk2 | python2.5-gtk2",
+               "python-xml | python2.5-xml",
+               "python-dbus | python2.5-dbus",
+       ])
+       maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
+       p.depends += {
+               "debian": ", python-glade2",
+               "diablo": maemoSpecificDepends,
+               "fremantle": maemoSpecificDepends + ", python-glade2",
+       }[distribution]
+       p.section = {
+               "debian": "editors",
+               "diablo": "user/office",
+               "fremantle": "user/office",
+       }[distribution]
        p.arch = "all"
        p.urgency = "low"
-       p.distribution = "chinook diablo"
+       p.distribution = "diablo fremantle debian"
        p.repository = "extras"
        p.changelog = __changelog__
        p.postinstall = __postinstall__
-       p.icon = "26x26-quicknote.png"
+       p.icon = {
+               "debian": "26x26-quicknote.png",
+               "diablo": "26x26-quicknote.png",
+               "fremantle": "48x48-quicknote.png", # Fremantle natively uses 48x48
+       }[distribution]
        p["/usr/bin"] = [ "quicknote.py" ]
        for relPath, files in unflatten_files(find_files(".", "locale")).iteritems():
                fullPath = "/usr/share/locale"
@@ -113,14 +167,46 @@ if __name__ == "__main__":
                        for (oldName, newName) in files
                )
        p["/usr/share/applications/hildon"] = ["quicknote.desktop"]
-       p["/usr/share/dbus-1/services"] = ["quicknote.service"]
        p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-quicknote.png|quicknote.png"]
        p["/usr/share/icons/hicolor/40x40/hildon"] = ["40x40-quicknote.png|quicknote.png"]
        p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-quicknote.png|quicknote.png"]
        p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-quicknote.png|quicknote.png"]
 
-       print p
-       print p.generate(
-               __version__, __build__, changelog=__changelog__,
-               tar=True, dsc=True, changes=True, build=False, src=True
-       )
+       if distribution == "debian":
+               print p
+               print p.generate(
+                       version="%s-%s" % (__version__, __build__),
+                       changelog=__changelog__,
+                       build=True,
+                       tar=False,
+                       changes=False,
+                       dsc=False,
+               )
+               print "Building for %s finished" % distribution
+       else:
+               print p
+               print p.generate(
+                       version="%s-%s" % (__version__, __build__),
+                       changelog=__changelog__,
+                       build=False,
+                       tar=True,
+                       changes=True,
+                       dsc=True,
+               )
+               print "Building for %s finished" % distribution
+
+
+if __name__ == "__main__":
+       if len(sys.argv) > 1:
+               try:
+                       import optparse
+               except ImportError:
+                       optparse = None
+
+               if optparse is not None:
+                       parser = optparse.OptionParser()
+                       (commandOptions, commandArgs) = parser.parse_args()
+       else:
+               commandArgs = None
+               commandArgs = ["diablo"]
+       build_package(commandArgs[0])