aboutsummaryrefslogtreecommitdiffstats
path: root/macros.gnome
diff options
context:
space:
mode:
Diffstat (limited to 'macros.gnome')
-rw-r--r--macros.gnome22
1 files changed, 22 insertions, 0 deletions
diff --git a/macros.gnome b/macros.gnome
new file mode 100644
index 0000000..cb38bd0
--- /dev/null
+++ b/macros.gnome
@@ -0,0 +1,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
+}