X-Git-Url: https://git.tld-linux.org/?p=packages%2Frpm-tld-macros.git;a=blobdiff_plain;f=macros.tld;fp=macros.tld;h=f12b3d518796ca73751f0fd7b7bea82333294343;hp=307702c12eccb5371c08c717ccfb77a4519aeca3;hb=cf003b2dfbe72b28f3fb8108f24290b760365f24;hpb=a8b462c1f839b0f67d81b5f94047e6e0f50c67d4 diff --git a/macros.tld b/macros.tld index 307702c..f12b3d5 100644 --- a/macros.tld +++ b/macros.tld @@ -282,10 +282,10 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ elif [ -d $HOME/rpm/SPECS -a -d $HOME/rpm/SOURCES ]; then \ # if old style rpm dir exist, go with it echo $HOME/rpm; \ - elif [ -x ../builder -a ! -d ../builder ]; then + elif [ -x ../builder -a ! -d ../builder ] && [ "$(realpath -s ../builder)" != "/usr/bin/builder" ]; then # relative new style rpmdir: in package dir cd ..; pwd - elif [ -x builder -a ! -d builder ]; then + elif [ -x builder -a ! -d builder ] && [ "$(realpath -s builder)" != "/usr/bin/builder" ]; then # relative new style rpmdir: in packages pwd elif [ -x packages/builder -a ! -d packages/builder ]; then @@ -690,12 +690,12 @@ LC_ALL=C.UTF-8 %{__meson} \ # Requires: name = version %requires_eq() %{!?1:ERROR}%{?2:ERROR}%{?1:%{!?2:%{expand:%%requires_eq_to %1 %1}}} # Requires: name = version (version based on querying package %2) -%requires_eq_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --qf 'Requires: %1 = %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} +%requires_eq_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --whatprovides --qf 'Requires: %1 = %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} # Requires: name >= version %requires_ge() %{!?1:ERROR}%{?2:ERROR}%{?1:%{!?2:%{expand:%%requires_ge_to %1 %1}}} # Requires: name >= version (version based on querying package %2) -%requires_ge_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --qf 'Requires: %1 >= %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} +%requires_ge_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --whatprovides --qf 'Requires: %1 >= %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} # helper for renaming packages # %rename old-package @@ -1156,10 +1156,12 @@ fi; \ %{?_noautoreq_py3egg: %{__noauto_regexp_helper -p python3egg %{_noautoreq_py3egg}}} \ %{nil} -%__noautodep_helper() %(awk -v x="%*" 'BEGIN { +%__noautodep_helper() %(echo '%*' | awk 'BEGIN { RS = "\n([ \t]+\n)+"; FS = " "; - split(x, F); +} +{ + split($0, F); if (length(F) > 0) { printf("("); for (i=1; i<=length(F); i++) { @@ -1198,7 +1200,7 @@ fi; \ # %define _noautoprov_pyegg excluded # %define _noautoprov_py3egg excluded3 # -%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}%{__qchar}(%%s%{__qchar}) ", $1)}') +%__noauto_regexp_helper(p:) %(echo '%*' | awk 'BEGIN{RS=" "}{printf("%{-p*}%{__qchar}(%%s%{__qchar}) ", $1)}') # detect quote character runtime %__qchar_4 \\\\%{nil} %__qchar_5 \\\\\\%{nil}