Currently the postinst script distinguishes installation vs upgrade by
checking whether its second argument is empty. However, it will only
be empty if the package was *never* installed before, or was purged.
If the package has been installed, then removed, and is now being
installed again, it's seen as an upgrade.
Unfortunately dpkg only tells the preinst script whether or not this
is an upgrade. So create a flag file there, consume it in postinst
and remove it in postrm.