diff --git a/Makefile b/Makefile index f3b7fd7..23f39d1 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,33 @@ -FILENAME=ecdict-ultimate-csv -CSVNAME=ultimate PKGNAME=ecdict +CSVNAME=ultimate +FILENAME=ecdict-ultimate-csv +URL=https://github.com/skywind3000/ECDICT-ultimate ifndef VERSION VERSION=1.0.0 endif -all: build - -build: $(PKGNAME).index $(PKGNAME).dict.dz - -download: $(FILENAME).zip +all: $(PKGNAME).index $(PKGNAME).dict.dz $(FILENAME).zip: - curl -kLO https://github.com/skywind3000/ECDICT-ultimate/releases/download/$(VERSION)/$(FILENAME).zip + curl -kLO $(URL)/releases/download/$(VERSION)/$(FILENAME).zip -$(PKGNAME).tmp: $(FILENAME).zip - unzip $(FILENAME).zip && mv $(CSVNAME).csv $(PKGNAME).tmp +$(PKGNAME).csv: $(FILENAME).zip + unzip $(FILENAME).zip && mv $(CSVNAME).csv $(PKGNAME).csv -$(PKGNAME).txt: $(PKGNAME).tmp +$(PKGNAME).txt: $(PKGNAME).csv ifdef FULL - python ./$(PKGNAME).py ./$(PKGNAME).tmp $(PKGNAME).txt + python ./$(PKGNAME).py ./$(PKGNAME).csv $(PKGNAME).txt else - python ./$(PKGNAME)s.py ./$(PKGNAME).tmp $(PKGNAME).txt + python ./$(PKGNAME)s.py ./$(PKGNAME).csv $(PKGNAME).txt endif $(PKGNAME).index $(PKGNAME).dict.dz: $(PKGNAME).txt - dictfmt --utf8 --allchars -s ECDICT -u https://github.com/skywind3000/ECDICT -j $(PKGNAME) < ./$(PKGNAME).txt - dictzip $(PKGNAME).dict + dictfmt --utf8 --allchars -s ECDICT -u $(URL) -j $(PKGNAME) < ./$(PKGNAME).txt && dictzip $(PKGNAME).dict install: $(PKGNAME).index $(PKGNAME).dict.dz install -Dm644 $(PKGNAME).index -t $(DESTDIR)/usr/share/dict/ install -Dm644 $(PKGNAME).dict.dz -t $(DESTDIR)/usr/share/dict/ clean: - -rm -f $(PKGNAME).{index,dict.dz,txt,tmp} + -rm -f $(PKGNAME).{index,dict.dz,txt,csv} diff --git a/README.md b/README.md index 245f097..877b58f 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,16 @@ 3. dictd 4. make -### Build && Installation +### Build && Install ```Makefile -make +make # FULL=true sudo make install ``` -Also, there is a simplified version: -```Makefile -make build_simp -sudo make install_simp +Also it's avaliable in [AUR](https://aur.archlinux.org/packages/dict-ecdict-git/): +``` +yay -S dict-ecdict-git ``` + ### Configuration Add these lines below in `/etc/dict/dictd.conf`: ```dictdconf @@ -30,22 +30,14 @@ data /usr/share/dict/ecdict.dict.dz index /usr/share/dict/ecdict.index } ``` -For the simplified version: -```dictdconf -database ecdicts { -data /usr/share/dict/ecdicts.dict.dz -index /usr/share/dict/ecdicts.index -} -``` Then restart `dictd.service`: ```shell systemctl restart dictd ``` ## Acknowledgements -1. [ECDICT](https://github.com/skywind3000/ECDICT-ultimate): Released under MIT license. All rights reserved by the author. +1. [ECDICT]: Released under MIT license. All rights reserved by the author. 2. [dictd](https://en.wikipedia.org/wiki/DICT): Dict file format. -3. [fcitx5-pinyin-zhwiki](https://github.com/felixonmars/fcitx5-pinyin-zhwiki): Makefile. [ECDICT]:https://github.com/skywind3000/ECDICT-ultimate [license]:https://img.shields.io/badge/license-MIT-purple.svg