9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Google Voice Communication Plugin
17 Homepage: http://theonering.garage.maemo.org
19 __author__ = "Ed Page"
20 __email__ = "eopage@byu.net"
21 __version__ = constants.__version__
22 __build__ = constants.__build__
29 __postinstall__ = """#!/bin/sh -e
31 gtk-update-icon-cache -f /usr/share/icons/hicolor
35 for root, dirs, files in os.walk(path):
37 if file.startswith("src-"):
38 fileParts = file.split("-")
39 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
40 assert unused == "src"
41 relPath = os.sep.join(relPathParts)
42 yield relPath, file, newName
45 def unflatten_files(files):
47 for relPath, oldName, newName in files:
50 d[relPath].append((oldName, newName))
54 def build_package(distribution):
56 os.chdir(os.path.dirname(sys.argv[0]))
60 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
61 p = py2deb.Py2deb(__appname__)
62 p.prettyName = constants.__pretty_app_name__
63 p.description = __description__
64 p.bugTracker = "https://bugs.maemo.org/enter_bug.cgi?product=theonering"
65 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
69 p.depends = ", ".join([
77 "chinook": "communication",
78 "diablo": "user/network",
79 "fremantle": "user/network",
80 "mer": "user/network",
84 p.distribution = "chinook diablo fremantle mer debian"
85 p.repository = "extras"
86 p.changelog = __changelog__
87 p.postinstall = __postinstall__
89 "debian": "26x26-theonering.png",
90 "chinook": "26x26-theonering.png",
91 "diablo": "26x26-theonering.png",
92 "fremantle": "64x64-theonering.png", # Fremantle natively uses 48x48
93 "mer": "64x64-theonering.png",
95 for relPath, files in unflatten_files(find_files(".")).iteritems():
96 fullPath = "/usr/lib/theonering"
98 fullPath += os.sep+relPath
100 "|".join((oldName, newName))
101 for (oldName, newName) in files
103 p["/usr/share/dbus-1/services"] = ["org.freedesktop.Telepathy.ConnectionManager.theonering.service"]
104 p["/usr/share/telepathy/managers"] = ["theonering.manager"]
105 p["/usr/share/icons/hicolor/26x26/hildon"] = ["26x26-theonering.png|theonering.png"]
106 p["/usr/share/icons/hicolor/64x64/hildon"] = ["64x64-theonering.png|theonering.png"]
107 p["/usr/share/icons/hicolor/scalable/hildon"] = ["scale-theonering.png|theonering.png"]
111 version="%s-%s" % (__version__, __build__),
112 changelog=__changelog__,
118 print "Building for %s finished" % distribution
121 if __name__ == "__main__":
122 if len(sys.argv) > 1:
128 if optparse is not None:
129 parser = optparse.OptionParser()
130 (commandOptions, commandArgs) = parser.parse_args()
133 commandArgs = ["diablo"]
134 build_package(commandArgs[0])