2012-11-13 13:25:15 -08:00
|
|
|
PY2INSTALLER_CMD := python $(HOME)/pyinstaller-2.0/pyinstaller.py
|
|
|
|
TAGGER_BASE := $(HOME)/Dropbox/tagger/comictagger
|
|
|
|
|
|
|
|
APP_NAME := ComicTagger
|
2012-11-14 23:38:42 -08:00
|
|
|
VERSION_STR := $(shell grep version $(TAGGER_BASE)/ctversion.py| cut -d= -f2 | sed 's/\"//g')
|
|
|
|
|
|
|
|
|
2012-11-13 13:25:15 -08:00
|
|
|
|
|
|
|
MAC_BASE := $(TAGGER_BASE)/mac
|
|
|
|
DIST_DIR := $(MAC_BASE)/dist
|
|
|
|
STAGING := $(MAC_BASE)/$(APP_NAME)
|
|
|
|
APP_BUNDLE := $(DIST_DIR)/$(APP_NAME).app
|
|
|
|
VOLUME_NAME := $(APP_NAME)-$(VERSION_STR)
|
|
|
|
DMG_FILE := $(VOLUME_NAME).dmg
|
|
|
|
|
2012-11-14 23:38:42 -08:00
|
|
|
all: clean dist diskimage
|
2012-11-13 13:25:15 -08:00
|
|
|
|
|
|
|
dist:
|
2012-11-27 09:59:08 -08:00
|
|
|
$(PY2INSTALLER_CMD) $(TAGGER_BASE)/comictagger.py -o $(MAC_BASE) -c -n $(APP_NAME) -s
|
2012-11-16 14:42:47 -08:00
|
|
|
cp $(TAGGER_BASE)/*.ui $(APP_BUNDLE)/Contents/MacOS
|
2012-11-14 23:38:42 -08:00
|
|
|
cp -a $(TAGGER_BASE)/graphics $(APP_BUNDLE)/Contents/MacOS
|
2012-11-13 13:25:15 -08:00
|
|
|
cp $(MAC_BASE)/app.icns $(APP_BUNDLE)/Contents/Resources/icon-windowed.icns
|
2012-11-14 23:38:42 -08:00
|
|
|
|
2012-11-13 13:25:15 -08:00
|
|
|
clean:
|
|
|
|
rm -rf $(DIST_DIR) $(MAC_BASE)/build
|
|
|
|
rm -f $(MAC_BASE)/*.spec
|
2012-11-20 09:26:15 -08:00
|
|
|
rm -f /logdict*.log
|
2012-11-20 11:20:02 -08:00
|
|
|
rm -f *~ *.pyc *.pyo
|
2012-11-14 23:38:42 -08:00
|
|
|
echo $(VERSION_STR)
|
2012-11-13 13:25:15 -08:00
|
|
|
diskimage:
|
|
|
|
#Set up disk image staging folder
|
|
|
|
rm -rf $(STAGING)
|
|
|
|
mkdir $(STAGING)
|
|
|
|
#cp $(TAGGER_BASE)/README.txt $(STAGING)
|
|
|
|
cp -a $(APP_BUNDLE) $(STAGING)
|
|
|
|
cp $(MAC_BASE)/volume.icns $(STAGING)/.VolumeIcon.icns
|
|
|
|
SetFile -c icnC $(STAGING)/.VolumeIcon.icns
|
|
|
|
|
|
|
|
##generate raw disk image
|
|
|
|
rm -f $(DMG_FILE)
|
|
|
|
hdiutil create -srcfolder $(STAGING) -volname $(VOLUME_NAME) -format UDRW -ov raw-$(DMG_FILE)
|
|
|
|
|
|
|
|
#remove working files and folders
|
|
|
|
rm -rf $(STAGING)
|
|
|
|
|
|
|
|
# we now have a raw DMG file.
|
|
|
|
|
|
|
|
# remount it so we can set the volume icon properly
|
|
|
|
mkdir -p $(STAGING)
|
|
|
|
hdiutil attach raw-$(DMG_FILE) -mountpoint $(STAGING)
|
|
|
|
SetFile -a C $(STAGING)
|
|
|
|
hdiutil detach $(STAGING)
|
|
|
|
rm -rf $(STAGING)
|
|
|
|
|
|
|
|
# convert the raw image
|
|
|
|
rm -f $(DMG_FILE)
|
|
|
|
hdiutil convert raw-$(DMG_FILE) -format UDZO -o $(DMG_FILE)
|
|
|
|
rm -f raw-$(DMG_FILE)
|
2012-11-20 09:26:15 -08:00
|
|
|
|