Navigation Menu

Skip to content

Commit

Permalink
Extract MeCab download script
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 18, 2015
1 parent 57b7982 commit 8e1165d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
14 changes: 1 addition & 13 deletions packages/source/Makefile.am
Expand Up @@ -8,11 +8,6 @@ TMP_FILES = \
files/$(PACKAGE)-$(VERSION)$(SUFFIX).tar.gz \
files/$(PACKAGE)-$(VERSION)$(SUFFIX).zip

MECAB_TAR_GZ = \
mecab-$(BUNDLED_MECAB_VERSION).tar.gz
MECAB_NAIST_JDIC_TAR_GZ = \
mecab-naist-jdic-$(BUNDLED_MECAB_NAIST_JDIC_VERSION).tar.gz

all:

release: upload
Expand Down Expand Up @@ -48,13 +43,6 @@ files/$(PACKAGE)-$(VERSION)$(SUFFIX).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VE
files/$(PACKAGE)-$(VERSION)$(SUFFIX).zip: files/$(PACKAGE)-$(VERSION)$(SUFFIX).tar.gz
rm -rf $(PACKAGE)-$(VERSION)$(SUFFIX)
tar xzf files/$(PACKAGE)-$(VERSION)$(SUFFIX).tar.gz
curl -L -J -O 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE'
cd $(PACKAGE)-$(VERSION)$(SUFFIX)/vendor && \
tar xzf ../../$(MECAB_TAR_GZ)
rm -rf $(MECAB_TAR_GZ)
curl -L -O 'http://osdn.dl.sourceforge.jp/naist-jdic/48487/$(MECAB_NAIST_JDIC_TAR_GZ)'
cd $(PACKAGE)-$(VERSION)$(SUFFIX)/vendor && \
tar xzf ../../$(MECAB_NAIST_JDIC_TAR_GZ)
rm -rf $(MECAB_NAIST_JDIC_TAR_GZ)
cd $(PACKAGE)-$(VERSION)$(SUFFIX)/vendor && ./download_mecab.sh
zip -r $@ $(PACKAGE)-$(VERSION)$(SUFFIX)
rm -rf $(PACKAGE)-$(VERSION)$(SUFFIX)
26 changes: 26 additions & 0 deletions vendor/download_mecab.sh
@@ -0,0 +1,26 @@
#!/bin/sh

set -e
set -u

base_dir="$(cd $(dirname "$0") && pwd)/.."

mecab_version=$(cat ${base_dir}/bundled_mecab_version)
mecab_naist_jdic_version=$(cat ${base_dir}/bundled_mecab_naist_jdic_version)

mecab_base=mecab-${mecab_version}
mecab_tar_gz=${mecab_base}.tar.gz
mecab_naist_jdic_base=mecab-naist-jdic-${mecab_naist_jdic_version}
mecab_naist_jdic_tar_gz=${mecab_naist_jdic_base}.tar.gz

curl -L -J -O \
'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE'
rm -rf ${mecab_base}
tar xzf ${mecab_tar_gz}
rm -rf ${mecab_tar_gz}

curl -L -O \
"http://osdn.dl.sourceforge.jp/naist-jdic/48487/${mecab_naist_jdic_tar_gz}"
rm -rf ${mecab_naist_jdic_base}
tar xzf ${mecab_naist_jdic_tar_gz}
rm -rf ${mecab_naist_jdic_tar_gz}

0 comments on commit 8e1165d

Please sign in to comment.