wiki:Orphan/XvtFromDebian

Xvt from Debian

The crude way without proper patching the debian sources

First let's get the source package from the Debian repository. To do this you have to add a source repository to your /etc/apt/sources.list. This is how mine looks like:

deb http://ftp.debian.org/debian/ lenny main
deb http://ftp.iplinux.org/iplinux/ zelazny host/tools host/cross
deb http://openinkpot.org/pub/oi/ zelazny host/tools host/cross

deb-src http://ftp.debian.org/debian/ lenny main

Now get the package:

apt-get source xvt

Be aware, there comes a lot of stuff with it. Probably you won't be interested in that, so you might delete all file starting with xvt* - just keep the source tree. Enter the source tree - as time of writing it's xvt-2.1:

cd xvt-2.1

Let's take a look at the content. There's a debian folder - very important, that says we'll probably be able to build the package with dpkg-buildpackage (in this case we can do it). There's no autogen.sh (just remember that fact now).

You need to edit the file debian/postinst and debian/prerm and comment out the call to update-alternatives:

#!/bin/sh

set -e

#DEBHELPER#

action="$1"
oldversion="$2"

# Please commet this out
#update-alternatives --install /usr/bin/x-terminal-emulator \
#                              x-terminal-emulator /usr/bin/xvt 10 \
#                    --slave /usr/share/man/man1/x-terminal-emulator.1.gz \
#                            x-terminal-emulator.1.gz \
#                            /usr/share/man/man1/xvt.1.gz

setgid() {
  if ! [ -x /usr/sbin/dpkg-statoverride ] || \
      ! dpkg-statoverride --list "$1" >/dev/null ; then
    chown root:utmp "$1"
    chmod 2755 "$1"
  fi
}

if [ "$action" = "configure" ]; then
  setgid /usr/bin/xvt
fi

Let's build it. Usually running dpkg-buildpackage -amipsel would result in a correct crosscompilation. This time the Makefile – after dpkg-buildpackage applied all patches – is not ready for cross compilation, i.e. ${CC} is set to "cc" and not to "mipsel-ip-linux-gnu-gcc".

To actually perform a crosscompilation run it this way:

CC=mipsel-ip-linux-gnu-gcc dpkg-buildpackage -amipsel -us -uc

Now you should find a file ../xvt_2.1-20_mipsel.deb - this is the one to go to openinkpot:

scp <path>/xvt_2.1-20_mipsel.deb root@192.168.111.1:/root
ssh root@192.168.111.1
dpkg -i xvt_2.1-20_mipsel.deb
export DISPLAY=:0
xvt

Enjoy the terminal :-)