#!/bin/sh
#
# Script to be included in the cadabra2 packages (deb/rpm) and to be
# run after installation, to make TeX pick up our style sheets and
# the desktop pickup our menu entry/icon.

/sbin/ldconfig -v


# For some reason, on openSUSE, you cannot write the
# ls-R even when running texhash as root... and the 
# folder needs to be sticky... Hack.
if [ "@CPACK_SYSTEM_NAME@" = "leap421" ]; then
	TEXPATH=`kpsewhich -var-value=TEXMFLOCAL`
	chmod o+t ${TEXPATH}
   chmod go+w ${TEXPATH}/ls-R
   texhash
   chmod go-w ${TEXPATH}/ls-R
else
   texhash
fi

if hash gtk-update-icon-cache-3.0 2>/dev/null; then 
   gtk-update-icon-cache-3.0 -t /usr/share/icons/hicolor
else
   gtk-update-icon-cache -t /usr/share/icons/hicolor
fi
