Compile fcpci for Ubuntu

# Linux squezze 2.6.32-5-xen-amd64
 
# install needed packages
apt-get install -y wget
apt-get install -y build-essential
apt-get install -y linux-headers-$(uname -r)
 
# get fcpci sources
wget --no-check-certificate http://belug.de/~lutz/pub/fcpci/fritz-fcpci-2.6.31.tar.bz2 -O /tmp/fritz-fcpci-2.6.31.tar.bz2
 
# extract
tar xjf /tmp/fritz-fcpci-2.6.*.tar.bz2 -C /tmp/
 
# override fcpci-lib.o for 64 bit systems
if [ $(uname -m) == "x86_64" ]; then
    cd /tmp/fritz-fcpci-*/lib/
    ln -sf /tmp/fritz-fcpci-*/lib/64_fcpci-lib.o /tmp/fritz-fcpci-*/lib/fcpci-lib.o
fi
 
# compile
cd /tmp/fritz-fcpci-*/fcpci_src/
make
 
# install modules
TARGET=/lib/modules/$(uname -r)/extra/
[ -d ${TARGET} ] || mkdir ${TARGET}
cp /tmp/fritz-fcpci-*/fcpci_src/fcpci.ko ${TARGET}
depmod -a
 
# configure capi
apt-get install -y wget capiutils
sed -i 's|#fcpci|fcpci|g' /etc/isdn/capi.conf
 
# blacklist hisax modules
cat <<EOF>> /etc/modprobe.d/blacklist-capiutils.conf
blacklist hisax
blacklist hisax_isac
blacklist hisax_fcpcipnp
blacklist mISDN_core
blacklist mISDNipac 
blacklist avmfritz
EOF
 
# unload module
modprobe -r hisax_fcpcipnp hisax_isac hisax mISDN_core mISDNipac avmfritz
 
# init capi
/etc/init.d/capiutils restart
 
# view info
capiinfo
 
# test
capifax -v [0]YOUR_FAX /etc/isdn/capi.conf