--- ./libkpathsea4.info	2006-09-05 13:47:39.000000000 +0900
+++ ./libkpathsea4.info	2006-11-25 14:52:18.000000000 +0900
@@ -1,9 +1,9 @@
 Package: libkpathsea4
 Version: 3.0
-Revision: 1002
+Revision: 1003
 Description: Complete distribution of the TeX typesetting system
 BuildDepends: <<
- t1lib5, libpng3 (>= 1:1.2.8-1), libwww, libncurses5 (>= 5.4-20041023-1006), tetex-texmf (>= 3.0-1)
+ t1lib5, libpng3 (>= 1:1.2.8-1), libwww, libncurses5 (>= 5.4-20041023-1006), tetex-texmf (>= 3.0-1), libiconv-dev
 <<
 BuildDependsOnly: true
 Depends: %N-shlibs (= %v-%r)
@@ -11,10 +11,17 @@
 Replaces: tetex-dev, tetex-base (<= 2.0.2-46), tetex-nox (<= 2.0.2-24)
 Source: ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/3.0/distrib/tetex-src-%v.tar.gz
 Source-MD5: 944a4641e79e61043fdaf8f38ecbb4b3
+Source2: http://fink.sodan.ecc.u-tokyo.ac.jp/~okayama/distfiles/tetex-%v-magstep-20060511.patch
+Source2-MD5: c88f4c99f3e984c0d3ff540373f2e359
+Source3: http://fink.sodan.ecc.u-tokyo.ac.jp/~okayama/distfiles/tetex-%v-libkanji-0.84.patch
+Source3-MD5: 41786c08288b04000ef5274735fdfaa6
 PatchScript: <<
  sed 's|@PREFIX@|%p|g' < %a/tetex.patch | sed 's|@PACKAGE@|%n-%v-%r|g' | patch -p1
  perl -pi -e "s|hardcode_direct=yes|hardcode_direct=no|" texk/configure texk/kpathsea/configure utils/texinfo/configure 
  perl -pi -e 's,-flat_namespace -undefined suppress,-twolevel_namespace -undefined error,g' texk/configure texk/kpathsea/configure utils/texinfo/configure
+ patch -p1 < ../tetex-%v-magstep-20060511.patch
+ patch -p1 < ../tetex-%v-libkanji-0.84.patch
+ sed -i.bak 's|-rpath|$(LIBS) -rpath|' texk/kpathsea/Makefile.in
 <<
 ConfigureParams: <<
  --without-texi2html --without-texinfo --enable-shared \
@@ -23,7 +30,8 @@
  --with-system-pnglib --with-system-t1lib --with-system-wwwlib \
  --with-system-zlib \
  --with-system-gd \
- --without-x 
+ --without-x \
+ --enable-kanji=UTF8 --enable-kanji-iconv
 <<
 CompileScript: <<
  cd texk; ./configure %c
@@ -39,6 +47,7 @@
 InfoDocs: kpathsea.info
 SplitOff: <<
  Package: %N-shlibs
+ Depends: libiconv
  Description: Shared libraries for a teTeX installation
  Files: lib/libkpathsea.*.dylib
  Shlibs: %p/lib/libkpathsea.4.dylib 5.0.0 %n (>= 3.0-1)
