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 -Rf ~/.telepathy-theonering/cache
45 rm -f ~/.telepathy-theonering/theonering.log
49 for root, dirs, files in os.walk(path):
51 if file.startswith("src!"):
52 fileParts = file.split("!")
53 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
54 assert unused == "src"
55 relPath = os.sep.join(relPathParts)
56 yield relPath, file, newName
59 def unflatten_files(files):
61 for relPath, oldName, newName in files:
64 d[relPath].append((oldName, newName))
68 def build_package(distribution):
70 os.chdir(os.path.dirname(sys.argv[0]))
74 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
75 p = py2deb.Py2deb(__appname__)
76 if distribution == "debian":
77 p.prettyName = constants.__pretty_app_name__
79 p.prettyName = "Google Voice protocol plugin for Conversations and Contacts"
80 p.description = __description__
81 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
82 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
88 "diablo": "user/network",
89 "fremantle": "user/network",
90 "mer": "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",
101 "diablo": ", account-plugin-haze",
102 "fremantle": ", account-plugin-haze",
107 p.distribution = "diablo fremantle mer debian"
108 p.repository = "extras"
109 p.changelog = __changelog__
110 p.postinstall = __postinstall__
112 "debian": "26x26-theonering.png",
113 "diablo": "26x26-theonering.png",
114 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
115 "mer": "64x64-theonering.png",
117 for relPath, files in unflatten_files(find_files(".")).iteritems():
118 fullPath = "/usr/lib/theonering"
120 fullPath += os.sep+relPath
122 "|".join((oldName, newName))
123 for (oldName, newName) in files
125 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
126 if distribution in ("debian", ):
127 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
128 elif distribution in ("diablo", "fremantle", "mer"):
129 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
130 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
131 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
132 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|im-theonering.png"]
134 if distribution == "debian":
137 version="%s-%s" % (__version__, __build__),
138 changelog=__changelog__,
144 print "Building for %s finished" % distribution
148 version="%s-%s" % (__version__, __build__),
149 changelog=__changelog__,
155 print "Building for %s finished" % distribution
158 if __name__ == "__main__":
159 if len(sys.argv) > 1:
165 if optparse is not None:
166 parser = optparse.OptionParser()
167 (commandOptions, commandArgs) = parser.parse_args()
170 commandArgs = ["diablo"]
171 build_package(commandArgs[0])