cp support/icons/64.png $(BUILD_PATH)/64x64-$(PROJECT_NAME).png
cp support/icons/scalable.png $(BUILD_PATH)/scale-$(PROJECT_NAME).png
cp support/builddeb.py $(BUILD_PATH)
+ cp support/fake_py2deb.py $(BUILD_PATH)
lint: $(OBJ)
$(foreach file, $(SOURCE), $(LINT) $(file) ; )
"""
if isinstance(exception, Exception):
excType, excValue = type(exception), str(exception)
- elif isinstance(e, type):
- excType, excValue = e, ""
+ elif isinstance(exception, type):
+ excType, excValue = exception, ""
try:
yield
if __name__ == "__main__":
import doctest
- doctest.testmod()
\ No newline at end of file
+ doctest.testmod()
import os
import sys
-import py2deb
+try:
+ import py2deb
+except ImportError:
+ import fake_py2deb as py2deb
import constants
'''
-__postinstall__ = '''#!/bin/sh
+__postinstall__ = '''#!/bin/sh -e
-gtk-update-icon-cache /usr/share/icons/hicolor
+gtk-update-icon-cache -f /usr/share/icons/hicolor
'''
return d
-if __name__ == "__main__":
+def build_package(distribution):
try:
os.chdir(os.path.dirname(sys.argv[0]))
except:
p.author = __author__
p.mail = __email__
p.license = "lgpl"
- p.depends = "python2.5, python2.5-gtk2"
+ p.depends = {
+ "diablo": "python2.5, python2.5-gtk2",
+ "mer": "python2.6, python-gtk2, python-glade2",
+ }[distribution]
p.section = "user/accessories"
p.arch = "all"
p.urgency = "low"
- p.distribution = "chinook diablo"
+ p.distribution = "chinook diablo fremantle mer"
p.repository = "extras"
p.changelog = __changelog__
p.postinstall = __postinstall__
- p.icon="26x26-ejpi.png"
+ p.icon = "26x26-ejpi.png"
p["/usr/bin"] = [ "ejpi.py" ]
for relPath, files in unflatten_files(find_files(".")).iteritems():
fullPath = "/usr/lib/ejpi"
__version__, __build__, changelog=__changelog__,
tar=True, dsc=True, changes=True, build=False, src=True
)
+ print "Building for %s finished" % distribution
+
+
+if __name__ == "__main__":
+ if len(sys.argv) > 1:
+ try:
+ import optparse
+ except ImportError:
+ optparse = None
+
+ if optparse is not None:
+ parser = optparse.OptionParser()
+ (commandOptions, commandArgs) = parser.parse_args()
+ else:
+ commandArgs = None
+ commandArgs = ["diablo"]
+ build_package(commandArgs[0])
--- /dev/null
+import pprint
+
+
+class Py2deb(object):
+
+ def __init__(self, appName):
+ self._appName = appName
+ self.description = ""
+ self.author = ""
+ self.mail = ""
+ self.license = ""
+ self.depends = ""
+ self.section = ""
+ self.arch = ""
+ self.ugency = ""
+ self.distribution = ""
+ self.repository = ""
+ self.changelog = ""
+ self.postinstall = ""
+ self.icon = ""
+ self._install = {}
+
+ def generate(self, appVersion, appBuild, changelog, tar, dsc, changes, build, src):
+ return """
+Package: %s
+version: %s-%s
+Changes:
+%s
+
+Build Options:
+ Tar: %s
+ Dsc: %s
+ Changes: %s
+ Build: %s
+ Src: %s
+ """ % (
+ self._appName, appVersion, appBuild, changelog, tar, dsc, changes, build, src
+ )
+
+ def __str__(self):
+ parts = []
+ parts.append("%s Package Settings:" % (self._appName, ))
+ for settingName in dir(self):
+ if settingName.startswith("_"):
+ continue
+ parts.append("\t%s: %s" % (settingName, getattr(self, settingName)))
+
+ parts.append(pprint.pformat(self._install))
+
+ return "\n".join(parts)
+
+ def __getitem__(self, key):
+ return self._install[key]
+
+ def __setitem__(self, key, item):
+ self._install[key] = item