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 full screen support
34 * Adding back in notification support
35 * Fixing a dialog closing bug
39 __postinstall__ = """#!/bin/sh -e
41 gtk-update-icon-cache -f /usr/share/icons/hicolor
42 rm -f ~/.%(name)s/%(name)s.log
43 rm -f ~/.%(name)s/notifier.log
44 """ % {"name": constants.__app_name__}
46 __preremove__ = """#!/bin/sh -e
48 python /opt/dialcentral/lib/alarm_handler.py -d || true
52 def find_files(prefix, path):
53 for root, dirs, files in os.walk(path):
55 if file.startswith(prefix+"-"):
56 fileParts = file.split("-")
57 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
58 assert unused == prefix
59 relPath = os.sep.join(relPathParts)
60 yield relPath, file, newName
63 def unflatten_files(files):
65 for relPath, oldName, newName in files:
68 d[relPath].append((oldName, newName))
72 def build_package(distribution):
74 os.chdir(os.path.dirname(sys.argv[0]))
78 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
79 p = py2deb.Py2deb(__appname__)
80 p.prettyName = constants.__pretty_app_name__
81 p.description = __description__
82 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
86 p.depends = ", ".join([
87 "python2.6 | python2.5",
91 "debian": ", python-qt4",
92 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
93 "fremantle": ", python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-maemo5",
95 p.recommends = ", ".join([
99 "diablo": "user/network",
100 "fremantle": "user/network",
104 p.distribution = "diablo fremantle debian"
105 p.repository = "extras"
106 p.changelog = __changelog__
107 p.postinstall = __postinstall__
108 p.preremove = __preremove__
110 "debian": "26x26-dialcentral.png",
111 "diablo": "26x26-dialcentral.png",
112 "fremantle": "64x64-dialcentral.png", # Fremantle natively uses 48x48
114 p["/opt/%s/bin" % __appname__] = [ "%s.py" % __appname__ ]
115 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
116 fullPath = "/opt/%s/lib" % __appname__
118 fullPath += os.sep+relPath
120 "|".join((oldName, newName))
121 for (oldName, newName) in files
123 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
124 fullPath = "/opt/%s/share" % __appname__
126 fullPath += os.sep+relPath
128 "|".join((oldName, newName))
129 for (oldName, newName) in files
131 p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
132 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
133 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
134 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
137 if distribution == "debian":
139 version="%s-%s" % (__version__, __build__),
140 changelog=__changelog__,
148 version="%s-%s" % (__version__, __build__),
149 changelog=__changelog__,
155 print "Building for %s finished" % distribution
158 if __name__ == "__main__":
159 if len(sys.argv) == 1:
160 distribution = "fremantle"
162 distribution = sys.argv[1]
163 build_package(distribution)