Ver código fonte

allow internal tools to be overridden

Ralf S. Engelschall 24 anos atrás
pai
commit
1b83238089
2 arquivos alterados com 20 adições e 20 exclusões
  1. 2 2
      openpkg/openpkg.spec
  2. 18 18
      openpkg/rpmmacros

+ 2 - 2
openpkg/openpkg.spec

@@ -39,8 +39,8 @@
 #   o any cc(1)
 
 #   the package version and release
-%define       V_openpkg 20020529
-%define       R_openpkg 20020529
+%define       V_openpkg 20020605
+%define       R_openpkg 20020605
 
 #   the used software versions
 %define       V_rpm     4.0.2

+ 18 - 18
openpkg/rpmmacros

@@ -139,24 +139,24 @@
 %l_bash                  %{l_prefix}/lib/openpkg/bash
 
 #   provide smart paths to tools
-%l_tool_check            test -f %{l_bindir}/$tool && tool="%{l_bindir}/$tool"; echo $tool
-%l_gzip                  %(tool=gzip;     %{l_tool_check})
-%l_bzip2                 %(tool=bzip2;    %{l_tool_check})
-%l_tar                   %(tool=tar;      %{l_tool_check})
-%l_cc                    %(tool=cc;       %{l_tool_check})
-%l_cxx                   %(tool=c++;      %{l_tool_check})
-%l_make                  %(tool=make;     %{l_tool_check})
-%l_patch                 %(tool=patch;    %{l_tool_check})
-%l_sed                   %(tool=sed;      %{l_tool_check})
-%l_grep                  %(tool=grep;     %{l_tool_check})
-%l_awk                   %(tool=awk;      %{l_tool_check})
-%l_autoconf              %(tool=autoconf; %{l_tool_check})
-%l_automake              %(tool=automake; %{l_tool_check})
-%l_libtool               %(tool=libtool;  %{l_tool_check})
-%l_flex                  %(tool=flex;     %{l_tool_check})
-%l_bison                 %(tool=bison;    %{l_tool_check})
-%l_perl                  %(tool=perl;     %{l_tool_check})
-%l_xmkmf                 %(tool=xmkmf;    %{l_tool_check})
+%l_tool_locate()         %(if [ ".%{expand:%%{?with_%1}}" != . ]; then tool="%{expand:%%{with_%1}}"; elif [ -f "%{l_bindir}/%1" ]; then tool="%{l_bindir}/%1"; else tool="%1"; fi; echo $tool)
+%l_gzip                  %{l_tool_locate gzip}
+%l_bzip2                 %{l_tool_locate bzip2}
+%l_tar                   %{l_tool_locate tar}
+%l_cc                    %{l_tool_locate cc}
+%l_cxx                   %{l_tool_locate c++}
+%l_make                  %{l_tool_locate make}
+%l_patch                 %{l_tool_locate patch}
+%l_sed                   %{l_tool_locate sed}
+%l_grep                  %{l_tool_locate grep}
+%l_awk                   %{l_tool_locate awk}
+%l_autoconf              %{l_tool_locate autoconf}
+%l_automake              %{l_tool_locate automake}
+%l_libtool               %{l_tool_locate libtool}
+%l_flex                  %{l_tool_locate flex}
+%l_bison                 %{l_tool_locate bison}
+%l_perl                  %{l_tool_locate perl}
+%l_xmkmf                 %{l_tool_locate xmkmf}
 
 #   tool options
 %l_mflags(O)             %(%{l_rpmtool} flags -m %{-O:-O} %{l_make})