aboutsummaryrefslogtreecommitdiffstats
path: root/macros.gnome.in
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2023-01-07 09:50:20 +0200
committerJani Välimaa <wally@mageia.org>2023-01-07 09:50:20 +0200
commit3a00f9bd05ee8df5c6c2013a7f44d45f65291394 (patch)
treed0215edebac7f354be0385c1a3e3bce2e1991456 /macros.gnome.in
parentcf07c311938742e153b8afe795caf4fdfb75735b (diff)
downloadrpm-setup-3a00f9bd05ee8df5c6c2013a7f44d45f65291394.tar
rpm-setup-3a00f9bd05ee8df5c6c2013a7f44d45f65291394.tar.gz
rpm-setup-3a00f9bd05ee8df5c6c2013a7f44d45f65291394.tar.bz2
rpm-setup-3a00f9bd05ee8df5c6c2013a7f44d45f65291394.tar.xz
rpm-setup-3a00f9bd05ee8df5c6c2013a7f44d45f65291394.zip
macros.gnome: really add to dist
Diffstat (limited to 'macros.gnome.in')
-rw-r--r--macros.gnome.in22
1 files changed, 22 insertions, 0 deletions
diff --git a/macros.gnome.in b/macros.gnome.in
new file mode 100644
index 0000000..cb38bd0
--- /dev/null
+++ b/macros.gnome.in
@@ -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
+}