--- libchewing-0.3.2.orig/debian/watch
+++ libchewing-0.3.2/debian/watch
@@ -0,0 +1,6 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site		Directory		Pattern			Version	Script
+version=2
+http://chewing.csie.net/download/libchewing/libchewing-(.*)\.tar.(bz2|gz)
--- libchewing-0.3.2.orig/debian/libchewing3-data.install
+++ libchewing-0.3.2/debian/libchewing3-data.install
@@ -0,0 +1,2 @@
+usr/share/libchewing3/chewing/*.dat
+usr/share/libchewing3/chewing/*.tab
--- libchewing-0.3.2.orig/debian/control
+++ libchewing-0.3.2/debian/control
@@ -0,0 +1,61 @@
+Source: libchewing
+Section: libs
+Priority: optional
+Maintainer: Kanru Chen <koster@debian.org.tw>
+Uploaders: Andrew Lee (李健秋) <ajqlee@debian.org>
+Build-Depends: debhelper (>= 7), gcc (>= 3:3.3), libtool (>= 1.5.6), dpatch
+Standards-Version: 3.8.0
+Homepage: http://chewing.csie.net
+DM-Upload-Allowed: yes
+Vcs-Git: git://git.debian.org/git/users/kanru-guest/libchewing.git
+Vcs-Browser: http://git.debian.org/?p=users/kanru-guest/libchewing.git;a=summary
+
+Package: libchewing3-dev
+Conflicts: libchewing-dev, libchewing1-dev, libchewing2-dev
+Section: libdevel
+Priority: optional
+Architecture: any
+Depends: libchewing3 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: intelligent phonetic input method library (developer version)
+ libchewing is an intelligent phonetic input method library for Chinese.
+ .
+ It provides the core algorithm and logic so that they can be shared among
+ the various input methods like JMCCE, xcin-chewing, scim-chewing, 
+ iiimf-chewing, screen-chewing, ime-chewing, etc.
+ .
+ The Chewing input method is a smart bopomofo fonetics input method that
+ is useful for inputing Mandarin Chinese based language.
+
+Package: libchewing3
+Provides: libchewing
+Section: libs
+Priority: optional
+Architecture: any
+Depends: libchewing3-data (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Conflicts: scim-chewing (<< 0.3.3)
+Description: intelligent phonetic input method library
+ libchewing is an intelligent phonetic input method library for Chinese.
+ .
+ It provides the core algorithm and logic so that they can be shared among
+ the various input methods like JMCCE, xcin-chewing, scim-chewing, 
+ iiimf-chewing, screen-chewing, ime-chewing, etc.
+ .
+ The Chewing input method is a smart bopomofo fonetics input method that
+ is useful for inputing Mandarin Chinese based language.
+
+Package: libchewing3-data
+Provides: libchewing-data
+Conflicts: libchewing-data (<= 0.2.7)
+Section: misc
+Priority: optional
+Architecture: any
+Depends: ${misc:Depends}
+Description:intelligent phonetic input method library - data files
+ libchewing is an intelligent phonetic input method library for Chinese.
+ .
+ It provides the core algorithm and logic so that they can be shared among
+ the various input methods like JMCCE, xcin-chewing, scim-chewing, 
+ iiimf-chewing, screen-chewing, ime-chewing, etc.
+ .
+ The Chewing input method is a smart bopomofo fonetics input method that
+ is useful for inputing Mandarin Chinese based language.
--- libchewing-0.3.2.orig/debian/copyright
+++ libchewing-0.3.2/debian/copyright
@@ -0,0 +1,29 @@
+This package was debianized by Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw> on
+Sat,  3 Jul 2004 21:08:32 +0800.
+
+It was downloaded from http://chewing.csie.net
+
+Copyright:
+
+Upstream Author: Jim Huang <jserv@kaffe.org>
+
+License:
+
+   Copyright(c) 2004, Jim Huang <jserv@kaffe.org>
+
+   This library is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Lesser General Public License as published
+   by the Free Software Foundation; either version 2.1 of the License, or
+   (at your option) any later version.
+
+   This library 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 Lesser General Public
+   License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this library; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+On Debian systems, the complete text of the GNU Lesser General Public
+License can be found in `/usr/share/common-licenses/LGPL'.
--- libchewing-0.3.2.orig/debian/changelog
+++ libchewing-0.3.2/debian/changelog
@@ -0,0 +1,151 @@
+libchewing (0.3.2-2) unstable; urgency=low
+
+  [ Zhengpeng Hou ]
+  * Add 01_fix_zuin_count_return.diff from upstream svn, which will make
+    ibus-chewing work. (Closes: #551368)
+
+  [ Andrew Lee (李健秋) ]
+  * Accepted debdiff patch from Zhengpeng Hou and upload as maintainer 
+    Kanru Chen's request.
+  * Refine debian/rules
+
+ -- Andrew Lee (李健秋) <ajqlee@debian.org>  Wed, 21 Oct 2009 00:08:42 +0800
+
+libchewing (0.3.2-1) unstable; urgency=low
+
+  * New Upstream Version 
+  * [5d96bf5] Update watch address
+  * [351d417] Add Vcs-Git field
+  * [63cd26a] Add Vcs-Browser field
+  * [e2a59e2] Conflict with scim-chewing << 0.3.3
+  * [cd15be8] Change libchewing3-data from all to any since we build
+    binary data now.
+
+ -- Kanru Chen <koster@debian.org.tw>  Thu, 04 Dec 2008 15:34:03 +0800
+
+libchewing (0.3.1-1) unstable; urgency=low
+
+  * New Upstream Version
+  * Update standards-version to 3.8.0
+  * Add Homepage header
+  * Add Priority to all binary package field
+  * Add Andrew Lee <andrew@linux.org.tw> to Uploaders
+  * Change debhelper compatibility to 7
+  * Simplify debian/rules
+  * Conflict with scim-chewing (<< 0.3.2)
+  * Now build libchewing3-data in binary-indep (Closes: #303000)
+  * Closes: #427974: cannot type any zuo words. Fixed upstream.
+
+ -- Kanru Chen <koster@debian.org.tw>  Wed, 12 Nov 2008 16:48:32 +0800
+
+libchewing (0.3.0-1) unstable; urgency=low
+
+  * New upstream release
+  * Bump major version to 3
+  * Change debhelper compatibility to 5
+  * Update standards-version to 3.7.2.0
+  * Not install *.la files anymore.
+  * Install -data files to libchewing3/chewing instead of chewing
+    to maintain the compatibility of old -data packages
+  * Update README.Debian
+  * Change libchewing3-data architecture to any (Closes: #303000)
+
+ -- Kanru Chen <koster@debian.org.tw>  Mon, 15 May 2006 16:17:40 +0800
+
+libchewing (0.2.7-1) unstable; urgency=low
+
+  * New upstream release.
+  * New standards version (3.6.2, no changes).
+
+ -- Kanru Chen <koster@debian.org.tw>  Tue, 16 Aug 2005 14:46:14 +0800
+
+libchewing (0.2.6+svn20050326-1) unstable; urgency=high
+
+  * Upstream SVN snapshot.
+    + Using snapshot which fixed some unexpected exit() call.
+  * Change libcheiwng2-dev section to 'libdevel'.
+  * Added missing Build-Depends of dpatch.
+  * Set urgency to high, Closes: #301462: FTBFS: typo in Build-Depends line
+  * Auto generated documents are broken and not really helpful now, remove
+    them temporarily.
+
+ -- Kanru Chen <koster@debian.org.tw>  Wed, 30 Mar 2005 21:46:31 +0800
+
+libchewing (0.2.6-2) unstable; urgency=low
+
+  * libchewing-data: Changed Architecture: any to all
+  * Remove Provides, cause Provides and Conflicts should not be 
+    together.
+
+ -- Kanru Chen <koster@debian.org.tw>  Wed,  2 Mar 2005 20:54:18 +0800
+
+libchewing (0.2.6-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Kanru Chen <koster@debian.org.tw>  Mon, 28 Feb 2005 11:00:45 +0800
+
+libchewing (0.2.5-2) unstable; urgency=low
+
+  * Update descriptions in control file.
+  * Maintainer's email changed. 
+  * Execute scripts/remove-autotool.sh after 'make clean'.
+  * Remove doxygen auto produced files after 'make clean'.
+
+ -- Kanru Chen <koster@debian.org.tw>  Fri, 11 Feb 2005 15:20:51 +0800
+
+libchewing (0.2.5-1) unstable; urgency=low
+
+  * New upstream release.
+  * Back to normal debian/rules.
+  * Update README.Debian.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Tue, 28 Dec 2004 12:53:56 +0800
+
+libchewing (0.2.4-2) unstable; urgency=low
+
+  * Use cdbs common package build system.
+  * Back to libchewing-data. I did wrong thing. 
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Thu,  7 Oct 2004 22:18:53 +0800
+
+libchewing (0.2.4-1) unstable; urgency=low
+
+  * New upstream release. 
+  * ABI changed.
+  * Change package name form libchewing-data to libchewing1-data and set
+    conflict.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Tue,  5 Oct 2004 20:25:47 +0800
+
+libchewing (0.2.3-2) unstable; urgency=low
+
+  * Added support for pkg-config.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Thu,  5 Aug 2004 23:27:30 +0800
+
+libchewing (0.2.3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Wed,  4 Aug 2004 17:56:11 +0800
+
+libchewing (0.2.2-1) unstable; urgency=low
+
+  * New upstream version.
+  * README.Debian.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Tue,  6 Jul 2004 15:23:01 +0800
+
+libchewing (0.2.1-2) unstable; urgency=low
+
+  * Bugfix. dev files now install to correct path. 
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Tue,  6 Jul 2004 15:19:08 +0800
+
+libchewing (0.2.1-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Kanru Chen <kanru.96@stu.csie.ncnu.edu.tw>  Sat,  3 Jul 2004 21:08:32 +0800
+
--- libchewing-0.3.2.orig/debian/libchewing3-dev.dirs
+++ libchewing-0.3.2/debian/libchewing3-dev.dirs
@@ -0,0 +1,3 @@
+usr/lib
+usr/lib/pkgconfig
+usr/include
--- libchewing-0.3.2.orig/debian/compat
+++ libchewing-0.3.2/debian/compat
@@ -0,0 +1 @@
+7
--- libchewing-0.3.2.orig/debian/libchewing3.dirs
+++ libchewing-0.3.2/debian/libchewing3.dirs
@@ -0,0 +1 @@
+usr/lib
--- libchewing-0.3.2.orig/debian/rules
+++ libchewing-0.3.2/debian/rules
@@ -0,0 +1,29 @@
+#!/usr/bin/make -f
+ 
+include /usr/share/dpatch/dpatch.make
+
+build: build-stamp
+build-stamp: patch
+	dh build --before configure
+	dh_auto_configure -- --datadir=/usr/share/libchewing3
+	dh build --after configure
+	touch build-stamp
+
+clean: unpatch
+	[ ! -f test/Makefile ] || (cd test; $(MAKE) distclean)
+	dh clean
+
+install: build install-stamp
+install-stamp:
+	dh install
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh binary-indep
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh binary-arch
+
+binary: binary-indep binary-arch
--- libchewing-0.3.2.orig/debian/README.Debian
+++ libchewing-0.3.2/debian/README.Debian
@@ -0,0 +1,11 @@
+libchewing for Debian
+
+Known Problem
+-----------------------
+User's phrase database file may be corrupted when scim does not exit 
+gracefully, for example, during an X11 server crash or power outage.
+
+You have to remove phrase database file ($HOME/.chewing/uhash.dat for
+libchewing >= 0.3.0 or $HOME/.chewing/hash.dat for older versions)
+
+Note: you will lose all your personal and favorite phrases this way!
--- libchewing-0.3.2.orig/debian/libchewing3-data.dirs
+++ libchewing-0.3.2/debian/libchewing3-data.dirs
@@ -0,0 +1 @@
+usr/share/libchewing3/chewing
--- libchewing-0.3.2.orig/debian/libchewing3.install
+++ libchewing-0.3.2/debian/libchewing3.install
@@ -0,0 +1 @@
+usr/lib/lib*.so.*
--- libchewing-0.3.2.orig/debian/libchewing3-dev.install
+++ libchewing-0.3.2/debian/libchewing3-dev.install
@@ -0,0 +1,4 @@
+usr/include
+usr/lib/lib*.a
+usr/lib/lib*.so
+usr/lib/pkgconfig/chewing.pc
--- libchewing-0.3.2.orig/debian/patches/01_fix_zuin_count_return.diff
+++ libchewing-0.3.2/debian/patches/01_fix_zuin_count_return.diff
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_fix_zuin_count_return.diff 
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix zuin_count's return 
+
+@DPATCH@
+
+diff -ruNap libchewing-0.3.2-orig/src/mod_aux.c libchewing-0.3.2/src/mod_aux.c
+--- libchewing-0.3.2-orig/src/mod_aux.c	2009-10-18 09:39:52.000000000 +0000
++++ libchewing-0.3.2/src/mod_aux.c	2009-10-18 09:40:53.000000000 +0000
+@@ -90,7 +90,7 @@ CHEWING_API char *chewing_zuin_String( C
+ 		if ( ctx->output->zuinBuf[ i ].s[ 0 ] != '\0' ) {
+ 			strcat( s, (char *) (ctx->output->zuinBuf[ i ].s) );
+ 			if ( zuin_count )
+-				*zuin_count++;
++				(*zuin_count)++;
+ 		}
+ 	}
+ 	return s;
--- libchewing-0.3.2.orig/debian/patches/00list
+++ libchewing-0.3.2/debian/patches/00list
@@ -0,0 +1 @@
+01_fix_zuin_count_return.diff
