abinfo "Building documentations for English ..."
pushd "$SRCDIR"/distrib/docs/english
    install -dvm 755 "$PKGDIR"/usr/share/doc/"$PKGNAME"/english
    make html BUILDDIR="$PKGDIR"/usr/share/doc/"$PKGNAME"/english
popd

abinfo "Installing icons ..."
# Adopted from Arch Linux PKGBUILD package()
install_icons() {
    local _icon
    local _res
    while read -r -d '' _icon
    do
        _res="$(sed 's/[[:alpha:]]*\([0-9]\+\)\.png/\1/' <<< "${_icon##*/}")"
        [ -n "$_res" ] && install -v -D -m644 "$_icon" \
            "${PKGDIR}/usr/share/icons/hicolor/${_res}x${_res}/mimetypes/avisynthplus-script.png"
    done < <(find "${SRCDIR}/distrib/Icons/Rastered" -type f -name 'AvsPlusIcon*.png' -print0)
}
install_icons

abinfo "Installing LICENSE ..."
install -vm644 "$SRCDIR"/distrib/{{gpl,lgpl_for_used_libs}.txt,OFL.TXT} \
    "$PKGDIR"/usr/share/doc/"$PKGNAME"/ 
ln -sv ./gpl.txt "$PKGDIR"/usr/share/doc/"$PKGNAME"/LICENCE
