# *********************************************************************** # # This is a makefile that builds distribution packages for proofing tools # # *********************************************************************** # # =============================== # # Variable definitions # # =============================== # # ************** Installer version ************** # export VERSION = 2.3 # OS-dependent variable setting # The OS test has to check on the substring 10.4, otherwise it will return # 10.4.10 etc. Default is Leopard installation DEVBINDIR = /Developer/usr/bin # If running under Tiger, use the following setup instead: ifeq (10.4, $(findstring 10.4, $(shell sw_vers -productVersion))) DEVBINDIR = /Developer/Tools endif ifeq ($(TARGET), sme) HUTARGET=se endif ifeq ($(TARGET), smj) HUTARGET=smj endif ifeq ($(TARGET), sma) HUTARGET=sma endif # =========== tools ============= # export GUNZIP = /usr/bin/gunzip export REZ = $(DEVBINDIR)/Rez export SETFILE = $(DEVBINDIR)/SetFile export PACKMKR = $(DEVBINDIR)/packagemaker export MKDIR = /bin/mkdir -p export CP = /bin/cp -fpR export LN = /bin/ln -f -s -h export SSH = /usr/bin/ssh export SCP = scp -CEp # =========== paths ============= # GT = $(GTHOME)/gt LEXHUDIR = $(GT)/$(TARGET)/hunspell export ROOT = $(GTHOME)/prooftools export BUILD = $(ROOT)/build export TOOLLIBS = $(ROOT)/toollibs TMP = $(ROOT)/tmp export DOWNLOADDIR = $(TMP)/download # Distro build dirs: export MACDISTDIR := $(BUILD)/officedmg export MACDISTINDESIGN := $(BUILD)/indesigndmg export ISODISKDIR := $(BUILD)/isodisk export DISTRODIR := $(BUILD)/distro # Readme paths: USERDOCMACDIR = userdoc/mac # Name variables: CDVOLNAME = Divvun\ Proofing\ Tools export WINDOWSINSTNAME = MSOfficeDivvunTools export DIVVUNTOOLSNAME = sami-proofing-tools export INDESIGNDIVNAME = indesign-divvuntools # =========== sites ============= # SITE = divvun.no SITEURL = http://$(SITE) UPLOADDIR = sd@divvun.no: #READMESITEMS = $(SITEURL)/doc/proof/spelling/msoff READMESITEMS = $(SITEURL)/leaflet READMESITEOOO = $(SITEURL)/doc/proof/spelling/X-spell READMESITEID = $(SITEURL)/doc/proof/hyph/InDesign DOWNLOADURL = $(SITEURL)/static_files # =========== PL Lexicon files ============= # WINSMESPELL = mssp3samiNorthern.lex WINSMJSPELL = mssp3samiLule.lex WINSMASPELL = mssp3samiSout.lex # =========== Hunspell Lexicon files ============= # HUNSPELLSME = se.hunspell.zip HUNSPELLSMJ = smj.hunspell.zip HUNSPELLSMA = sma.hunspell.zip # =========== Hunspell files & variables ============= # export HUVERSION = $(shell cat $(GT)/common/hunspell/version.txt) export HUTARDIR = hunspell-smi-$(HUVERSION).$(DATE) export HUTAR = hunspell-smi # =========== other ============= # export DATE = $(shell date +%Y%m%d) all: local #all: ms-mac-update # This doesn't work yet - too many subtargets are unimplemented at the moment .PHONY: full full: lex-clean lexicons local upload # userdocs .PHONY: distro distro: full links .PHONY: local local: clean dirs installers distros .PHONY: installers installers: $(MAKE) -w -C installers .PHONY: userdocs userdocs: $(MAKE) -C userdocs .PHONY: distros distros: mac-dmg id-dmg iso-disk # ooo-hunspell indesign-dmg # ooo-voikko coming later #Convencience target - creates both the Mac and the Win installers. ms-installers: clean iso-disk .PHONY: dirs dirs: @echo "*** Setting up dirs ***" $(MKDIR) $(MACDISTINDESIGN) $(MKDIR) $(MACDISTDIR) $(MKDIR) $(ISODISKDIR) $(MKDIR) $(DISTRODIR) .PHONY: $(DISTRODIR)/$(DIVVUNTOOLSNAME)-$(DATE).dmg mac-dmg: $(DISTRODIR)/$(DIVVUNTOOLSNAME)-$(DATE).dmg $(DISTRODIR)/$(DIVVUNTOOLSNAME)-$(DATE).dmg: # ooo-dmg-dist @echo @echo "*** creating disk image ***" @echo @hdiutil create -ov \ -srcfolder $(MACDISTDIR) \ -volname $(CDVOLNAME) \ $@ id-dmg: # id-readme @echo @echo "*** creating Divvun for InDesign/Mac disk image ***" @echo @hdiutil create -ov \ -srcfolder $(MACDISTINDESIGN) \ -volname InDesign\ $(CDVOLNAME) \ $(DISTRODIR)/$(INDESIGNDIVNAME)-$(DATE).dmg .PHONY: iso-disk iso-disk: # ooo-iso-dist @echo @echo "*** Preparing ISO CD disk image creation ***" @echo @$(MKDIR) $(ISODISKDIR)/Documentation @echo @echo "*** copying Mac installer ***" @echo @cp -R $(MACDISTDIR)/* $(ISODISKDIR)/ # @echo # @echo "*** copying documentation ***" # @echo # @mv $(ISODISKDIR)/*.pdf $(ISODISKDIR)/Documentation/ # @mv $(ISODISKDIR)/*.txt $(ISODISKDIR)/Documentation/ @echo @echo "*** making hybrid disk image ***" @echo hdiutil makehybrid -o $(DISTRODIR)/DivvunToolsCD-$(DATE).iso $(ISODISKDIR) \ -hfs -iso -joliet \ -hide-hfs \ "$(ISODISKDIR)/{Autorun.inf,installerMLS.ini,installers,*.exe,*.pdf,*.txt}" \ -hide-iso '$(ISODISKDIR)/{*.pkg,*.app,*.localized}' \ -hide-joliet '$(ISODISKDIR)/{*.pkg,*.app,*.localized}' \ -iso-volume-name "Divvun" \ -joliet-volume-name $(CDVOLNAME) \ -hfs-volume-name $(CDVOLNAME) \ -default-volume-name "Divvun" \ -hfs-openfolder "/Volumes/$(CDVOLNAME)/" # -verbose \ @echo @echo "*** converting disk image to CD master ***" @echo hdiutil convert $(DISTRODIR)/DivvunToolsCD-$(DATE).iso -format UDTO \ -o $(DISTRODIR)/DivvunToolsCD-$(DATE) mv -f $(DISTRODIR)/DivvunToolsCD-$(DATE).cdr $(DISTRODIR)/DivvunToolsCD-$(DATE).iso # Upload Mac installer to download site - for internal testing only, use the : upload-mac: @echo @echo "*** Uploading Mac installer to www.divvun.no ***" @echo scp $(DISTRODIR)/$(DIVVUNTOOLSNAME)-$(DATE).dmg $(UPLOADDIR)staticfiles/ @echo @echo "*** A new installation package is now available at: ***" @echo @echo "$(DOWNLOADURL)/$(DIVVUNTOOLSNAME)-$(DATE).dmg" @echo # Upload installers to download site: upload: @echo @echo "*** Uploading installation files to www.divvun.no ***" @echo @scp $(DISTRODIR)/$(DIVVUNTOOLSNAME)-$(DATE).dmg $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/$(WINDOWSINSTNAME)-$(DATE).exe $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/$(INDESIGNDIVNAME)-$(DATE).dmg $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/DivvunToolsCD-$(DATE).iso $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/$(HUTARDIR).tar.gz $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/smi-$(DATE).oxt $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/smi-$(DATE).zip $(UPLOADDIR)static_files/ @scp $(DISTRODIR)/smi-pack-$(DATE).zip $(UPLOADDIR)static_files/ @echo @echo "*** New installation packages are now available at: ***" @echo @echo "$(DOWNLOADURL)/$(DIVVUNTOOLSNAME)-$(DATE).dmg - Mac" @echo "$(DOWNLOADURL)/$(WINDOWSINSTNAME)-$(DATE).exe - Win" @echo "$(DOWNLOADURL)/DivvunToolsCD-$(DATE).iso - CD Master" @echo "$(DOWNLOADURL)/$(INDESIGNDIVNAME)-$(DATE).dmg - InDesign Mac" @echo "$(DOWNLOADURL)/$(HUTARDIR).tar.gz - Hunspell for Linux" @echo "$(DOWNLOADURL)/smi-$(DATE).zip - Basic Hunspell distro" @echo "$(DOWNLOADURL)/smi-$(DATE).oxt - OpenOffice 3.x" @echo "$(DOWNLOADURL)/smi-pack-$(DATE).zip - OpenOffice 2.4" @echo links: @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf $(DIVVUNTOOLSNAME)-$(DATE).dmg $(DIVVUNTOOLSNAME).dmg" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf $(WINDOWSINSTNAME)-$(DATE).exe $(WINDOWSINSTNAME).exe" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf DivvunToolsCD-$(DATE).iso DivvunToolsCD.iso" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf $(INDESIGNDIVNAME)-$(DATE).dmg $(INDESIGNDIVNAME).dmg" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf $(HUTARDIR).tar.gz $(HUTAR).tar.gz" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf smi-$(DATE).zip smi.zip" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf smi-$(DATE).oxt smi.oxt" @$(SSH) sd@divvun.no "cd staticfiles/ && ln -sf smi-pack-$(DATE).zip smi-pack.zip" @echo @echo "*** Permlinks to newest versions are: ***" @echo @echo "$(DOWNLOADURL)/$(DIVVUNTOOLSNAME).dmg - Mac" @echo "$(DOWNLOADURL)/$(WINDOWSINSTNAME).exe - Win" @echo "$(DOWNLOADURL)/DivvunToolsCD.iso - CD Master" @echo "$(DOWNLOADURL)/$(INDESIGNDIVNAME).dmg - InDesign Mac" @echo "$(DOWNLOADURL)/$(HUTAR).tar.gz - Linux distro" @echo "$(DOWNLOADURL)/smi.zip - Basic Hunspell distro" @echo "$(DOWNLOADURL)/smi.oxt - OpenOffice 3.x" @echo "$(DOWNLOADURL)/smi-pack.zip - OpenOffice 2.4" @echo id-readme: @echo @echo "*** downloading README files ***" @echo @curl -o $(IDtmp)/README.tmp $(READMESITEID)/index.txt @cat BOM.txt $(IDtmp)/README.tmp > $(IDtmp)/README.txt @rm -f $(IDtmp)/*.tmp @curl -o $(IDtmp)/README.pdf $(READMESITEID)/index.pdf # The default is to download all lexicons download: cd-download # When downloading for CD preparation, include ooo-download cd-download: ooo-download msdownload # This download target is used to fetch the files needed for packaging and # distribution of the MS Office tools. msdownload: mslex-download #msdoc-download # This download target is used to fetch the files needed for packaging and # distribution of the Adobe InDesign tools. iddownload: mslex-download ooo-download: @echo @echo "*** Downloading OpenOffice.org speller files and docu for CD distribution ***" @echo @$(MKDIR) $(TMP)/OpenOffice.org @curl -o $(TMP)/Readme.OOo.txt $(READMESITEOOO)/install_use_3x.txt @cat BOM.txt $(TMP)/Readme.OOo.txt > $(TMP)/OpenOffice.org/Readme.OOo.txt @curl -o $(TMP)/OpenOffice.org/Readme.OOo.pdf $(READMESITEOOO)/install_use_3x.pdf @rm -f $(TMP)/Readme.OOo.txt # Target for downloading lexicon files lexicons: mslex-download hunspell-lex-download mslex-download: @echo @echo "*** Downloading MS Office lexicon files for packaging & distribution ***" @echo @$(MKDIR) $(DOWNLOADDIR) curl -o $(DOWNLOADDIR)/$(WINSMESPELL) $(DOWNLOADURL)/$(WINSMESPELL) curl -o $(DOWNLOADDIR)/$(WINSMJSPELL) $(DOWNLOADURL)/$(WINSMJSPELL) curl -o $(DOWNLOADDIR)/$(WINSMASPELL) $(DOWNLOADURL)/$(WINSMASPELL) # static_files/$DATO-se.hunspell.zip hunspell-lex-download: @echo @echo "*** Downloading Hunspel lexicon files for packaging & distribution ***" @echo curl -o $(DOWNLOADDIR)/$(HUNSPELLSME) $(DOWNLOADURL)/$(HUNSPELLSME) unzip -o $(DOWNLOADDIR)/$(HUNSPELLSME) -d $(DOWNLOADDIR) curl -o $(DOWNLOADDIR)/$(HUNSPELLSMJ) $(DOWNLOADURL)/$(HUNSPELLSMJ) unzip -o $(DOWNLOADDIR)/$(HUNSPELLSMJ) -d $(DOWNLOADDIR) curl -o $(DOWNLOADDIR)/$(HUNSPELLSMA) $(DOWNLOADURL)/$(HUNSPELLSMA) unzip -o $(DOWNLOADDIR)/$(HUNSPELLSMA) -d $(DOWNLOADDIR) dist-clean: lex-clean clean # Delete all generated files, but not the downloaded lex files: clean: @echo @echo "*** Cleaning build dirs ***" @echo @rm -rf $(BUILD) $(MAKE) -C installers $@ # Delete downloaded lexicons and all generated files: dist-clean: clean @echo @echo "*** Removing downloaded lexicons ***" @echo @rm -rf $(TMP)