فهرست منبع

add a useful l_test macro for dynamic dependencies (example follow in other commit for perl-net and curl)

Ralf S. Engelschall 23 سال پیش
والد
کامیت
4d8daf51c0
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      openpkg/rpmmacros

+ 3 - 0
openpkg/rpmmacros

@@ -194,6 +194,9 @@
 %ifdef()                 %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
 %ifndef()                %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
 
+#   macro-processor add-on for testing external conditions
+%l_test(pfd)             %(if [ ".%{?-p:yes}" = .yes ]; then %{l_prefix}/bin/rpm -q %1 >/dev/null 2>&1; rc=$?; elif [ ".%{?-f:yes}" = .yes ]; then test -f %1; rc=$?; elif [ ".%{?-d:yes}" = .yes ]; then test -d %1; rc=$?; fi; if [ ".$rc" = .0 ]; then echo "yes"; else echo "no"; fi)
+
 #   helper macros for creating local copies of GNU config scripts
 %update_config_scripts   chmod u+w config.guess config.sub; cp %{l_prefix}/lib/openpkg/config.guess .; cp %{l_prefix}/lib/openpkg/config.sub .