#!/bin/bash
cd /usr/src/texinfo-*/ ||exit

patch -p 1 <../texinfo-4.8-multibyte-1.patch
patch -p 1 <../texinfo-4.8-tempfile_fix-2.patch


./configure --prefix=/usr &&
make &&
#make check
make install &&
#TEXMF holds the location of the root of your TeX tree (installed later)
make TEXMF=/usr/share/texmf install-tex

#this is the way to recreate the dir file, whenever you need it:
cd /usr/share/info
rm -f dir
for f in *; do
  install-info $f dir 2>/dev/null
done
