-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile_Legacy
141 lines (117 loc) · 6.04 KB
/
Makefile_Legacy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
###########################
# Makefile Legacy version for OS X 10.6 to 10.11
# for OpenThesaurus Deutsch v2024.07.14-Legacy
# by Wolfgang Kreutz
# https://github.com/Tekl/openthesaurus-deutsch
###########################
# You need to edit these values.
OS_VERSION = `sw_vers -productVersion | sed 's/\(^....\).*/\1.x/'`
OS_VERSION2 = `sw_vers -productVersion | sed 's/\(^....\).*/\1.0/'`
DICT_NAME = OpenThesaurus Deutsch
DICT_NAME_NSPC = OpenThesaurus_Deutsch
DICT_SRC_PATH = ThesaurusDeutsch.xml
CSS_PATH = ThesaurusDeutsch.css
PLIST_PATH = Info.plist
DATE = `date +"%Y.%m.%d"`
CURR_PATH = `pwd`
VERSION = `cat VERSION-LEGACY`
VERSION_ZIP = `cat ../../VERSION-LEGACY`
DICT_BUILD_OPTS = -c 2 -t 1 -e 0 -v 10.6
# Suppress adding supplementary key.
# DICT_BUILD_OPTS = -s 0 # Suppress adding supplementary key.
###########################
# The DICT_BUILD_TOOL_DIR value is used also in "build_dict.sh" script.
# You need to set it when you invoke the script directly.
DICT_BUILD_TOOL_DIR = /Developer/Auxiliary\ Tools/Dictionary\ Development\ Kit
ifeq ("$(wildcard $(DICT_BUILD_TOOL_DIR))","")
DICT_BUILD_TOOL_DIR = /Developer/Utilities/Dictionary\ Development\ Kit
endif
ifeq ("$(wildcard $(DICT_BUILD_TOOL_DIR))","")
DICT_BUILD_TOOL_DIR = /Applications/Auxiliary\ Tools/Dictionary\ Development\ Kit
endif
ifeq ("$(wildcard $(DICT_BUILD_TOOL_DIR))","")
DICT_BUILD_TOOL_DIR = /Applications/Additional\ Tools/Utilities/Dictionary\ Development\ Kit
endif
ifeq ("$(wildcard $(DICT_BUILD_TOOL_DIR))","")
DICT_BUILD_TOOL_DIR = /DevTools/Utilities/Dictionary\ Development\ Kit
endif
ifeq ("$(wildcard $(DICT_BUILD_TOOL_DIR))","")
DICT_BUILD_TOOL_DIR = /Applications/Utilities/Dictionary\ Development\ Kit
endif
DICT_BUILD_TOOL_BIN = $(DICT_BUILD_TOOL_DIR)/bin
###########################
DICT_DEV_KIT_OBJ_DIR = ./objects
export DICT_DEV_KIT_OBJ_DIR
DESTINATION_FOLDER = ~/Library/Dictionaries
RM = /bin/rm
CR = `echo "\r"`
###########################
all: createxmlbeta build
release: createxml build
releasedist: createxml build releasedmg notarize
createxmlbeta:
@echo $(DATE)-legacy-beta > VERSION-LEGACY
@python3 createxml.py beta legacy
createxml:
@echo $(DATE)-legacy > VERSION-LEGACY
@python3 createxml.py release legacy
build:
@$(DICT_BUILD_TOOL_BIN)/build_dict.sh $(DICT_BUILD_OPTS) "$(DICT_NAME)" "$(DICT_SRC_PATH)" "$(CSS_PATH)" "$(PLIST_PATH)"
@mkdir "$(DICT_DEV_KIT_OBJ_DIR)/Dictionaries"
@mkdir releases/$(VERSION)/ | true
@Rez -a images/icons/dictplug.rsrc -o "$(DICT_DEV_KIT_OBJ_DIR)/$(DICT_NAME).dictionary/Icon"$$'\r'
@SetFile -a C "$(DICT_DEV_KIT_OBJ_DIR)/$(DICT_NAME).dictionary"
@SetFile -a V "$(DICT_DEV_KIT_OBJ_DIR)/$(DICT_NAME).dictionary/Icon"$$'\r'
@mv -f "$(DICT_DEV_KIT_OBJ_DIR)/$(DICT_NAME).dictionary" "$(DICT_DEV_KIT_OBJ_DIR)/Dictionaries/"
@cd objects/Dictionaries; zip -r "../../releases/$(VERSION_ZIP)/${DICT_NAME_NSPC}-Legacy_dictionaryfile.zip" "$(DICT_NAME).dictionary/"
@echo "Done."
@echo "Use 'make -f Makefile_Legacy install' to install the dictionary or 'make -f Makefile_Legacy dmg' or 'make -f Makefile_Legacy releasedmg' to create the Disk Image."
@afplay /System/Library/Sounds/Purr.aiff > /dev/null
dmg:
@echo "Creating Beta Installer ..."
@mkdir "releases/$(VERSION)/" | true
@/usr/local/bin/packagesbuild --build-folder "$(shell pwd)/releases" "installer/$(DICT_NAME).pkgproj"
@/usr/bin/productsign --sign "Developer ID Installer: Wolfgang Kreutz (3D3Y3WDMYF)" "$(shell pwd)/releases/$(DICT_NAME) Temp.pkg" "$(shell pwd)/releases/$(DICT_NAME) Installation.pkg"
@rm "$(shell pwd)/releases/$(DICT_NAME) Temp.pkg"
@echo "Creating Beta Disk Image …"
/Applications/DMG\ Canvas.app/Contents/Resources/dmgcanvas installer/$(DICT_NAME_NSPC).dmgCanvas releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg -setTextString version v$(VERSION)
@echo "Legacy Beta Installer and Beta Disk Image created."
@open releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg
@echo "- use 'make -f Makefile_Legacy notarize' to notarize and staple the disk image"
@afplay /System/Library/Sounds/Purr.aiff > /dev/null
releasedmg:
@echo "Creating Installer ..."
@mkdir "releases/$(VERSION)/" | true
@/usr/local/bin/packagesbuild --build-folder "$(shell pwd)/releases" "installer/$(DICT_NAME).pkgproj"
@/usr/bin/productsign --sign "Developer ID Installer: Wolfgang Kreutz (3D3Y3WDMYF)" "$(shell pwd)/releases/$(DICT_NAME) Temp.pkg" "$(shell pwd)/releases/$(DICT_NAME) Installation.pkg"
@rm "$(shell pwd)/releases/$(DICT_NAME) Temp.pkg"
@echo "Creating Disk Image …"
@/Applications/DMG\ Canvas.app/Contents/Resources/dmgcanvas installer/$(DICT_NAME_NSPC).dmgCanvas releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg -setTextString version v$(VERSION)
@echo "Legacy Installer and Disk Image created."
@open releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg
@echo "- use 'make -f Makefile_Legacy notarize' to notarize and staple the disk image"
@afplay /System/Library/Sounds/Purr.aiff > /dev/null
notarize:
xcrun notarytool submit --keychain-profile 3D3Y3WDMYF --wait releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg
xcrun stapler staple releases/$(VERSION)/$(DICT_NAME_NSPC)-Legacy.dmg
install:
@echo "Installing into $(DESTINATION_FOLDER)".
@osascript -e 'tell application "Dictionary.app" to quit'
@rm -rf ~/Library/Caches/com.apple.DictionaryApp
@rm -rf ~/Library/Caches/com.apple.DictionaryManager
@rm -rf ~/Library/Caches/com.apple.Dictionary
@rm -rf ~/Library/Caches/com.apple.DictionaryServices
@rm -rf $(DESTINATION_FOLDER)/"$(DICT_NAME)".dictionary
@defaults write com.apple.Dictionary WebKitDeveloperExtras -bool true
@mkdir -p $(DESTINATION_FOLDER)
@ditto --noextattr $(DICT_DEV_KIT_OBJ_DIR)/Dictionaries/"$(DICT_NAME)".dictionary $(DESTINATION_FOLDER)/"$(DICT_NAME)".dictionary
@touch $(DESTINATION_FOLDER)
@echo "Done."
@open -a Dictionary
@echo "To test the new dictionary, try Dictionary.app."
@afplay /System/Library/Sounds/Purr.aiff > /dev/null
clean:
$(RM) -rf $(DICT_DEV_KIT_OBJ_DIR)
$(RM) -rf $(DICT_DEV_KIT_OBJ_DIR)_leo
$(RM) -f $(DICT_SRC_PATH)
@afplay /System/Library/Sounds/Purr.aiff > /dev/null