summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Huang <shawn.p.huang@gmail.com>2012-01-03 10:29:23 -0500
committerPeng Huang <shawn.p.huang@gmail.com>2012-01-03 10:29:23 -0500
commitdae2d6bf943e7455692db80f60fc3d0567b7705d (patch)
treed320a0b3c2ba8ab8237d474cc0023f3fc60e99bb
parent0e658c782158a8973bd2e6f3ae6c627daf7d191a (diff)
downloadibus-pinyin-dae2d6bf943e7455692db80f60fc3d0567b7705d.tar.gz
Refine Makefile and do not install engine.db if English mode is disabled.
Move english related files into data/db/english folder and update Makefile.am BUG=None TEST=make & make install Review URL: http://codereview.appspot.com/5503058
-rw-r--r--configure.ac1
-rw-r--r--data/Makefile.am24
-rw-r--r--data/db/Makefile.am17
-rw-r--r--data/db/android/Makefile.am2
-rw-r--r--data/db/english/Makefile.am43
-rw-r--r--data/db/english/english.awk (renamed from data/english.awk)0
-rw-r--r--data/db/english/wordlist (renamed from data/wordlist)0
-rw-r--r--data/db/open-phrase/Makefile.am3
-rw-r--r--src/PYEnglishEditor.cc2
9 files changed, 60 insertions, 32 deletions
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 <shawn.p.huang@gmail.com>
+#
+# 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
index 1828d2c..1828d2c 100644
--- a/data/english.awk
+++ b/data/db/english/english.awk
diff --git a/data/wordlist b/data/db/english/wordlist
index 612aced..612aced 100644
--- a/data/wordlist
+++ b/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);