Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tuberry committed Nov 22, 2020
1 parent 6594129 commit 7404d50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
28 changes: 12 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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}
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 7404d50

Please sign in to comment.