aboutsummaryrefslogtreecommitdiffstats
path: root/macros.gnome.in
blob: cb38bd0913861fe554acec5f789db7c55d75ad0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%tarball_version %{lua:
ver = string.gsub(rpm.expand("%{version}"), "~", ".")
print(ver)
}

%url_ver %{lua:
ver = rpm.expand("%{version}")
majmin, count1 = string.gsub(ver, "^(%d+%.%d+).*", "%1", 1)
if count1 == 0 then
  ver = string.gsub(ver, "~.*", "")
  print(ver)
  return
end
maj, count2 = string.gsub(majmin, "^(%d+).*", "%1", 1);
if count2 == 0 then
  print(majmin)
elseif tonumber(majmin) < 40 then
  print(majmin)
else
  print(maj)
end
}