Fix rpm build problems.
authorPeng Huang <shawn.p.huang@gmail.com>
Mon, 5 Oct 2009 06:51:38 +0000 (14:51 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Mon, 5 Oct 2009 06:51:38 +0000 (14:51 +0800)
data/db/google/create_db_from_google.py
data/db/open-phrase/Makefile.am
ibus-pinyin.spec.in

index ff4b7f8..4cb3c61 100755 (executable)
@@ -49,7 +49,7 @@ def create_db():
             s, y = pinyin_id[s], pinyin_id[y]
             columns.append(s)
             columns.append(y)
-        values = "'%s', %d, %s" % (hanzi, l - i, ",".join(map(str,columns)))
+        values = "'%s', %d, %s" % (hanzi.encode("utf8"), l - i, ",".join(map(str,columns)))
             
         sql = insert_sql % (len(hanzi) - 1, values)
         print sql
index 5947abb..2acc892 100644 (file)
@@ -23,7 +23,6 @@ if IBUS_BUILD_DB_OPEN_PHRASE
 db_file = open-phrase.db
 main_db_DATA = \
        db/$(db_file) \
-       db/COPYING \
        $(NULL)
 main_dbdir = $(pkgdatadir)/db
 
index d6e2b72..3b350c2 100644 (file)
@@ -14,7 +14,7 @@ BuildRequires:  gettext-devel
 BuildRequires:  libtool
 BuildRequires:  pkgconfig
 BuildRequires:  sqlite-devel
-BuildRequires:  libuuid-devel
+BuildRequires:  libuuid-devel
 BuildRequires:  ibus-devel >= 1.2.0
 
 Requires(post): sqlite
@@ -24,12 +24,20 @@ Requires:   ibus >= 1.2.0
 %description
 The Chinese Pinyin input method for IBus platform.
 
+%package    open-phrase
+Summary:    The open phrase database for ibus Pinyin
+Group:      System Environment/Libraries
+Requires(post): sqlite
+
+%description open-phrase
+The open phrase database for ibus Pinyin engine.
+
 %prep
 %setup -q
-cp %{SOURCE1} data
+cp %{SOURCE1} data/db/open-phrase
 
 %build
-%configure --disable-static
+%configure --disable-static --enable-db-open-phrase
 # make -C po update-gmo
 make %{?_smp_mflags}
 
@@ -44,16 +52,28 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 cd %{_datadir}/ibus-pinyin/db
-sqlite3 main.db ".read create_index.sql"
+sqlite3 google.db ".read create_index.sql"
+
+%post open-phrase
+cd %{_datadir}/ibus-pinyin/db
+sqlite3 open-phrase.db ".read create_index.sql"
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
 %doc AUTHORS COPYING README
 %{_libexecdir}/ibus-engine-pinyin
 %{_libexecdir}/ibus-setup-pinyin
-%{_datadir}/@PACKAGE@
+%{_datadir}/@PACKAGE@/icons
+%{_datadir}/@PACKAGE@/setup
+%{_datadir}/@PACKAGE@/db/create_index.sql
+%{_datadir}/@PACKAGE@/db/google.db
+%dir %{_datadir}/@PACKAGE@
+%dir %{_datadir}/@PACKAGE@/db
 %{_datadir}/ibus/component/*
 
+%files open-phrase
+%{_datadir}/@PACKAGE@/db/open-phrase.db
+
 %changelog
 * Fri Aug 08 2008 Peng Huang <shawn.p.huang@gmail.com> - @VERSION@-1
 - The first version.