diff --git a/conf/autospec.conf.in b/conf/autospec.conf.in index 8876875..36e5902 100644 --- a/conf/autospec.conf.in +++ b/conf/autospec.conf.in @@ -23,6 +23,9 @@ packager_fullname= packager_email= +## Detect rpm version +rpm_version="`rpm --version | sed 's|.* .* ||'`" + ## Mode to be used when creating and updating the specfiles ------------------- rpm_specfile_mode="644" diff --git a/lib/libspec.lib.in b/lib/libspec.lib.in index 5866c04..842ebb2 100644 --- a/lib/libspec.lib.in +++ b/lib/libspec.lib.in @@ -637,12 +637,21 @@ $FUNCNAME: specfile_preprocessed = \"$specfile_preprocessed\"" notify.error "$FUNCNAME: "$"can't create temporary files" notify.debug "$FUNCNAME: tmpspreprerr = \`${NOTE}$tmpspreprerr${NORM}'" - notify.debug "\ + if [ "${rpm_version:0:2}" == "5." ]; then + notify.debug "\ $FUNCNAME: running: rpm -q $rpm_options --specfile --specedit $specfile ..." - eval "\ + eval "\ rpm -q $rpm_options --specfile --specedit $specfile \ - > $specfile_preprocessed 2> $tmpspreprerr" + > $specfile_preprocessed 2> $tmpspreprerr" + else + notify.debug "\ +$FUNCNAME: running: rpmspec $rpm_options -P $specfile ..." + + eval "\ +rpmspec $rpm_options -P $specfile \ + > $specfile_preprocessed 2> $tmpspreprerr" + fi if [ -s "$tmpspreprerr" ]; then notify.warning $"\