#! /bin/sh
#
# debian/wrap-cursor-themes
# Part of Debian ‘comixcursors’ package.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.

# Create named wrapper theme files for each of the installed themes.

set -e

icons_builddir="${PACKAGE_BUILDDIR}/usr/share/icons"
wrapperdir="${PACKAGE_BUILDDIR}/etc/X11/cursors"

temp_theme="$(mktemp -t)"
for theme_dir in "${icons_builddir}"/ComixCursors-* ; do
    theme_name=$(basename "${theme_dir}")
    theme_file="${theme_dir}"/index.theme
    {
        grep -v Inherits "${theme_file}"
        printf "Inherits = %s\n" ${theme_name}
    } > "${temp_theme}"
    wrapped_theme="${wrapperdir}/${theme_name}.theme"
    install -m 644 "${temp_theme}" "${wrapped_theme}"
done
rm "${temp_theme}"


# Copyright © 2010–2018 Ben Finney <bignose@debian.org>
# Copyright © 2005–2008 Sune Vuorela <debian@pusling.com>
#
# This is free software; you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License, version 3 or later.
# No warranty expressed or implied.
#
# On Debian systems, the complete text of version 3 of the GNU General
# Public License can be found in ‘/usr/share/common-licenses/GPL-3’.
