Making it easier to do distribution specific building
authorepage <eopage@byu.net>
Fri, 7 May 2010 03:31:13 +0000 (03:31 +0000)
committerepage <eopage@byu.net>
Fri, 7 May 2010 03:31:13 +0000 (03:31 +0000)
git-svn-id: file:///svnroot/nqaap/trunk@11 00ff6f12-f5ab-46b1-af0e-967c86d3154f

build_nqaap.py [deleted file]
build_nqaap_maemo5.py

diff --git a/build_nqaap.py b/build_nqaap.py
deleted file mode 100644 (file)
index 09e1de5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/python2.5\r
- # -*- coding: utf-8 -*-\r
- ## This program is free software; you can redistribute it and/or modify\r
- ## it under the terms of the GNU General Public License as published\r
- ## by the Free Software Foundation; version 2 only.\r
- ##\r
- ## This program is distributed in the hope that it will be useful,\r
- ## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- ## GNU General Public License for more details.\r
- ##\r
-import py2deb\r
-import os\r
-if __name__ == "__main__":\r
-    try:\r
-        os.chdir(os.path.dirname(sys.argv[0]))\r
-    except:\r
-        pass\r
-    print\r
-    p=py2deb.Py2deb("nqaap") #This is the package name and MUST be in\r
-                               #lowercase! (using e.g. "mClock" fails\r
-                               #miserably...)\r
-    p.description="Very simple Audiobook player. \nSupports playing, pausing, seeking (sort of) and saving state when changing book/closing.\nPlays books arranged as dirs under myDocs/Audiobooks"\r
-    p.author="Soeren 'Pengman' Pedersen"\r
-    p.mail="pengmeister@gmail.com"\r
-    p.depends = "python2.5, python2.5-gtk2, python-gst0.10"\r
-    p.section="user/multimedia"\r
-    p.icon = "/usr/share/icons/hicolor/48x48/hildon/nqaap.png"\r
-    p.arch="all"                #should be all for python, any for all arch\r
-    p.urgency="low"             #not used in maemo onl for deb os\r
-    p.distribution="fremantle"\r
-    p.repository="extras-devel"\r
-    p.xsbc_bugtracker="http://talk.maemo.org/showthread.php?p=619738"\r
-    #  p.postinstall="""#!/bin/sh\r
-    #  chmod +x /usr/bin/mclock.py""" #Set here your post install script\r
-    #  p.postremove="""#!/bin/sh\r
-    #  chmod +x /usr/bin/mclock.py""" #Set here your post remove script\r
-    #  p.preinstall="""#!/bin/sh\r
-    #  chmod +x /usr/bin/mclock.py""" #Set here your pre install script\r
-    #  p.preremove="""#!/bin/sh\r
-    #  chmod +x /usr/bin/mclock.py""" #Set here your pre remove script\r
-    version = "0.8.0"           #Version of your software, e.g. "1.2.0" or "0.8.2"\r
-    build = "2" #Build number, e.g. "1" for the first build of this\r
-                                #version of your software. Increment\r
-                                #for later re-builds of the same\r
-                                #version of your software.  Text with\r
-                                #changelog information to be displayed\r
-                                #in the package "Details" tab of the\r
-                                #Maemo Application Manager\r
-    changeloginformation = "Merged changes from EPage (proper changelog later)\nNew Icon by Strutten."\r
-    # 0.7.2 : Seek bar now responds to clicks (rather than drags)\nFixed bug with wrong text showing on button after changed chapter.\r
-    # 0.7.1 : Fixed crash when current points to non existing book\r
-    # 0.7.0 : Now ignores pressed outside the chapter selection menu\nAdded help\r
-    # 0.6.1 : Fixed bug that prevented running on devices without Audiobook folder.\r
-    #         Added tip on where to place audiobooks.\r
-    # 0.6.0 : Now also plays .mp3 files\r
-    # 0.5.0 : Second release. Now shows which chapter is playing, and scrolls to it when changing.\r
-    # 0.4.9 : First release. Now it should work\r
-    #  \r
-    dir_name = "src" #Name of the subfolder containing your package\r
-                                #source files\r
-                                #(e.g. usr\share\icons\hicolor\scalable\myappicon.svg,\r
-                                #usr\lib\myapp\somelib.py). We suggest\r
-                                #to leave it named src in all projects\r
-                                #and will refer to that in the wiki\r
-                                #article on maemo.org\r
-                                \r
-    #Thanks to DareTheHair from talk.maemo.org for this snippet that\r
-    #recursively builds the file list\r
-    for root, dirs, files in os.walk(dir_name):\r
-        real_dir = root[len(dir_name):]\r
-        if '.' in real_dir:\r
-            continue # if some part of the dirname contains '.' we\r
-                                        # ignore all files (avoid .svn\r
-                                        # and others)\r
-        fake_file = []\r
-        for f in files:\r
-            fake_file.append(root + os.sep + f + "|" + f)\r
-        if len(fake_file) > 0:\r
-            p[real_dir] = fake_file\r
-    print p\r
-    r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)\r
index 5854d83..2c585a3 100644 (file)
@@ -1,17 +1,22 @@
-#!/usr/bin/python2.5\r
- # -*- coding: utf-8 -*-\r
- ## This program is free software; you can redistribute it and/or modify\r
- ## it under the terms of the GNU General Public License as published\r
- ## by the Free Software Foundation; version 2 only.\r
- ##\r
- ## This program is distributed in the hope that it will be useful,\r
- ## but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- ## GNU General Public License for more details.\r
- ##\r
+#!/usr/bin/env python\r
+# -*- coding: utf-8 -*-\r
+\r
+"""\r
+This program is free software; you can redistribute it and/or modify\r
+it under the terms of the GNU General Public License as published\r
+by the Free Software Foundation; version 2 only.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+GNU General Public License for more details.\r
+"""\r
+\r
 import py2deb\r
 import os\r
-if __name__ == "__main__":\r
+\r
+\r
+def build_package(distribution):\r
     try:\r
         os.chdir(os.path.dirname(sys.argv[0]))\r
     except:\r
@@ -20,19 +25,39 @@ if __name__ == "__main__":
     p=py2deb.Py2deb("nqaap") #This is the package name and MUST be in\r
                                #lowercase! (using e.g. "mClock" fails\r
                                #miserably...)\r
-    p.description="Very simple Audiobook player. \nSupports playing, pausing, seeking (sort of) and saving state when changing book/closing.\nPlays books arranged as dirs under myDocs/Audiobooks"\r
+    p.description="""Very simple Audiobook player.\r
+Supports playing, pausing, seeking (sort of) and saving state when changing book/closing.\r
+Plays books arranged as dirs under myDocs/Audiobooks\r
+Homepage: http://nqaap.garage.maemo.org/"""\r
     p.author="Soeren 'Pengman' Pedersen"\r
     p.mail="pengmeister@gmail.com"\r
-    p.depends = "python2.5, python2.5-gtk2, python2.5-dbus, python2.5-telepathy, python2.5-gobject, python-gst0.10"\r
-    p.section="user/multimedia"\r
+    p.depends = ", ".join([\r
+        "python2.6 | python2.5",\r
+        "python-gtk2 | python2.5-gtk2",\r
+        "python-dbus | python2.5-dbus",\r
+        "python-telepathy | python2.5-telepathy",\r
+        "python-gobject | python2.5-gobject",\r
+    ])\r
+    maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"\r
+    p.depends += {\r
+        "debian": ", python-gst0.10",\r
+        "diablo": maemoSpecificDepends,\r
+        "fremantle": maemoSpecificDepends+", python-gst0.10",\r
+    }[distribution]\r
+    p.section = {\r
+        "debian": "multimedia",\r
+        "diablo": "user/multimedia",\r
+        "fremantle": "user/multimedia",\r
+    }[distribution]\r
     p.icon = "/usr/share/icons/hicolor/48x48/hildon/nqaap.png"\r
     p.arch="all"                #should be all for python, any for all arch\r
     p.urgency="low"             #not used in maemo onl for deb os\r
-    p.distribution="fremantle"\r
-    p.repository="extras-devel"\r
+    p.distribution=distribution\r
+    p.repository="extras"\r
     p.xsbc_bugtracker="http://talk.maemo.org/showthread.php?p=619738"\r
-    #  p.postinstall="""#!/bin/sh\r
-    #  chmod +x /usr/bin/mclock.py""" #Set here your post install script\r
+    p.postinstall="""#!/bin/sh\r
+rm -f ~/.nqaap/nqaap.log\r
+"""\r
     #  p.postremove="""#!/bin/sh\r
     #  chmod +x /usr/bin/mclock.py""" #Set here your post remove script\r
     #  p.preinstall="""#!/bin/sh\r
@@ -64,7 +89,6 @@ if __name__ == "__main__":
                                 #to leave it named src in all projects\r
                                 #and will refer to that in the wiki\r
                                 #article on maemo.org\r
-                                \r
     #Thanks to DareTheHair from talk.maemo.org for this snippet that\r
     #recursively builds the file list\r
     for root, dirs, files in os.walk(dir_name):\r
@@ -78,5 +102,32 @@ if __name__ == "__main__":
             fake_file.append(root + os.sep + f + "|" + f)\r
         if len(fake_file) > 0:\r
             p[real_dir] = fake_file\r
+\r
     print p\r
-    r = p.generate(version,build,changelog=changeloginformation,tar=True,dsc=True,changes=True,build=False,src=True)\r
+    if distribution == "debian":\r
+        print p.generate(\r
+            version,\r
+            build,\r
+            changelog=changeloginformation,\r
+            build=True,\r
+            tar=False,\r
+            changes=False,\r
+            dsc=False,\r
+            src=False,\r
+        )\r
+    else:\r
+        print p.generate(\r
+            version,\r
+            build,\r
+            changelog=changeloginformation,\r
+            build=False,\r
+            tar=True,\r
+            changes=True,\r
+            dsc=True,\r
+            src=True,\r
+        )\r
+    print "Building for %s finished" % distribution\r
+\r
+\r
+if __name__ == "__main__":\r
+    build_package("fremantle")\r