9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Touch screen enhanced interface to the GoogleVoice phone service
18 * Dialpad for quick call
20 * Checking voicemails, texts, call history
24 * Notification support for texts, voicemail, and/or missed calls
26 Homepage: http://gc-dialer.garage.maemo.org/
28 __author__ = "Ed Page"
29 __email__ = "eopage@byu.net"
30 __version__ = constants.__version__
31 __build__ = constants.__build__
33 * Fixing erroneous error report
34 * Fixed visual glitches on Maemo 5 when adding contacts
35 * Hopefully fixed auto-scroll on loading of SMS window
36 * Improved performance of adding/removing contacts from SMS window
37 * Fixed bugs with contact alternate number selector
38 * Fixed bugs with SMS window closing
42 __postinstall__ = """#!/bin/sh -e
44 gtk-update-icon-cache -f /usr/share/icons/hicolor
45 rm -f ~/.%(name)s/%(name)s.log
46 rm -f ~/.%(name)s/notifier.log
47 """ % {"name": constants.__app_name__}
49 __preremove__ = """#!/bin/sh -e
51 python /opt/dialcentral/lib/alarm_handler.py -d || true
55 def find_files(prefix, path):
56 for root, dirs, files in os.walk(path):
58 if file.startswith(prefix+"-"):
59 fileParts = file.split("-")
60 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
61 assert unused == prefix
62 relPath = os.sep.join(relPathParts)
63 yield relPath, file, newName
66 def unflatten_files(files):
68 for relPath, oldName, newName in files:
71 d[relPath].append((oldName, newName))
75 def build_package(distribution):
77 os.chdir(os.path.dirname(sys.argv[0]))
81 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
82 p = py2deb.Py2deb(__appname__)
83 p.prettyName = constants.__pretty_app_name__
84 p.description = __description__
85 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
89 p.depends = ", ".join([
90 "python2.6 | python2.5",
94 "debian": ", python-qt4",
95 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
96 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
98 p.recommends = ", ".join([
102 "diablo": "user/network",
103 "fremantle": "user/network",
107 p.distribution = "diablo fremantle debian"
108 p.repository = "extras"
109 p.changelog = __changelog__
110 p.postinstall = __postinstall__
111 p.preremove = __preremove__
113 "debian": "26x26-dialcentral.png",
114 "diablo": "26x26-dialcentral.png",
115 "fremantle": "64x64-dialcentral.png", # Fremantle natively uses 48x48
117 p["/opt/%s/bin" % __appname__] = [ "%s.py" % __appname__ ]
118 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
119 fullPath = "/opt/%s/lib" % __appname__
121 fullPath += os.sep+relPath
123 "|".join((oldName, newName))
124 for (oldName, newName) in files
126 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
127 fullPath = "/opt/%s/share" % __appname__
129 fullPath += os.sep+relPath
131 "|".join((oldName, newName))
132 for (oldName, newName) in files
134 p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
135 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
136 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
137 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
140 if distribution == "debian":
142 version="%s-%s" % (__version__, __build__),
143 changelog=__changelog__,
151 version="%s-%s" % (__version__, __build__),
152 changelog=__changelog__,
158 print "Building for %s finished" % distribution
161 if __name__ == "__main__":
162 if len(sys.argv) == 1:
163 distribution = "fremantle"
165 distribution = sys.argv[1]
166 build_package(distribution)