From 3a00f9bd05ee8df5c6c2013a7f44d45f65291394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20V=C3=A4limaa?= Date: Sat, 7 Jan 2023 09:50:20 +0200 Subject: macros.gnome: really add to dist --- Makefile.am | 3 ++- NEWS | 2 ++ macros.gnome | 22 ---------------------- macros.gnome.in | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 23 deletions(-) delete mode 100644 macros.gnome create mode 100644 macros.gnome.in diff --git a/Makefile.am b/Makefile.am index 8a94c89..a7ac04e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,8 @@ pkg_gdata = \ pkg_data_in = $(pkg_gdata:=.in) -pkg_macrosd = build.macros +pkg_macrosd = build.macros \ + macros.gnome pkg_macrosd_in = $(pkg_macrosd:=.in) diff --git a/NEWS b/NEWS index 1f280c7..a225b45 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- macros.gnome: really add to dist + Version 2.68 - 7 January 2023, by Jani Välimaa - add macros.gnome to introduce %url_ver and %tarball_version macros - rpm-spec-mode.el: sync script and tag lists with rpm >= 4.12.90 diff --git a/macros.gnome b/macros.gnome deleted file mode 100644 index cb38bd0..0000000 --- a/macros.gnome +++ /dev/null @@ -1,22 +0,0 @@ -%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 -} 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 +} -- cgit v1.2.1