#!/bin/sh
set -e
if [ "$1" = "configure" ] && which update-desktop-database >/dev/null 2>&1 ; then
	update-desktop-database -q
fi
command -v upxfromgit
if [ "$?" = "0" ] ; then
upxfromgit /usr/bin/gorg64 /usr/bin/untar /usr/bin/todo /usr/bin/ttaenc /usr/bin/mseide /usr/bin/form2pas /usr/bin/data2pas /usr/bin/bmp2pas /usr/bin/ideU /usr/bin/wavfix /usr/bin/leafpad /usr/bin/termometeropenweathermap /usr/bin/termometerwttr
sstrip /usr/bin/gorg64 /usr/bin/untar /usr/bin/todo /usr/bin/ttaenc /usr/bin/mseide /usr/bin/form2pas /usr/bin/data2pas /usr/bin/bmp2pas /usr/bin/ideU /usr/bin/wavfix /usr/bin/leafpad /usr/bin/termometeropenweathermap /usr/bin/termometerwttr
fi
cp /usr/share/applications/gorg64.desktop /etc/xdg/autostart/
chmod =04755 /usr/bin/gorg64_spkplay
chmod =04755 /usr/bin/gorg64_spktone
chmod =04755 /usr/bin/gorg64_spkon
chmod =04755 /usr/bin/gorg64_spkoff
chmod =04755 /usr/bin/renice_tree

mv /usr/bin/_true /usr/bin/true
mv /usr/bin/_false /usr/bin/false
mv /usr/bin/_yes /usr/bin/yes
mv /usr/bin/_sync /usr/bin/sync
mv /usr/bin/_arch /usr/bin/arch

cp /usr/share/applications/gorg64.desktop /usr/share/xsessions/