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
20 * Initiate Google Voice callbacks from the dialpad or your contacts
22 * Access to all of your Google Voice contacts
24 * Reduce battery drain by setting your status to "Away"
26 Note: Google and Google Voice are probably trademarks of Google. This software nor the author has any affiliation with Google
28 Homepage: http://theonering.garage.maemo.org
30 __author__ = "Ed Page"
31 __email__ = "eopage@byu.net"
32 __version__ = constants.__version__
33 __build__ = constants.__build__
35 * Shaving 300ms off of startup time
36 * Making the alias code a bit more robust, taken from a fix for an issue that breaks dialcentral
37 * Adding a quit command to the debug prompt
38 * Adding a update_now command to the debug prompt
39 * Fixing a bug with reset_timers debug prompt
43 __postinstall__ = """#!/bin/sh -e
45 gtk-update-icon-cache -f /usr/share/icons/hicolor
46 rm -f ~/.telepathy-theonering/theonering.log
50 for root, dirs, files in os.walk(path):
52 if file.startswith("src!"):
53 fileParts = file.split("!")
54 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
55 assert unused == "src"
56 relPath = os.sep.join(relPathParts)
57 yield relPath, file, newName
60 def unflatten_files(files):
62 for relPath, oldName, newName in files:
65 d[relPath].append((oldName, newName))
69 def build_package(distribution):
71 os.chdir(os.path.dirname(sys.argv[0]))
75 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
76 p = py2deb.Py2deb(__appname__)
77 if distribution == "debian":
78 p.prettyName = constants.__pretty_app_name__
80 p.prettyName = "Google Voice plugin for Conversations and Calls"
81 p.description = __description__
82 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=The%%20One%%20Ring"
83 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
89 "diablo": "user/network",
90 "fremantle": "user/network",
92 p.depends = ", ".join([
93 "python (>= 2.5) | python2.5",
94 "python-dbus | python2.5-dbus",
95 "python-gobject | python2.5-gobject",
96 "python-telepathy | python2.5-telepathy",
100 "diablo": ", python2.5-conic, account-plugin-haze",
101 "fremantle": ", account-plugin-haze",
105 p.distribution = "diablo fremantle debian"
106 p.repository = "extras"
107 p.changelog = __changelog__
108 p.postinstall = __postinstall__
109 p.icon = "32-tor_handset.png"
110 for relPath, files in unflatten_files(find_files(".")).iteritems():
111 fullPath = "/opt/theonering/lib"
113 fullPath += os.sep+relPath
115 "|".join((oldName, newName))
116 for (oldName, newName) in files
118 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
119 if distribution in ("debian", ):
120 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
121 elif distribution in ("diablo", "fremantle"):
122 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
123 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
124 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
125 if distribution in ("debian", ):
126 iconBasePath = "/usr/share/icons/gnome/%s/apps"
127 elif distribution in ("diablo", "fremantle"):
128 iconBasePath = "/usr/share/icons/hicolor/%s/hildon"
129 p[iconBasePath % "26x26"] = ["26-tor_handset.png|im-theonering.png"]
130 p[iconBasePath % "32x32"] = ["32-tor_handset.png|im-theonering.png"]
131 p[iconBasePath % "64x64"] = ["64-tor_handset.png|im-theonering.png"]
132 p["/opt/theonering/share"] = [
133 "32-tor_handset.png|tor_handset.png",
134 "32-tor_phone.png|tor_phone.png",
135 "32-tor_question.png|tor_question.png",
136 "32-tor_self.png|tor_self.png",
139 if distribution == "debian":
142 version="%s-%s" % (__version__, __build__),
143 changelog=__changelog__,
149 print "Building for %s finished" % distribution
153 version="%s-%s" % (__version__, __build__),
154 changelog=__changelog__,
160 print "Building for %s finished" % distribution
163 if __name__ == "__main__":
164 if len(sys.argv) > 1:
170 if optparse is not None:
171 parser = optparse.OptionParser()
172 (commandOptions, commandArgs) = parser.parse_args()
175 commandArgs = ["diablo"]
176 build_package(commandArgs[0])