#auto_distr macros

# release format: <prefix><number>[.<suffix>]
%distr_auto_release() %(if [ "%{?distr_switch}" = "" ]; then echo "%1"; else echo "%1"|sed -rn -e 's@^([^[:space:]]+)([0-9]+)(|(\\.[^[:space:]]+))$@\\1/\\2/\\3@p'|awk -v FS='/' -v distr_name='%{?distr_switch}' -v distr_num='%{?distr_num}' 'BEGIN {if (distr_num == "") {num="1"} else {num=distr_num}; suf=("." distr_name "." num) }; {print $1 ($2-1) suf $3}'; fi)
