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__
37 * Speed up: login through cookies
38 * Speed up: by default TOR disallows DND. When DND is allowed TOR will not do duplicate work now
39 * Adjusted the timeout for hung connections
40 * Allowing longer phone calls to kick off a voicemail check (accounted for rejected but not ignored calls originally)
41 * Lengthened auto-disconnect from 20-60 seconds
42 * Imitating telepathy-butterfly in some changes that have been made
43 * Reduced some log noise
48 __postinstall__ = """#!/bin/sh -e
50 gtk-update-icon-cache -f /usr/share/icons/hicolor
51 rm -f ~/.telepathy-theonering/theonering.log
55 for root, dirs, files in os.walk(path):
57 if file.startswith("src!"):
58 fileParts = file.split("!")
59 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
60 assert unused == "src"
61 relPath = os.sep.join(relPathParts)
62 yield relPath, file, newName
65 def unflatten_files(files):
67 for relPath, oldName, newName in files:
70 d[relPath].append((oldName, newName))
74 def build_package(distribution):
76 os.chdir(os.path.dirname(sys.argv[0]))
80 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
81 p = py2deb.Py2deb(__appname__)
82 if distribution == "debian":
83 p.prettyName = constants.__pretty_app_name__
85 p.prettyName = "Google Voice plugin for Conversations and Calls"
86 p.description = __description__
87 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=The%%20One%%20Ring"
88 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
94 "diablo": "user/network",
95 "fremantle": "user/network",
97 p.depends = ", ".join([
98 "python (>= 2.5) | python2.5",
99 "python-dbus | python2.5-dbus",
100 "python-gobject | python2.5-gobject",
101 "python-telepathy | python2.5-telepathy",
105 "diablo": ", python2.5-conic, account-plugin-haze",
106 "fremantle": ", account-plugin-haze",
110 p.distribution = "diablo fremantle debian"
111 p.repository = "extras"
112 p.changelog = __changelog__
113 p.postinstall = __postinstall__
114 p.icon = "32-tor_handset.png"
115 for relPath, files in unflatten_files(find_files(".")).iteritems():
116 fullPath = "/opt/theonering/lib"
118 fullPath += os.sep+relPath
120 "|".join((oldName, newName))
121 for (oldName, newName) in files
123 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
124 if distribution in ("debian", ):
125 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
126 elif distribution in ("diablo", "fremantle"):
127 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
128 p["/opt/theonering/bin"] = ["telepathy-theonering"]
129 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
130 if distribution in ("debian", ):
131 iconBasePath = "/usr/share/icons/gnome/%s/apps"
132 elif distribution in ("diablo", "fremantle"):
133 iconBasePath = "/usr/share/icons/hicolor/%s/hildon"
134 p[iconBasePath % "26x26"] = ["26-tor_handset.png|im-theonering.png"]
135 p[iconBasePath % "32x32"] = ["32-tor_handset.png|im-theonering.png"]
136 p[iconBasePath % "64x64"] = ["64-tor_handset.png|im-theonering.png"]
137 p["/opt/theonering/share"] = [
138 "32-tor_handset.png|tor_handset.png",
139 "32-tor_phone.png|tor_phone.png",
140 "32-tor_question.png|tor_question.png",
141 "32-tor_self.png|tor_self.png",
144 if distribution == "debian":
147 version="%s-%s" % (__version__, __build__),
148 changelog=__changelog__,
154 print "Building for %s finished" % distribution
158 version="%s-%s" % (__version__, __build__),
159 changelog=__changelog__,
165 print "Building for %s finished" % distribution
168 if __name__ == "__main__":
169 if len(sys.argv) > 1:
175 if optparse is not None:
176 parser = optparse.OptionParser()
177 (commandOptions, commandArgs) = parser.parse_args()
180 commandArgs = ["diablo"]
181 build_package(commandArgs[0])