9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Send/receive texts and initiate GV callbacks all through Conversations and Phone
18 * Send Texts and Receive both Texts and Voicemail through your chat window (buggy on Maemo 4.1)
20 * Initiate Google Voice callbacks from the dialpad or your contacts
22 * Access to all of your Google Voice contacts (Maemo 4.1 only for now)
24 * Reduce battery drain by setting your status to "Away"
26 * Block incoming calls by switching your status to "Hidden"
28 Note: Google and Google Voice are probably trademarks of Google. This software nor the author has any affiliation with Google
30 Homepage: http://theonering.garage.maemo.org
32 __author__ = "Ed Page"
33 __email__ = "eopage@byu.net"
34 __version__ = constants.__version__
35 __build__ = constants.__build__
38 * Initial beta release for Maemo 5
39 * Late Alpha for Maemo 4.1 with horrible consequences like crashing RTComm
42 * Pre-Alpha Development Release
46 __postinstall__ = """#!/bin/sh -e
48 gtk-update-icon-cache -f /usr/share/icons/hicolor
49 rm -f ~/.telepathy-theonering/theonering.log
53 for root, dirs, files in os.walk(path):
55 if file.startswith("src!"):
56 fileParts = file.split("!")
57 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
58 assert unused == "src"
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 if distribution == "debian":
81 p.prettyName = constants.__pretty_app_name__
83 p.prettyName = "Google Voice plugin for Conversations and Calls"
84 p.description = __description__
85 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
86 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
92 "diablo": "user/network",
93 "fremantle": "user/network",
94 "mer": "user/network",
96 p.depends = ", ".join([
97 "python (>= 2.5) | python2.5",
98 "python-dbus | python2.5-dbus",
99 "python-gobject | python2.5-gobject",
100 "python-telepathy | python2.5-telepathy",
105 "diablo": ", python2.5-conic, account-plugin-haze",
106 "fremantle": ", account-plugin-haze",
111 p.distribution = "diablo fremantle mer debian"
112 p.repository = "extras"
113 p.changelog = __changelog__
114 p.postinstall = __postinstall__
116 "debian": "26x26-theonering.png",
117 "diablo": "26x26-theonering.png",
118 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
119 "mer": "64x64-theonering.png",
121 for relPath, files in unflatten_files(find_files(".")).iteritems():
122 fullPath = "/usr/lib/theonering"
124 fullPath += os.sep+relPath
126 "|".join((oldName, newName))
127 for (oldName, newName) in files
129 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
130 if distribution in ("debian", ):
131 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
132 elif distribution in ("diablo", "fremantle", "mer"):
133 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
134 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
135 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
136 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
138 if distribution == "debian":
141 version="%s-%s" % (__version__, __build__),
142 changelog=__changelog__,
148 print "Building for %s finished" % distribution
152 version="%s-%s" % (__version__, __build__),
153 changelog=__changelog__,
159 print "Building for %s finished" % distribution
162 if __name__ == "__main__":
163 if len(sys.argv) > 1:
169 if optparse is not None:
170 parser = optparse.OptionParser()
171 (commandOptions, commandArgs) = parser.parse_args()
174 commandArgs = ["diablo"]
175 build_package(commandArgs[0])