#!/bin/sh

install -d "$ALTERATOR_DATADIR"

if [ -d help ];then
    cp -af help $ALTERATOR_DATADIR
else
    find applications -name '*.desktop' 2>/dev/null|
	while read d; do
	    help="$(alterator-dump-desktop -vout="X-Alterator-Help" "$d")"
	    [ -z "$help" ] ||
		find "$ALTERATOR_L10NDIR" -name "$help.html"|
		    while read f; do
			install -Dpm 644 $f "$ALTERATOR_DATADIR/${f##$ALTERATOR_L10NDIR}"
		    done
	done
fi
