--- scim-pinyin-0.5.0.orig/debian/scim-pinyin.install
+++ scim-pinyin-0.5.0/debian/scim-pinyin.install
@@ -0,0 +1,6 @@
+usr/lib/scim-1.0/1.4.0/IMEngine/pinyin.so
+usr/lib/scim-1.0/1.4.0/SetupUI/pinyin-imengine-setup.so
+
+usr/share/scim/pinyin/*
+usr/share/locale/*/LC_MESSAGES/scim-pinyin.mo
+usr/share/scim/icons/smart-pinyin.png
--- scim-pinyin-0.5.0.orig/debian/changelog
+++ scim-pinyin-0.5.0/debian/changelog
@@ -0,0 +1,77 @@
+scim-pinyin (0.5.0-2) unstable; urgency=low
+
+  * Make scim-pinyin Replaces scim-chinese (<< 0.5.0) to provide smooth
+    upgrade from sarge.  (Closes: #343562)
+  * Handle obsolete conffile from old scim-chinese packages properly.
+  * Build-depend on autotools-dev and use config.{guess,sub} from
+    autotools-dev unconditionally.
+
+ -- Ming Hua <minghua@rice.edu>  Sun, 25 Dec 2005 04:59:22 -0600
+
+scim-pinyin (0.5.0-1) unstable; urgency=low
+
+  * New upstream release.  [minghua]
+    - Upstream changes name to scim-pinyin.
+  * debian/patches/10scim-plugin-module-install-dir.dpatch, debian/rules,
+    debian/install:  Building against scim 1.4, change module installation
+    directory from 1.0.0 to 1.4.0.  (Closes: #324268, #324808)  [minghua]
+  * debian/patches/{00list,01gcc-4.0.dpatch}:  Apply patch from Andreas Jochens
+    <aj@andaco.de> to fix FTBFS with gcc-4.0.  (Closes: #297975)  [minghua]
+  * debian/control, debian/{postinst,prerm}, debian/install:  This new release
+    doesn't use gconf anymore, so get rid of gconf2 dependency and related
+    scripts.  [minghua]
+  * debian/{control,rules,install,docs}:  Build scim-chinese dummy package to
+    help upgrade, rename install and docs to scim-pinyin.install and
+    scim-pinyin.docs.  [minghua]
+  * debian/control:  Upgrade to policy version 3.6.2 (no actual changes).
+    [minghua]
+  * debian/watch:  Track all new versions.  [minghua]
+  * debian/copyright:  Update FSF address.  [minghua]
+
+ -- Ming Hua <minghua@rice.edu>  Thu,  6 Oct 2005 21:28:53 -0500
+
+scim-chinese (0.4.2-2) unstable; urgency=low
+
+  * debian/{copyright,watch}:  Update upstream information.  [minghua]
+  * debian/control:  [minghua]
+    - Remove explicit dependency on scim since it's included in
+      ${shlibs:Depends}.
+    - Add scim (<< 1.1) to Depends: so that it won't be installed with scim
+      1.2.x series.  This is better than setting Conflicts:.
+    - Move Chinese TrueType font packages from Depends: to Recommends:.
+  * debian/README.Debian:  New.  Basic information about scim-chinese and tips
+    about ``pinyin with tone''.  [minghua]
+
+ -- Ming Hua <minghua@rice.edu>  Sun,  6 Feb 2005 22:20:50 -0600
+
+scim-chinese (0.4.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control:  Update scim dependencies to >= 1.0.1, also updated
+    package descriptions.
+  * debian/rules, debian/patches/, debian/control:  Switch to dpatch system.
+  * debian/watch:  Add watch file for monitoring upstream releases.
+  * debian/postinst, debian/prerm:  Slight changes to postinst script
+    according to dh_gconf(1) template, and add prerm script to unregister
+    gconf schemas.
+
+ -- Ming Hua <minghua@rice.edu>  Wed, 29 Sep 2004 17:38:06 -0500
+
+scim-chinese (0.3.0-2) unstable; urgency=low
+
+  * Initial release for upload into the official Debian archive.
+  * Minor tweakings:
+     - Added Build-Depends: libgtk2.0-dev
+     - Added Depends: gconf2
+     - Added postinst to run gconftool-2, based on upstream SPEC file.
+  * NMU: Ming Hua <minghua@rice.edu> is still the maintainer.
+    I am his Debian upload sponsor.  :-)
+
+ -- Anthony Fok <foka@debian.org>  Sat, 12 Jun 2004 01:37:11 +0800
+
+scim-chinese (0.3.0-1) unstable; urgency=low
+
+  * Initial Release, based on upstream version 0.3.0.
+
+ -- Ming Hua <minghua@rice.edu>  Fri, 30 Apr 2004 14:58:29 -0500
+
--- scim-pinyin-0.5.0.orig/debian/scim-pinyin.docs
+++ scim-pinyin-0.5.0/debian/scim-pinyin.docs
@@ -0,0 +1 @@
+README
--- scim-pinyin-0.5.0.orig/debian/patches/00list
+++ scim-pinyin-0.5.0/debian/patches/00list
@@ -0,0 +1,2 @@
+01gcc-4.0.dpatch
+10scim-plugin-module-install-dir.dpatch
--- scim-pinyin-0.5.0.orig/debian/patches/10scim-plugin-module-install-dir.dpatch
+++ scim-pinyin-0.5.0/debian/patches/10scim-plugin-module-install-dir.dpatch
@@ -0,0 +1,76 @@
+#! /bin/sh -e
+## 01_module-install-dir.dpatch by Ming Hua <minghua@rice.edu>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change the scim module installation directory from /usr/lib/scim-1.0/ to
+## DP: /usr/lib/scim-1.0/1.2.0/.  When 1.0.0 was released, upstream claimed
+## DP: there is possibility that version 1.2.0 will change the native module
+## DP: directory but keep the compatibility with the external modules.  In my
+## DP: opinion this is broken design, and I changed the directory from
+## DP: /usr/lib/scim-1.0 to /usr/lib/scim/1.0.0 for Debian package.  It turned
+## DP: out that 1.2.0 indeed broke the ABI.  I am happy with my judgement and
+## DP: will continue to maintain a similar patch for all scim modules.  I am
+## DP: still not quite sure this design is technically correct or not, but it
+## DP: seems GTK IM module uses a similar design.  Oh well.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad scim-pinyin-0.5.0/src/Makefile.am /tmp/dpep.VgYQu0/scim-pinyin-0.5.0/src/Makefile.am
+--- scim-pinyin-0.5.0/src/Makefile.am	2005-05-09 19:58:02.775549776 -0500
++++ /tmp/dpep.VgYQu0/scim-pinyin-0.5.0/src/Makefile.am	2005-05-09 20:02:32.243584408 -0500
+@@ -51,7 +51,7 @@
+ libpinyin_la_CXXFLAGS	= @SCIM_CFLAGS@
+ libpinyin_la_LDFLAGS	= @SCIM_LIBS@ 
+ 
+-moduledir		= @SCIM_MODULEDIR@/IMEngine
++moduledir		= @SCIM_MODULEDIR@/1.4.0/IMEngine
+ module_LTLIBRARIES	= pinyin.la
+ 
+ pinyin_la_SOURCES 	= scim_pinyin_imengine.cpp
+@@ -72,7 +72,7 @@
+ SETUP_MODULE = pinyin-imengine-setup.la
+ endif
+ 
+-setupmoduledir           = @SCIM_MODULEDIR@/SetupUI
++setupmoduledir           = @SCIM_MODULEDIR@/1.4.0/SetupUI
+ setupmodule_LTLIBRARIES  = $(SETUP_MODULE)
+ 
+ pinyin_imengine_setup_la_SOURCES = scim_pinyin_imengine_setup.cpp
+diff -urNad scim-pinyin-0.5.0/src/Makefile.in /tmp/dpep.VgYQu0/scim-pinyin-0.5.0/src/Makefile.in
+--- scim-pinyin-0.5.0/src/Makefile.in	2005-05-09 19:58:02.778549320 -0500
++++ /tmp/dpep.VgYQu0/scim-pinyin-0.5.0/src/Makefile.in	2005-05-09 20:03:16.510854760 -0500
+@@ -315,7 +315,7 @@
+ libpinyin_la_CFLAGS = @SCIM_CFLAGS@
+ libpinyin_la_CXXFLAGS = @SCIM_CFLAGS@
+ libpinyin_la_LDFLAGS = @SCIM_LIBS@ 
+-moduledir = @SCIM_MODULEDIR@/IMEngine
++moduledir = @SCIM_MODULEDIR@/1.4.0/IMEngine
+ module_LTLIBRARIES = pinyin.la
+ pinyin_la_SOURCES = scim_pinyin_imengine.cpp
+ pinyin_la_CFLAGS = @SCIM_CFLAGS@
+@@ -329,7 +329,7 @@
+ 
+ pinyin_la_LIBADD = libpinyin.la
+ @SCIM_BUILD_SETUP_TRUE@SETUP_MODULE = pinyin-imengine-setup.la
+-setupmoduledir = @SCIM_MODULEDIR@/SetupUI
++setupmoduledir = @SCIM_MODULEDIR@/1.4.0/SetupUI
+ setupmodule_LTLIBRARIES = $(SETUP_MODULE)
+ pinyin_imengine_setup_la_SOURCES = scim_pinyin_imengine_setup.cpp
+ pinyin_imengine_setup_la_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ @SCIM_CFLAGS@
--- scim-pinyin-0.5.0.orig/debian/patches/01gcc-4.0.dpatch
+++ scim-pinyin-0.5.0/debian/patches/01gcc-4.0.dpatch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01gcc-4.0.dpatch by  <minghua@danube>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch from Andreas Jochens <aj@andaco.de> to fix FTBFS on amd64
+## DP: with gcc-4.0.  See bug #297975 for details.
+
+@DPATCH@
+diff -urNad scim-pinyin-0.5.0~/src/scim_pinyin_imengine_setup.cpp scim-pinyin-0.5.0/src/scim_pinyin_imengine_setup.cpp
+--- scim-pinyin-0.5.0~/src/scim_pinyin_imengine_setup.cpp	2005-01-06 07:31:00.000000000 -0600
++++ scim-pinyin-0.5.0/src/scim_pinyin_imengine_setup.cpp	2005-10-01 21:45:08.000000000 -0500
+@@ -1290,7 +1290,7 @@
+ __on_ambiguities_toggled               (GtkToggleButton *togglebutton,
+                                         gpointer         user_data)
+ {
+-    int  index = (int) user_data;
++    long  index = (long) user_data;
+ 
+     if (index >= 0 && index <= SCIM_PINYIN_AmbLast) {
+         __config_ambiguities [index] = gtk_toggle_button_get_active (togglebutton);
--- scim-pinyin-0.5.0.orig/debian/watch
+++ scim-pinyin-0.5.0/debian/watch
@@ -0,0 +1,7 @@
+# watch control file for scim-pinyin
+# see uscan(1)
+
+# format version number
+version=2
+# SourceForge.net repository by upstream
+http://prdownloads.sourceforge.net/scim/scim-pinyin-([\d\.]*)\.tar\.gz debian uupdate
--- scim-pinyin-0.5.0.orig/debian/copyright
+++ scim-pinyin-0.5.0/debian/copyright
@@ -0,0 +1,32 @@
+This package was debianized by Ming Hua <minghua@rice.edu> on
+Fri, 30 Apr 2004 14:58:29 -0500.
+
+Upstream Author:  James Su <suzhe@tsinghua.org.cn>
+
+Home Page:  http://www.scim-im.org/
+
+The package was downloaded from http://prdownloads.sourceforge.net/scim/
+
+Copyright:
+
+   Smart Common Input Method -- Smart Pinyin Module
+
+   Copyright 2002-2004, James Su <suzhe@tsinghua.org.cn>
+
+   This package 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; version 2 dated June, 1991.
+
+   This package 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 package; 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 General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
--- scim-pinyin-0.5.0.orig/debian/control
+++ scim-pinyin-0.5.0/debian/control
@@ -0,0 +1,30 @@
+Source: scim-pinyin
+Section: utils
+Priority: optional
+Maintainer: Ming Hua <minghua@rice.edu>
+Uploaders: Osamu Aoki <osamu@debian.org>
+Build-Depends: debhelper (>= 4.0.0), dpatch, autotools-dev, libgtk2.0-dev, libscim-dev (>= 1.4.0)
+Standards-Version: 3.6.2
+
+Package: scim-pinyin
+Architecture: any
+Depends: ${shlibs:Depends}, scim
+Recommends: ttf-arphic-gbsn00lp | ttf-arphic-gkai00mp, ttf-arphic-bsmi00lp | ttf-arphic-bkai00mp
+Replaces: scim-chinese (<< 0.5.0)
+Description: smart pinyin IM engine for SCIM platform
+ SCIM (Smart Common Input Method) is an input method (IM) platform.
+ .
+ This package provides smart pinyin IM engine for SCIM.  It includes the
+ plugin modules and the data files.  With this module you can use the
+ smart pinyin input method for Chinese.
+ .
+  Homepage: http://www.scim-im.org/
+ .
+ For details about SCIM, please see the description of package scim.
+
+Package: scim-chinese
+Architecture: all
+Depends: scim-pinyin
+Description: smart pinyin IM engine for SCIM (transitional package)
+ This is a dummy package for transition during upgrade.  You can safely
+ remove this package once you have scim-pinyin installed.
--- scim-pinyin-0.5.0.orig/debian/scim-chinese.preinst
+++ scim-pinyin-0.5.0/debian/scim-chinese.preinst
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e 
+
+# Clean up old conffile
+# using example from http://www.dpkg.org/ConffileHandling
+OLDCONFFILE="/etc/gconf/schemas/scim-chinese.schemas"
+case "$1" in
+"install" | "upgrade" )
+    if dpkg --compare-versions "$2" lt "0.5.0"; then
+        if [ -e "$OLDCONFFILE" ]; then
+            MD5SUM=`md5sum "$OLDCONFFILE" | sed -e "s/ .*//"`
+            OLDMD5SUM=`sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $OLDCONFFILE'{s/.* //;p}}" /var/lib/dpkg/status`
+            if [ "$MD5SUM" = "$OLDMD5SUM" ]; then
+                echo -n "Removing obsolete conffile $OLDCONFFILE"
+                rm -f "$OLDCONFFILE"
+                echo "."
+            else
+                echo "Obselete conffile $OLDCONFFILE has been locally modified."
+                echo -n "Saving as $OLDCONFFILE.dpkg-bak"
+                mv -f "$OLDCONFFILE" "$OLDCONFFILE.dpkg-bak"
+                echo "."
+            fi
+        fi
+    fi
+esac
+
+# There shouldn't be anything added by debhelper, this is just to
+# satisfy lintian.
+#DEBHELPER#
--- scim-pinyin-0.5.0.orig/debian/rules
+++ scim-pinyin-0.5.0/debian/rules
@@ -0,0 +1,145 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+#
+# Modified to make a template file for a multi-binary package with separated
+# build-arch and build-indep targets  by Bill Allombert 2001
+#
+# Modified for package scim-pinyin by Ming Hua 2004.  Some modification
+# comes from Anthony Fok.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+# Setting compiling flags
+CFLAGS = -W -g
+CXXFLAGS = -W -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+	CXXFLAGS += -O0
+else
+	CFLAGS += -O2
+	CXXFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+config.status: patch-stamp configure
+	dh_testdir
+
+	ln -s /usr/share/misc/config.guess config.guess
+	ln -s /usr/share/misc/config.sub config.sub
+	rm -f config.cache
+
+	# Add here commands to configure the package.
+	CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" ./configure \
+		--host=$(DEB_HOST_GNU_TYPE) \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--prefix=/usr \
+		--mandir=\$${prefix}/share/man \
+		--infodir=\$${prefix}/share/info \
+		--sysconfdir=/etc \
+		--disable-static
+
+build: build-stamp
+build-stamp:  config.status
+	# Add here commands to compile the package.
+	$(MAKE) 
+
+	touch build-stamp
+
+clean: clean-patched unpatch
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp install-stamp
+	rm -f config.guess config.sub
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+
+	dh_clean 
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	touch patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Use the upstream makefile to install everything into
+	# debian/tmp
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+
+	# Clean up unnecessary static libraries for modules
+	rm debian/tmp/usr/lib/scim-1.0/1.4.0/*/*.la
+
+	# Prepare files for different packages to separate directories
+	dh_install --sourcedir=debian/tmp --fail-missing
+
+	touch install-stamp
+
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-indep
+# in another 'make' thread.
+binary-common:
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+#	dh_installmenu
+#	dh_installdebconf	
+#	dh_installlogrotate	
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress 
+	dh_fixperms
+#	dh_perl
+#	dh_python
+#	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+# Build architecture independant packages using the common target.
+binary-indep: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build install
+	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
+
+binary: binary-arch binary-indep
+
+.SUFFIXES:
+.PHONY: build clean clean-patched install binary-indep binary-arch binary patch unpatch
--- scim-pinyin-0.5.0.orig/debian/README.Debian
+++ scim-pinyin-0.5.0/debian/README.Debian
@@ -0,0 +1,18 @@
+This package scim-pinyin is a SCIM module for Pinyin input method.  Please
+see /usr/share/doc/scim/README.Debian for usage of scim.
+
+SCIM uses TrueType fonts for display.  Since scim-pinyin supports both
+simplified and traditional Chinese, you need to install fonts for these
+languages.  The Arphic fonts recommended by scim-pinyin package should work
+fine.
+
+----
+Tips
+----
+
+In order to use ``Pinyin with tone'', you need to set ``use tone'' in scim-setup
+(right click scim notification icon, click the wrench icon on scim panel, or
+launch from system menu).  Then you can use Shift-n (n = 1, 2, 3, 4, 5) to
+indicate the tone of the pinyin.
+
+-- Ming Hua <minghua@rice.edu>  Sat, 16 Apr 2005 14:21:11 -0500
--- scim-pinyin-0.5.0.orig/debian/compat
+++ scim-pinyin-0.5.0/debian/compat
@@ -0,0 +1 @@
+4