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