#!/bin/sh

#     DESCRIPTION
#
# Copy license files to WORK chroot


#     REQUIRES
#
# Install to instrumental chroot package alt-license-$NAME


#     INFO
#
# $ rpm -qpl /raid/ALT/Sisyphus/noarch/RPMS.classic/alt-license-lite-0.1-alt2.noarch.rpm 
# /usr/share/alt-license
# /usr/share/alt-license/license.all.html
# /usr/share/alt-license/license.ru.html

NAME="copy-license"

verbose()
{
    if [ -n "$GLOBAL_VERBOSE" ]; then
        echo "HOOK: $NAME: $@"
    fi
}

LICENSE_DIR="/usr/share/alt-license/"

verbose "has started"

if [ -d "$LICENSE_DIR" ]; then
    verbose "Found directory with license files, copy them to image(work) chroot"
    cp "$LICENSE_DIR"/*html "$WORKDIR"/
else
    verbose "Can't found directory $LICENSE_DIR with licenses"
fi

verbose "finished"
