#!/bin/sh
#-----------------------------------------------------------------------
# /tmp/preinstall.sh - libgcrypt11 preinstallation
#
# Creation   : 2008-09-22 alex
# Last update: $Id: preinstall.sh 150 2008-11-30 12:45:56Z alex $
#
# Copyright (c) 2008 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.
#-----------------------------------------------------------------------

PATH='/sbin:/usr/sbin:/bin:/usr/bin'
# set packages name
packageName=libgcrypt11

#-----------------------------------------------------------------------
# include eislib
#-----------------------------------------------------------------------
. /var/install/include/eislib

test -f /var/install/packages/${packageName}  &&
mecho -info "preinstalling ${packageName} ..."

### check for old package 'libgcrypt' and remove/rename old stuff
old_package_check=`/var/install/bin/check-version libgcrypt 1.1.4`
case $old_package_check in
    installed|new)
        mecho -info 'Found old package "libgcrypt", removing deprecated package files...'
        rm -f /etc/filelist.d/libgcrypt-files.txt
        rm -rf /usr/share/doc/libgcrypt
        rm -f /var/install/packages/libgcrypt
    ;;
    *)
        # nothing to do
    ;;
esac

exit 0

#-----------------------------------------------------------------------
# end
#-----------------------------------------------------------------------
