9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Google Voice Communication Plugin
18 * Send Texts and Receive both Texts and Voicemail through your chat window
20 * Save battery life by setting your status to "Away"
22 * Block incoming calls by switching your status to "Hidden"
24 * Access to all of your Google Voice contacts
26 Homepage: http://theonering.garage.maemo.org
28 __author__ = "Ed Page"
29 __email__ = "eopage@byu.net"
30 __version__ = constants.__version__
31 __build__ = constants.__build__
38 __postinstall__ = """#!/bin/sh -e
40 gtk-update-icon-cache -f /usr/share/icons/hicolor
41 rm -f ~/.telepathy-theonering/theonering.log
45 for root, dirs, files in os.walk(path):
47 if file.startswith("src-"):
48 fileParts = file.split("-")
49 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
50 assert unused == "src"
51 relPath = os.sep.join(relPathParts)
52 yield relPath, file, newName
55 def unflatten_files(files):
57 for relPath, oldName, newName in files:
60 d[relPath].append((oldName, newName))
64 def build_package(distribution):
66 os.chdir(os.path.dirname(sys.argv[0]))
70 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
71 p = py2deb.Py2deb(__appname__)
72 p.prettyName = constants.__pretty_app_name__
73 p.description = __description__
74 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
75 #p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
79 p.depends = ", ".join([
80 "python (>= 2.5) | python2.5",
81 "python-dbus | python2.5-dbus",
82 "python-gobject | python2.5-gobject",
83 "python-telepathy | python2.5-telepathy",
87 "diablo": "user/network",
88 "fremantle": "user/network",
89 "mer": "user/network",
93 p.distribution = "diablo fremantle mer debian"
94 p.repository = "extras"
95 p.changelog = __changelog__
96 p.postinstall = __postinstall__
98 "debian": "26x26-theonering.png",
99 "diablo": "26x26-theonering.png",
100 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
101 "mer": "64x64-theonering.png",
103 for relPath, files in unflatten_files(find_files(".")).iteritems():
104 fullPath = "/usr/lib/theonering"
106 fullPath += os.sep+relPath
108 "|".join((oldName, newName))
109 for (oldName, newName) in files
111 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
112 if distribution in ("debian", ):
113 p["/usr/share/mission-control/profiles"] = ["theonering.profile"]
114 elif distribution in ("diablo", "fremantle", "mer"):
115 p["/usr/share/osso-rtcom"] = ["theonering.profile"]
116 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
117 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|theonering.png"]
118 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-theonering.png|theonering.png"]
119 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-theonering.png|theonering.png"]
121 if distribution == "debian":
124 version="%s-%s" % (__version__, __build__),
125 changelog=__changelog__,
131 print "Building for %s finished" % distribution
135 version="%s-%s" % (__version__, __build__),
136 changelog=__changelog__,
142 print "Building for %s finished" % distribution
145 if __name__ == "__main__":
146 if len(sys.argv) > 1:
152 if optparse is not None:
153 parser = optparse.OptionParser()
154 (commandOptions, commandArgs) = parser.parse_args()
157 commandArgs = ["diablo"]
158 build_package(commandArgs[0])