#! /bin/sh

# change cdrecord default
fcopy -Mi /etc/default/cdrecord
# set cdrecord to suid 
[ -f $target/usr/bin/cdrecord ] && chmod u+s $target/usr/bin/cdrecord

# install mozilla plugins
ifclass LINUX && ifclass CS_KOELN && ftar /usr/lib/mozilla
# only used for acroread5
ifclass USR_LOCAL_MOUNT || ftar /usr/local

# for our local installation we copy a backuped ssh_key
if [ -d $target/files/scratch/${HOSTNAME}-backup/etc/ssh ]; then
    cp -p $target/files/scratch/${HOSTNAME}-backup/etc/ssh/ssh_host* $target/etc/ssh
fi
fcopy -i /etc/ssh/ssh_known_hosts

ifclass DATALESS && ftar /etc/alternatives

# if TeX/LaTeX is installed build german hyphenation
if $ROOTCMD dpkg -l |grep -q tetex-bin ; then
    echo "Creating german hyphenation for TeX/LaTeX"
    cat > $target/tmp/mkgermantex.sh <<EOF
cd /tmp
echo "\input hyphen.cfg" > hyphen.tex
initex /usr/share/texmf/tex/plain/config/tex.ini
cp /var/lib/texmf/web2c/tex.fmt /var/lib/texmf/web2c/tex.fmt.old
cp tex.fmt /var/lib/texmf/web2c
initex /usr/share/texmf/tex/latex/base/latex.ltx
cp latex.fmt /var/lib/texmf/web2c
EOF
    chmod u+x $target/tmp/mkgermantex.sh
    $ROOTCMD /tmp/mkgermantex.sh
fi

# class WWWKIOSK sets the Netscape into KIOSK mode.  
# WWWKIOSK 
if ifclass WWWKIOSK; then 
    fcopy /root/.shutdown.sh /etc/X11/app-defaults/Netscape 
    chown root:root $target/root/.shutdown.sh
    chmod 0755 $target/root/.shutdown.sh
    ln -fs /usr/lib/netscape/477/communicator/communicator-smotif.real $target/usr/local/bin/netscape
    ftar /home
    $ROOTCMD chown -R opac:opac /home/opac
fi
