#!/bin/sh
#----------------------------------------------------------------------------
# /tmp/install.sh  - install script for ncurses
#
# Creation:     2009-06-28 hb
# Last Update:  $Id: postinstall-ncurses.sh 37092 2015-03-19 19:07:51Z hbfl $
#
# Copyright (c) 2009-2015 the eisfair team, team(at)eisfair(dot)org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#----------------------------------------------------------------------------

# set package name
package_name=ncurses
_version=5.9

# ---------------------------------------------------------------------------
# generate symlinks
# ---------------------------------------------------------------------------
#cd /lib
#
#lib_names="libncursesw.so.${_version}"
#
#for LNAME in ${lib_names}
#do
#    lib_name=`echo "${LNAME}" | sed 's#\.so.*$##'`
#    lib_major=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f1`
#    lib_minor=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f2`
#    lib_patch=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f3`
#
#    LinkDES="${LNAME}"
#    LinkSRC="${lib_name}.so.${lib_major}"
#
#    rm -f ${LinkSRC}
#    ln -sf ${LinkDES} ${LinkSRC}
#    echo "b 0644 root root ${package_name} lib/${LinkSRC}" \
#         >>/etc/filelist.d/${package_name}-files.txt
#done

/sbin/ldconfig

#cd /usr/lib/
#
#lib_names="libform.so.${_version}
#libformw.so.${_version}
#libmenu.so.${_version}
#libmenuw.so.${_version}
#libpanel.so.${_version}
#libpanelw.so.${_version}
#libncurses.so.${_version}"
#
#for LNAME in ${lib_names}
#do
#    lib_name=`echo "${LNAME}" | sed 's#\.so.*$##'`
#    lib_major=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f1`
#    lib_minor=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f2`
#    lib_patch=`echo "${LNAME}" | sed 's#.*so.##' | cut -d. -f3`
#
#    LinkDES="${LNAME}"
#    LinkSRC="${lib_name}.so.${lib_major}"
#
#    rm -f ${LinkSRC}
#    ln -sf ${LinkDES} ${LinkSRC}
#    echo "b 0644 root root ${package_name} usr/lib/${LinkSRC}" \
#           >>/etc/filelist.d/${package_name}-files.txt
#done
#
/sbin/ldconfig

#cd /usr/bin
#
#bin_names="tic:captoinfo
#tic:infotocap
#tset:reset"
#
#echo "${bin_names}" |
#while read line
#do
#    OLD_IFS=${IFS}
#    IFS=':'
#
#    set -- ${line}
#
#    IFS=${_OLD_IFS}
#
#    if [ -n "${2}" ]
#    then
#        LinkDES="${1}"
#        LinkSRC="${2}"
#
#        ln -sf ${LinkDES} ${LinkSRC}
#        echo "b 0755 root root ${package_name} usr/bin/${LinkSRC}"  \
#          >>/etc/filelist.d/${package_name}-files.txt
#    fi
#done

# ---------------------------------------------------------------------------
# deinstall old lib version
# ---------------------------------------------------------------------------

rm -f /lib/libncurses.so.5
rm -f /lib/libncurses{,w}.so.5.6
rm -f /usr/lib/lib{form{,w},menu{,w},panel{,w}}.so.5.6
rm -f /etc/filelist.d/${package_name}-files.txt
/sbin/ldconfig

#cd /usr/lib

#rm -f terminfo
#ln -sf /usr/share/terminfo

exit 0
