version=4

# Use the GForth snapshots directory, repack using a +dfsg suffix,
# turn the link to a directory into a full filename within that directory,
# use the .tar.xz suffix for snapshots since the year 2016.
#
opts=repack,repacksuffix=+dfsg,\
     dversionmangle=s/([+](ds|dfsg)[0-9]*)?([-.+~]?(cvs|svn|git|snapshot|pre|hg)(.*))?$//i,\
     pgpsigurlmangle=s/$/.sig/,\
     downloadurlmangle=s/@ANY_VERSION@_(\d+)\/$/$1_$2\/@PACKAGE@-$1_$2.tar.xz/,\
     uversionmangle=s/(.*)\.([1-9][0-9]+)$/$1~snapshot$2/,\
     filenamemangle=s/^@ANY_VERSION@_(\d+)\/$/@PACKAGE@-$1.$2.tar.xz/ \
https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/ @ANY_VERSION@_(20(?:1[6-9]|2[0-9])[0-9]+)/

# Use the GForth snapshots directory, repack using a +dfsg suffix,
# turn the link to a directory into a full filename within that directory,
# use the .tar.gz suffix for snapshots before the year 2016.
#
opts=repack,repacksuffix=+dfsg,\
     dversionmangle=s/([+](ds|dfsg)[0-9]*)?([-.+~]?(cvs|svn|git|snapshot|pre|hg)(.*))?$//i,\
     pgpsigurlmangle=s/$/.sig/,\
     downloadurlmangle=s/@ANY_VERSION@_(\d+)\/$/$1_$2\/@PACKAGE@-$1_$2.tar.gz/,\
     uversionmangle=s/(.*)\.([1-9][0-9]+)$/$1~snapshot$2/,\
     filenamemangle=s/^@ANY_VERSION@_(\d+)\/$/@PACKAGE@-$1.$2.tar.gz/ \
https://www.complang.tuwien.ac.at/forth/gforth/Snapshots/ @ANY_VERSION@_(201[3-5][0-9]+)/

# Use the GForth master site, repack adding the +dfsg suffix, fetch a signature
#
opts=repack,repacksuffix=+dfsg,\
     dversionmangle=s/([+](ds|dfsg)[0-9]*)?([-.+~]?(cvs|svn|git|snapshot|pre|hg)(.*))?$//i,\
     pgpsigurlmangle=s/$/.sig/ \
https://www.complang.tuwien.ac.at/forth/gforth/ (?:.*/)?gforth@ANY_VERSION@@ARCHIVE_EXT@
