2016-04-06 20:39:37 +02:00
|
|
|
#
|
|
|
|
# Build file for creating DMG files.
|
|
|
|
#
|
|
|
|
# The DMG packager looks for a template.dmg.bz2 for using as its
|
|
|
|
# DMG template. If it doesn't find one, it generates a clean one.
|
|
|
|
#
|
|
|
|
# If you create a DMG template, you should make one containing all
|
|
|
|
# the files listed in $(SOURCE_FILES) below, and arrange everything to suit
|
|
|
|
# your style. The contents of the files themselves does not matter, so
|
|
|
|
# they can be empty (they will be overwritten later).
|
|
|
|
#
|
|
|
|
# Remko Tronçon
|
|
|
|
# https://el-tramo.be
|
|
|
|
# Licensed under the MIT License. See COPYING for details.
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Customizable variables
|
|
|
|
################################################################################
|
|
|
|
|
2016-04-06 21:21:48 +02:00
|
|
|
NAME ?= qutebrowser
|
2016-04-06 20:39:37 +02:00
|
|
|
|
2016-04-06 21:21:48 +02:00
|
|
|
SOURCE_DIR ?= .
|
2017-09-17 21:53:45 +02:00
|
|
|
SOURCE_FILES ?= dist/qutebrowser.app LICENSE
|
2016-04-06 20:39:37 +02:00
|
|
|
|
|
|
|
TEMPLATE_DMG ?= template.dmg
|
2016-07-26 16:29:29 +02:00
|
|
|
TEMPLATE_SIZE ?= 300m
|
2016-04-06 20:39:37 +02:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# DMG building. No editing should be needed beyond this point.
|
|
|
|
################################################################################
|
|
|
|
|
2016-04-06 21:21:48 +02:00
|
|
|
MASTER_DMG=$(NAME).dmg
|
2016-04-06 20:39:37 +02:00
|
|
|
WC_DMG=wc.dmg
|
|
|
|
WC_DIR=wc
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(MASTER_DMG)
|
|
|
|
|
2016-07-26 16:30:34 +02:00
|
|
|
$(TEMPLATE_DMG):
|
2016-04-06 20:39:37 +02:00
|
|
|
@echo
|
|
|
|
@echo --------------------- Generating empty template --------------------
|
|
|
|
mkdir template
|
|
|
|
hdiutil create -fs HFSX -layout SPUD -size $(TEMPLATE_SIZE) "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(NAME)" -quiet
|
|
|
|
rmdir template
|
|
|
|
|
|
|
|
$(WC_DMG): $(TEMPLATE_DMG)
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(MASTER_DMG): $(WC_DMG) $(addprefix $(SOURCE_DIR)/,$(SOURCE_FILES))
|
|
|
|
@echo
|
|
|
|
@echo --------------------- Creating Disk Image --------------------
|
|
|
|
mkdir -p $(WC_DIR)
|
|
|
|
hdiutil attach "$(WC_DMG)" -noautoopen -quiet -mountpoint "$(WC_DIR)"
|
|
|
|
for i in $(SOURCE_FILES); do \
|
|
|
|
rm -rf "$(WC_DIR)/$$i"; \
|
2016-04-06 21:21:55 +02:00
|
|
|
ditto -rsrc "$(SOURCE_DIR)/$$i" "$(WC_DIR)/$${i##*/}"; \
|
2016-04-06 20:39:37 +02:00
|
|
|
done
|
2016-04-06 21:26:31 +02:00
|
|
|
ln -s /Applications $(WC_DIR)
|
2016-04-06 20:39:37 +02:00
|
|
|
#rm -f "$@"
|
|
|
|
#hdiutil create -srcfolder "$(WC_DIR)" -format UDZO -imagekey zlib-level=9 "$@" -volname "$(NAME) $(VERSION)" -scrub -quiet
|
|
|
|
WC_DEV=`hdiutil info | grep "$(WC_DIR)" | grep "Apple_HFS" | awk '{print $$1}'` && \
|
|
|
|
hdiutil detach $$WC_DEV -quiet -force
|
|
|
|
rm -f "$(MASTER_DMG)"
|
|
|
|
hdiutil convert "$(WC_DMG)" -quiet -format UDZO -imagekey zlib-level=9 -o "$@"
|
|
|
|
rm -rf $(WC_DIR)
|
|
|
|
@echo
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
-rm -rf $(TEMPLATE_DMG) $(MASTER_DMG) $(WC_DMG)
|