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 * In-application alert system for new messages
34 * Auto-update of voicemail on missed calls
35 * Ability to only refresh SMS or Voicemail for faster refreshes
36 * Ability to refresh only parts of call history for faster refreshes
37 * Voicemail audio download and playback
38 * Account refresh for when connection has expired
39 * Improved look of refresh buttons (Maemo 4.1)
40 * Improved rotation settings
41 * Auto-scroll SMS window for the user when on-screen-keyboard pops up (Maemo 4.1)
42 * Added support for QtMobility Contacts (Note: there seems to be a bug in libraries I depend on when run as root)
43 * Improving the settings dialog
44 * Fixing message ordering
45 * Limited log size due to longer release cycles
46 * Some minor optimizations
47 * Reduced network timeout, connections while transition networks wouldn't immediately die but timeout which took too long
48 * Fixed text encoding issue for CSV contacts
52 __postinstall__ = """#!/bin/sh -e
54 gtk-update-icon-cache -f /usr/share/icons/hicolor
55 """ % {"name": constants.__app_name__}
57 __preremove__ = """#!/bin/sh -e
59 python /opt/dialcentral/lib/alarm_handler.py -d || true
63 def find_files(prefix, path):
64 for root, dirs, files in os.walk(path):
66 if file.startswith(prefix+"-"):
67 fileParts = file.split("-")
68 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
69 assert unused == prefix
70 relPath = os.sep.join(relPathParts)
71 yield relPath, file, newName
74 def unflatten_files(files):
76 for relPath, oldName, newName in files:
79 d[relPath].append((oldName, newName))
83 def build_package(distribution):
85 os.chdir(os.path.dirname(sys.argv[0]))
89 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
90 p = py2deb.Py2deb(__appname__)
91 p.prettyName = constants.__pretty_app_name__
92 p.description = __description__
93 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=Dialcentral"
97 p.depends = ", ".join([
98 "python2.6 | python2.5",
99 "python-xml | python2.5-xml",
100 "python-dbus | python2.5-dbus",
104 "debian": ", python-qt4",
105 "diablo": ", python2.5-qt4-core, python2.5-qt4-gui",
106 "fremantle": ", python-pyside.qtgui, python-pyside.qtcore, python-pyside.qtmaemo5, python-qtmobility.contacts",
108 p.recommends = ", ".join([
112 "diablo": "user/network",
113 "fremantle": "user/network",
117 p.distribution = "diablo fremantle debian"
118 p.repository = "extras"
119 p.changelog = __changelog__
120 p.postinstall = __postinstall__
121 p.preremove = __preremove__
123 "debian": "26x26-dialcentral.png",
124 "diablo": "26x26-dialcentral.png",
125 "fremantle": "64x64-dialcentral.png", # Fremantle natively uses 48x48
127 p["/opt/%s/bin" % __appname__] = [ "%s.py" % __appname__ ]
128 for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
129 fullPath = "/opt/%s/lib" % __appname__
131 fullPath += os.sep+relPath
133 "|".join((oldName, newName))
134 for (oldName, newName) in files
136 for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
137 fullPath = "/opt/%s/share" % __appname__
139 fullPath += os.sep+relPath
141 "|".join((oldName, newName))
142 for (oldName, newName) in files
144 p["/usr/share/applications/hildon"] = ["dialcentral.desktop"]
145 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-dialcentral.png|dialcentral.png"]
146 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-dialcentral.png|dialcentral.png"]
147 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-dialcentral.png|dialcentral.png"]
150 if distribution == "debian":
152 version="%s-%s" % (__version__, __build__),
153 changelog=__changelog__,
161 version="%s-%s" % (__version__, __build__),
162 changelog=__changelog__,
168 print "Building for %s finished" % distribution
171 if __name__ == "__main__":
172 if len(sys.argv) == 1:
173 distribution = "fremantle"
175 distribution = sys.argv[1]
176 build_package(distribution)