diff --git a/configure.ac b/configure.ac index 851e94d..0086668 100644 --- a/configure.ac +++ b/configure.ac @@ -209,6 +209,7 @@ data/Makefile data/db/Makefile data/db/android/Makefile data/db/open-phrase/Makefile +data/db/english/Makefile data/icons/Makefile m4/Makefile ]) diff --git a/data/Makefile.am b/data/Makefile.am index 6025de3..5da2033 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -18,31 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -WORDLIST = wordlist -ENGLISH_AWK = english.awk -ENGLISH_DB = english.db - SUBDIRS = \ db \ icons \ $(NULL) - -english_db_DATA = \ - $(ENGLISH_DB) \ - $(NULL) -english_dbdir = $(pkgdatadir)/db - -$(ENGLISH_DB): $(WORDLIST) $(ENGLISH_AWK) - $(AM_V_GEN) \ - $(RM) $@; \ - $(AWK) -f $(srcdir)/$(ENGLISH_AWK) $(srcdir)/$(WORDLIST) | @SQLITE3@ $@ || \ - ( $(RM) $@ ; exit 1 ) - -EXTRA_DIST = \ - $(WORDLIST) \ - $(ENGLISH_AWK) \ - $(NULL) - -CLEANFILES = \ - $(ENGLISH_DB) \ - $(NULL) diff --git a/data/db/Makefile.am b/data/db/Makefile.am index 398bcad..608af6d 100644 --- a/data/db/Makefile.am +++ b/data/db/Makefile.am @@ -18,6 +18,18 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +if IBUS_BUILD_DB_ANDROID +ANDROID_DIR=android +endif + +if IBUS_BUILD_DB_OPEN_PHRASE +OPEN_PHRASE_DIR=open-phrase +endif + +if IBUS_BUILD_ENGLISH_INPUT_MODE +ENGLISH_DIR=english +endif + main_db_DATA = \ create_index.sql \ $(NULL) @@ -28,8 +40,9 @@ EXTRA_DIST = \ $(NULL) SUBDIRS = \ - android \ - open-phrase \ + $(ANDROID_DIR) \ + $(OPEN_PHRASE_DIR) \ + $(ENGLISH_DIR) \ $(NULL) diff --git a/data/db/android/Makefile.am b/data/db/android/Makefile.am index d36546c..3c94c03 100644 --- a/data/db/android/Makefile.am +++ b/data/db/android/Makefile.am @@ -29,12 +29,10 @@ data_files = \ rawdict_utf16_65105_freq.txt \ $(NULL) -if IBUS_BUILD_DB_ANDROID main_db_DATA = \ android.db \ $(NULL) main_dbdir = $(pkgdatadir)/db -endif android.db: $(android_raw_data) $(create_scripts) $(AM_V_GEN) \ diff --git a/data/db/english/Makefile.am b/data/db/english/Makefile.am new file mode 100644 index 0000000..d796895 --- /dev/null +++ b/data/db/english/Makefile.am @@ -0,0 +1,43 @@ +# vim:set noet ts=4: +# +# ibus-pinyin - The Chinese PinYin engine for IBus +# +# Copyright (c) 2008-2010 Peng Huang +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +WORDLIST = wordlist +ENGLISH_AWK = english.awk +ENGLISH_DB = english.db + +english_db_DATA = \ + $(ENGLISH_DB) \ + $(NULL) +english_dbdir = $(pkgdatadir)/db + +$(ENGLISH_DB): $(WORDLIST) $(ENGLISH_AWK) + $(AM_V_GEN) \ + $(RM) $@; \ + $(AWK) -f $(srcdir)/$(ENGLISH_AWK) $(srcdir)/$(WORDLIST) | @SQLITE3@ $@ || \ + ( $(RM) $@ ; exit 1 ) + +EXTRA_DIST = \ + $(WORDLIST) \ + $(ENGLISH_AWK) \ + $(NULL) + +CLEANFILES = \ + $(ENGLISH_DB) \ + $(NULL) diff --git a/data/english.awk b/data/db/english/english.awk similarity index 100% rename from data/english.awk rename to data/db/english/english.awk diff --git a/data/wordlist b/data/db/english/wordlist similarity index 100% rename from data/wordlist rename to data/db/english/wordlist diff --git a/data/db/open-phrase/Makefile.am b/data/db/open-phrase/Makefile.am index c77b0a2..5cb995a 100644 --- a/data/db/open-phrase/Makefile.am +++ b/data/db/open-phrase/Makefile.am @@ -18,8 +18,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -if IBUS_BUILD_DB_OPEN_PHRASE db_file = open-phrase.db main_db_DATA = \ db/$(db_file) \ @@ -51,5 +49,4 @@ CLEANFILES = \ DISTCLEANFILES = \ $(DBTAR) \ $(NULL) -endif diff --git a/src/PYEnglishEditor.cc b/src/PYEnglishEditor.cc index 1fcca7e..bbfcbb5 100644 --- a/src/PYEnglishEditor.cc +++ b/src/PYEnglishEditor.cc @@ -358,7 +358,7 @@ EnglishEditor::EnglishEditor (PinyinProperties & props, Config &config) "ibus", "pinyin", "english-user.db", NULL); gboolean result = m_english_database->openDatabase - (".." G_DIR_SEPARATOR_S "data" G_DIR_SEPARATOR_S "english.db", + (".." G_DIR_SEPARATOR_S "data" G_DIR_SEPARATOR_S "db" G_DIR_SEPARATOR_S "english" G_DIR_SEPARATOR_S "english.db", "english-user.db") || m_english_database->openDatabase (PKGDATADIR G_DIR_SEPARATOR_S "db" G_DIR_SEPARATOR_S "english.db", path);