9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Note: This is jealous of new technology and will eat the kittens of n900 owners.
16 Google Voice Communication Plugin
20 * Send Texts and Receive both Texts and Voicemail through your chat window
22 * Initiate Google Voice callbacks from the dialpad or your contacts (Maemo 4.1 only)
24 * Access to all of your Google Voice contacts (Maemo 4.1 only)
26 * Reduce battery drain by setting your status to "Away"
28 * Block incoming calls by switching your status to "Hidden"
30 Note: Google and Google Voice are probably trademarks of Google. This software nor the author has any affiliation with Google
32 Homepage: http://theonering.garage.maemo.org
34 __author__ = "Ed Page"
35 __email__ = "eopage@byu.net"
36 __version__ = constants.__version__
37 __build__ = constants.__build__
44 __postinstall__ = """#!/bin/sh -e
46 gtk-update-icon-cache -f /usr/share/icons/hicolor
47 rm -f ~/.telepathy-theonering/theonering.log
51 for root, dirs, files in os.walk(path):
53 if file.startswith("src!"):
54 fileParts = file.split("!")
55 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
56 assert unused == "src"
57 relPath = os.sep.join(relPathParts)
58 yield relPath, file, newName
61 def unflatten_files(files):
63 for relPath, oldName, newName in files:
66 d[relPath].append((oldName, newName))
70 def build_package(distribution):
72 os.chdir(os.path.dirname(sys.argv[0]))
76 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
77 p = py2deb.Py2deb(__appname__)
78 if distribution == "debian":
79 p.prettyName = constants.__pretty_app_name__
81 p.prettyName = "Google Voice plugin for Conversations and Calls"
82 p.description = __description__
83 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
84 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
90 "diablo": "user/network",
91 "fremantle": "user/network",
92 "mer": "user/network",
94 p.depends = ", ".join([
95 "python (>= 2.5) | python2.5",
96 "python-dbus | python2.5-dbus",
97 "python-gobject | python2.5-gobject",
98 "python-telepathy | python2.5-telepathy",
103 "diablo": ", python2.5-conic, account-plugin-haze",
104 "fremantle": ", account-plugin-haze",
109 p.distribution = "diablo fremantle mer debian"
110 p.repository = "extras"
111 p.changelog = __changelog__
112 p.postinstall = __postinstall__
114 "debian": "26x26-theonering.png",
115 "diablo": "26x26-theonering.png",
116 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
117 "mer": "64x64-theonering.png",
119 for relPath, files in unflatten_files(find_files(".")).iteritems():
120 fullPath = "/usr/lib/theonering"
122 fullPath += os.sep+relPath
124 "|".join((oldName, newName))
125 for (oldName, newName) in files
127 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
128 if distribution in ("debian", ):
129 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
130 elif distribution in ("diablo", "fremantle", "mer"):
131 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
132 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
133 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
134 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
136 if distribution == "debian":
139 version="%s-%s" % (__version__, __build__),
140 changelog=__changelog__,
146 print "Building for %s finished" % distribution
150 version="%s-%s" % (__version__, __build__),
151 changelog=__changelog__,
157 print "Building for %s finished" % distribution
160 if __name__ == "__main__":
161 if len(sys.argv) > 1:
167 if optparse is not None:
168 parser = optparse.OptionParser()
169 (commandOptions, commandArgs) = parser.parse_args()
172 commandArgs = ["diablo"]
173 build_package(commandArgs[0])