X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=macros.tld;fp=macros.tld;h=08928abbf1524e34727dff27fb138815f383d1be;hb=5d6c98b886882ef8c6edd4e1e5e8702acf91005b;hp=2d0e896de42429530e17795ed178a8323bcd5cd0;hpb=41a8035cb2cd12eae13a5d6ed282559894274ed6;p=packages%2Frpm-tld-macros.git diff --git a/macros.tld b/macros.tld index 2d0e896..08928ab 100644 --- a/macros.tld +++ b/macros.tld @@ -516,6 +516,19 @@ LC_ALL=C.UTF-8 %{__meson} \ Obsoletes: %{1} < %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}} \ Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}} +# for package versions comparison (incl. cc_version or _rpmversion) +# BuildRequires: rpmbuild(macros) >= 1.750 +%_ver_lt() %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -ne 2; echo $?) +%_ver_ge() %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -eq 2; echo $?) + +# noarch subpackage helper +# BuildRequires: rpmbuild(macros) >= 1.752 +%noarchpackage \ +%if %{_ver_ge '%{_rpmversion}' '4.6'} \ +BuildArch: noarch \ +%endif \ +%{nil} + %apache_modules_api %{expand:%%global apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)}%apache_modules_api # sgml macros @@ -925,6 +938,14 @@ fi; \ };} \ %{nil} +# BuildRequires: rpmbuild(macros) >= 1.751 +# Requires(post,postun): /usr/bin/texhash # if you want to ensure cache is updated +%texhash() {{ \ + umask 022; \ + /usr/bin/texhash >&2; \ +};} \ +%{nil} + #----------------------------------------------------------------- # post %install sequence: # - autodeps exceptions