#!/bin/sh
# Copyright 2012 Alberto Gonzalez Iniesta <agi@agi.as>
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL-2
# 
set -e
test $DEBIAN_SCRIPT_DEBUG && set -v -x

# libapache-mod-security versions previous to 2.5.13-1 had 
# /usr/share/doc/libapache-mod-security as a symlink to mod-security-common
# This is now gone, and should be deleted in order to get replaced with its
# own /usr/share/doc/libapache-mod-security directory
# We'll check versions older that 2.6.6-3 just to make sure noone got caught
# with this bug

case "$1" in
    upgrade)

    if `dpkg --compare-versions $2 lt 2.6.6-3`
    then
        if [ -h /usr/share/doc/libapache-mod-security ]
        then
            rm -f /usr/share/doc/libapache-mod-security
        fi
    fi
    ;;

esac

#DEBHELPER#

exit 0
