9 import fake_py2deb as py2deb
14 __appname__ = constants.__app_name__
15 __description__ = """Player for inspirational streaming radio and audiobooks including the KJV Bible
17 * "Mormon Channel" inspirational radio station
18 * Conference precedings and magazines from The Church of Jesus Christ of Latter-day Saints
19 * Scriptures, including King James Version of the Bible and the Book of Mormon
21 Homepage: http://www.lds.org
23 __author__ = "The Church of Jesus Christ of Latter-day Saints"
25 __version__ = constants.__version__
26 __build__ = constants.__build__
31 __postinstall__ = """#!/bin/sh -e
33 gtk-update-icon-cache -f /usr/share/icons/hicolor
38 for root, dirs, files in os.walk(path):
40 if file.startswith("src-"):
41 fileParts = file.split("-")
42 unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
43 assert unused == "src"
44 relPath = os.sep.join(relPathParts)
45 yield relPath, file, newName
48 def unflatten_files(files):
50 for relPath, oldName, newName in files:
53 d[relPath].append((oldName, newName))
57 def build_package(distribution):
59 os.chdir(os.path.dirname(sys.argv[0]))
63 py2deb.Py2deb.SECTIONS = py2deb.SECTIONS_BY_POLICY[distribution]
64 p = py2deb.Py2deb(__appname__)
65 p.prettyName = constants.__pretty_app_name__
66 p.description = __description__
68 p.upgradeDescription = __changelog__.split("\n\n", 1)[0]
72 p.depends = ", ".join([
73 "python2.6 | python2.5",
74 "python-gtk2 | python2.5-gtk2",
75 "python-xml | python2.5-xml",
76 "python-dbus | python2.5-dbus",
77 "python-gst0.10 | python2.5-gst0.10",
79 maemoSpecificDepends = ", python-osso | python2.5-osso, python-hildon | python2.5-hildon"
81 "debian": ", python-glade2",
82 "diablo": maemoSpecificDepends + "",
83 "fremantle": maemoSpecificDepends + ", python-glade2",
85 p.recommends = ", ".join([
94 p.distribution = "diablo fremantle debian"
95 p.repository = "extras"
96 p.changelog = __changelog__
97 p.postinstall = __postinstall__
101 "fremantle": "", # Fremantle natively uses 48x48
103 p["/usr/bin"] = [ "" ]
104 for relPath, files in unflatten_files(find_files(".")).iteritems():
107 fullPath += os.sep+relPath
109 "|".join((oldName, newName))
110 for (oldName, newName) in files
112 p["/usr/share/applications/hildon"] = [""]
113 p["/usr/share/icons/hicolor/26x26/hildon"] = [""]
114 p["/usr/share/icons/hicolor/64x64/hildon"] = [""]
115 p["/usr/share/icons/hicolor/scalable/hildon"] = [""]
117 if distribution == "debian":
120 version="%s-%s" % (__version__, __build__),
121 changelog=__changelog__,
127 print "Building for %s finished" % distribution
131 version="%s-%s" % (__version__, __build__),
132 changelog=__changelog__,
138 print "Building for %s finished" % distribution
141 if __name__ == "__main__":
142 if len(sys.argv) > 1:
148 if optparse is not None:
149 parser = optparse.OptionParser()
150 (commandOptions, commandArgs) = parser.parse_args()
153 commandArgs = ["diablo"]
154 build_package(commandArgs[0])