SOURCE_PATH=src
SOURCE=$(shell find $(SOURCE_PATH) -iname "*.py")
PROGRAM=$(SOURCE_PATH)/mormonchannel_gtk.py
+DATA_PATH=data
DATA_TYPES=*.ini *.map *.glade *.png
-DATA=$(foreach type, $(DATA_TYPES), $(shell find $(SOURCE_PATH) -iname "$(type)"))
+DATA=$(foreach type, $(DATA_TYPES), $(shell find $(DATA_PATH) -iname "$(type)")) data/COPYING
OBJ=$(SOURCE:.py=.pyc)
BUILD_PATH=./build
TAG_FILE=~/.ctags/$(PROJECT_NAME).tags
cp $(SOURCE_PATH)/constants.py $(BUILD_PATH)/generic
cp $(SOURCE_PATH)/$(PROJECT_NAME).py $(BUILD_PATH)/generic
$(foreach file, $(DATA), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
- $(foreach file, $(SOURCE), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
- #$(foreach file, $(OBJ), cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
+ $(foreach file, $(SOURCE) $(SOURCE_PATH)/LICENSE, cp $(file) $(BUILD_PATH)/generic/$(subst /,-,$(file)) ; )
cp support/$(PROJECT_NAME).desktop $(BUILD_PATH)/generic
- cp support/icons/hicolor/26x26/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/26x26-$(PROJECT_NAME).png
- cp support/icons/hicolor/64x64/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/64x64-$(PROJECT_NAME).png
- cp support/icons/hicolor/scalable/hildon/$(PROJECT_NAME).png $(BUILD_PATH)/generic/scale-$(PROJECT_NAME).png
+ cp data/icon.png $(BUILD_PATH)/generic/48x48-$(PROJECT_NAME).png
cp support/builddeb.py $(BUILD_PATH)/generic
cp support/py2deb.py $(BUILD_PATH)/generic
cp support/fake_py2deb.py $(BUILD_PATH)/generic
__version__ = constants.__version__
__build__ = constants.__build__
__changelog__ = """
+Initial release
"""
"""
-def find_files(path):
+def find_files(prefix, path):
for root, dirs, files in os.walk(path):
for file in files:
- if file.startswith("src-"):
+ if file.startswith(prefix+"-"):
fileParts = file.split("-")
unused, relPathParts, newName = fileParts[0], fileParts[1:-1], fileParts[-1]
- assert unused == "src"
+ assert unused == prefix
relPath = os.sep.join(relPathParts)
yield relPath, file, newName
p.recommends = ", ".join([
])
p.section = {
- "debian": "",
- "diablo": "",
- "fremantle": "",
+ "debian": "sound",
+ "diablo": "user/multimedia",
+ "fremantle": "user/multimedia",
}[distribution]
p.arch = "all"
p.urgency = "low"
p.repository = "extras"
p.changelog = __changelog__
p.postinstall = __postinstall__
- p.icon = {
- "debian": "",
- "diablo": "",
- "fremantle": "", # Fremantle natively uses 48x48
- }[distribution]
- p["/usr/bin"] = [ "" ]
- for relPath, files in unflatten_files(find_files(".")).iteritems():
- fullPath = ""
+ p.icon = "48x48-MormonChannel.png"
+ p["/opt/MormonChannel/bin"] = ["MormonChannel.py"]
+ for relPath, files in unflatten_files(find_files("src", ".")).iteritems():
+ fullPath = "/opt/MormonChannel/lib"
+ if relPath:
+ fullPath += os.sep+relPath
+ p[fullPath] = list(
+ "|".join((oldName, newName))
+ for (oldName, newName) in files
+ )
+ for relPath, files in unflatten_files(find_files("data", ".")).iteritems():
+ fullPath = "/opt/MormonChannel/share"
if relPath:
fullPath += os.sep+relPath
p[fullPath] = list(
"|".join((oldName, newName))
for (oldName, newName) in files
)
- p["/usr/share/applications/hildon"] = [""]
- p["/usr/share/icons/hicolor/26x26/hildon"] = [""]
- p["/usr/share/icons/hicolor/64x64/hildon"] = [""]
- p["/usr/share/icons/hicolor/scalable/hildon"] = [""]
+ p["/usr/share/applications/hildon"] = ["MormonChannel.desktop"]
+ p["/usr/share/icons/hicolor/48x48/hildon"] = ["48x48-MormonChannel.png|MormonChannel.png"]
if distribution == "debian":
print p