Browse Source

switch to new %option implementation

Ralf S. Engelschall 23 years ago
parent
commit
0153cd08b1
3 changed files with 7 additions and 5 deletions
  1. 2 2
      openpkg/openpkg.spec
  2. 3 3
      openpkg/rpmmacros
  3. 2 0
      openpkg/rpmpopt

+ 2 - 2
openpkg/openpkg.spec

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

+ 3 - 3
openpkg/rpmmacros

@@ -195,9 +195,9 @@
 %ifdef()                 %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
 %ifndef()                %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
 
-#   macros for package option handling
-%option()               %{expand:%%{!?%{1}:%%global %*}%%global _options %%{?_options:%%{_options}&}%{1}=%%{%{1}}}
-%options(p:)            %(echo "Package Options:"; opts=`echo "%{?_options:%{_options}}"`; if [ ".$opts" = . ]; then echo "    (none)"; else IFS="&"; for opt in $opts; do eval `echo $opt | sed -e 's/^\\(.*\\)=\\(.*\\)$/name="\\1"; value="\\2"/'`; echo dummy | awk '{ printf("    %%%%option %%-%{?-p:%{-p*}}s %%s\\n", name, value); }' name="$name" value="$value"; done; fi)
+#   macro for package option configuration
+%option()                %{expand:%%{!?%{1}:%%global %*}} \
+Provides: %{name}::%{1} = %(echo '%{expand:%%{%{1}}}' | sed -e 's;%%;%%%%;g' -e 's; ;%%20;g' -e 's;	;%%09;g')
 
 #   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)

+ 2 - 0
openpkg/rpmpopt

@@ -22,5 +22,7 @@ Vendor:  %-27{VENDOR} Install Size: %{SIZE} bytes\n\
 URL:     %-27{URL} Install Time: %|INSTALLTIME?{%{INSTALLTIME:date}}:{(not installed)}|\n\
 Summary: %{SUMMARY}\n\
 Description:\n%{DESCRIPTION}\n\
+Provides:\n\
+[    %{PROVIDENAME} %|PROVIDEFLAGS?{%{PROVIDEFLAGS:depflags} %{PROVIDEVERSION}}:{}|\n]\
 '