trackupstream: Fix get_tarname_from_spec to understand rpm defines

This is needed for spec files that use %{name}-%{version}.tar.gz, for
instance.

Also, only keep the basename of the source file.