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.
17 Google Voice Communication Plugin
21 * Send Texts and Receive both Texts and Voicemail through your chat window
23 * Initiate Google Voice callbacks from the dialpad or your contacts (Maemo 4.1 only)
25 * Access to all of your Google Voice contacts (Maemo 4.1 only)
27 * Reduce battery drain by setting your status to "Away"
29 * Block incoming calls by switching your status to "Hidden"
31 Note: Google and Google Voice are probably trademarks of Google. This software nor the author has ny affiliation with Google
33 Homepage: http://theonering.garage.maemo.org
35 __author__ = "Ed Page"
36 __email__ = "eopage@byu.net"
37 __version__ = constants.__version__
38 __build__ = constants.__build__
45 __postinstall__ = """#!/bin/sh -e
47 gtk-update-icon-cache -f /usr/share/icons/hicolor
48 rm -f ~/.telepathy-theonering/theonering.log
52 for root, dirs, files in os.walk(path):
54 if file.startswith("src!"):
55 fileParts = file.split("!")
56 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
57 assert unused == "src"
58 relPath = os.sep.join(relPathParts)
59 yield relPath, file, newName
62 def unflatten_files(files):
64 for relPath, oldName, newName in files:
67 d[relPath].append((oldName, newName))
71 def build_package(distribution):
73 os.chdir(os.path.dirname(sys.argv[0]))
77 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
78 p = py2deb.Py2deb(__appname__)
79 if distribution == "debian":
80 p.prettyName = constants.__pretty_app_name__
82 p.prettyName = "Google Voice protocol plugin for Conversations and Calls"
83 p.description = __description__
84 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
85 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
91 "diablo": "user/network",
92 "fremantle": "user/network",
93 "mer": "user/network",
95 p.depends = ", ".join([
96 "python (>= 2.5) | python2.5",
97 "python-dbus | python2.5-dbus",
98 "python-gobject | python2.5-gobject",
99 "python-telepathy | python2.5-telepathy",
104 "diablo": "python2.5-conic, account-plugin-haze",
105 "fremantle": ", account-plugin-haze",
110 p.distribution = "diablo fremantle mer debian"
111 p.repository = "extras"
112 p.changelog = __changelog__
113 p.postinstall = __postinstall__
115 "debian": "26x26-theonering.png",
116 "diablo": "26x26-theonering.png",
117 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
118 "mer": "64x64-theonering.png",
120 for relPath, files in unflatten_files(find_files(".")).iteritems():
121 fullPath = "/usr/lib/theonering"
123 fullPath += os.sep+relPath
125 "|".join((oldName, newName))
126 for (oldName, newName) in files
128 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
129 if distribution in ("debian", ):
130 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
131 elif distribution in ("diablo", "fremantle", "mer"):
132 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
133 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
134 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
135 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
137 if distribution == "debian":
140 version="%s-%s" % (__version__, __build__),
141 changelog=__changelog__,
147 print "Building for %s finished" % distribution
151 version="%s-%s" % (__version__, __build__),
152 changelog=__changelog__,
158 print "Building for %s finished" % distribution
161 if __name__ == "__main__":
162 if len(sys.argv) > 1:
168 if optparse is not None:
169 parser = optparse.OptionParser()
170 (commandOptions, commandArgs) = parser.parse_args()
173 commandArgs = ["diablo"]
174 build_package(commandArgs[0])