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",
94 "diablo": "account-plugin-haze",
95 "fremantle": "account-plugin-haze",
100 p.distribution = "diablo fremantle mer debian"
101 p.repository = "extras"
102 p.changelog = __changelog__
103 p.postinstall = __postinstall__
105 "debian": "26x26-theonering.png",
106 "diablo": "26x26-theonering.png",
107 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
108 "mer": "64x64-theonering.png",
110 for relPath, files in unflatten_files(find_files(".")).iteritems():
111 fullPath = "/usr/lib/theonering"
113 fullPath += os.sep+relPath
115 "|".join((oldName, newName))
116 for (oldName, newName) in files
118 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
119 if distribution in ("debian", ):
120 p["/usr/share/mission-control/profiles"] = ["theonering.profile.%s|theonering.profile"% distribution]
121 elif distribution in ("diablo", "fremantle", "mer"):
122 p["/usr/share/osso-rtcom"] = ["theonering.profile.%s|theonering.profile"% distribution]
123 p["/usr/lib/telepathy"] = ["telepathy-theonering"]
124 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
125 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|theonering.png"]
126 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-theonering.png|theonering.png"]
127 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-theonering.png|theonering.png"]
129 if distribution == "debian":
132 version="%s-%s" % (__version__, __build__),
133 changelog=__changelog__,
139 print "Building for %s finished" % distribution
143 version="%s-%s" % (__version__, __build__),
144 changelog=__changelog__,
150 print "Building for %s finished" % distribution
153 if __name__ == "__main__":
154 if len(sys.argv) > 1:
160 if optparse is not None:
161 parser = optparse.OptionParser()
162 (commandOptions, commandArgs) = parser.parse_args()
165 commandArgs = ["diablo"]
166 build_package(commandArgs[0])