version=4

# Upstream tags releases as vN.N.N on GitHub. There is no separately uploaded
# or signed tarball: the release asset is GitHub's own archive of the tag, so
# watch the tags page and rename what comes back to rpi-image-gen-<version>.
#
# This is deliberately not mode=git. The orig tarball for 2.9.0 was taken from
# the release page, and a git-mode tarball of the same tag would not be
# byte-identical to it, so switching modes later would mean a new orig tarball
# for an unchanged upstream. If GitHub's generated archives ever prove
# unstable again, switch to
#
#   opts="mode=git, pgpmode=none, uversionmangle=s/^v//" \
#     https://github.com/raspberrypi/rpi-image-gen.git refs/tags/v@ANY_VERSION@ debian
#
# and repack from the next release onwards, not retroactively.
#
# No uupdate: debian/gbp.conf documents "gbp import-orig --uscan", which does
# the unpack-and-merge itself. Leaving uupdate here would have uscan try to
# build a parallel source tree beside the git repository on any run that
# actually downloads.
opts="filenamemangle=s%(?:.*?)?v?@ANY_VERSION@@ARCHIVE_EXT@%@PACKAGE@-$1.tar.gz%" \
  https://github.com/raspberrypi/rpi-image-gen/tags \
  (?:.*?/)?v?@ANY_VERSION@@ARCHIVE_EXT@ debian
