9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Note: This is pre-alpha software. It will eat your kittens. Please do not turn to the author if its broken unless you bring patches.
17 Google Voice Communication Plugin
21 * Send Texts and Receive both Texts and Voicemail through your chat window
23 * Save battery life by setting your status to "Away"
25 * Block incoming calls by switching your status to "Hidden"
27 * Access to all of your Google Voice contacts
29 Homepage: http://theonering.garage.maemo.org
31 __author__ = "Ed Page"
32 __email__ = "eopage@byu.net"
33 __version__ = constants.__version__
34 __build__ = constants.__build__
41 __postinstall__ = """#!/bin/sh -e
43 gtk-update-icon-cache -f /usr/share/icons/hicolor
44 rm -f ~/.telepathy-theonering/theonering.log
48 for root, dirs, files in os.walk(path):
50 if file.startswith("src!"):
51 fileParts = file.split("!")
52 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
53 assert unused == "src"
54 relPath = os.sep.join(relPathParts)
55 yield relPath, file, newName
58 def unflatten_files(files):
60 for relPath, oldName, newName in files:
63 d[relPath].append((oldName, newName))
67 def build_package(distribution):
69 os.chdir(os.path.dirname(sys.argv[0]))
73 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
74 p = py2deb.Py2deb(__appname__)
75 if distribution == "debian":
76 p.prettyName = constants.__pretty_app_name__
78 p.prettyName = "Google Voice protocol plugin for Conversations and Contacts"
79 p.description = __description__
80 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
81 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
87 "diablo": "user/network",
88 "fremantle": "user/network",
89 "mer": "user/network",
91 p.depends = ", ".join([
92 "python (>= 2.5) | python2.5",
93 "python-dbus | python2.5-dbus",
94 "python-gobject | python2.5-gobject",
95 "python-telepathy | python2.5-telepathy",
100 "diablo": ", account-plugin-haze",
101 "fremantle": ", account-plugin-haze",
106 p.distribution = "diablo fremantle mer debian"
107 p.repository = "extras"
108 p.changelog = __changelog__
109 p.postinstall = __postinstall__
111 "debian": "26x26-theonering.png",
112 "diablo": "26x26-theonering.png",
113 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
114 "mer": "64x64-theonering.png",
116 for relPath, files in unflatten_files(find_files(".")).iteritems():
117 fullPath = "/usr/lib/theonering"
119 fullPath += os.sep+relPath
121 "|".join((oldName, newName))
122 for (oldName, newName) in files
124 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
125 if distribution in ("debian", ):
126 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
127 elif distribution in ("diablo", "fremantle", "mer"):
128 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
129 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
130 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
131 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
133 if distribution == "debian":
136 version="%s-%s" % (__version__, __build__),
137 changelog=__changelog__,
143 print "Building for %s finished" % distribution
147 version="%s-%s" % (__version__, __build__),
148 changelog=__changelog__,
154 print "Building for %s finished" % distribution
157 if __name__ == "__main__":
158 if len(sys.argv) > 1:
164 if optparse is not None:
165 parser = optparse.OptionParser()
166 (commandOptions, commandArgs) = parser.parse_args()
169 commandArgs = ["diablo"]
170 build_package(commandArgs[0])