#!/bin/sh
# postinst script for maemo-optify-boottime
#
# see: dh_installdeb(1)
# ensure the maemo-optify-runonce.sh script is run after installation :)


#################################################################
# this flag-file is present only on rootfs built in scratchbox
# maemo-optify-firstboot.sh checks for the existence of this file
# and it should be added if the package is installed directly in 
# scratchbox (prior to building an image for instance..)

if [ ! -e /targets/links/scratchbox.config ]; then
 touch /var/lib/maemo-optify-firstboot-do-not-clean-home-opt
fi


#################################################################
# call the auto-opt script
# this should move some additional things to /opt
# only called in postinst if we are on device itself (ie ssu)
if [ ! -e /targets/links/scratchbox.config ]; then
 maemo-optify-auto-opt.sh
fi

exit 0


