+ # preprocess args, we must have --target as first arg to rpmbuild
+ # we need to grab also dir where spec resides
+ local a spec specdir
+ while [ $# -gt 0 ]; do
+ case "$1" in
+ --target)
+ shift
+ TARGET=$1
+ ;;
+ *.spec)
+ spec="$1"
+ a="$a $1"
+ ;;
+ *)
+ a="$a $1"
+ ;;
+ esac
+ shift
+ done
+
+ specdir=$(dirname "$(pwd)/${spec:-.}")
+
+ # use gz payload as time is what we need here, not compress ratio
+
+ # we use %__ldconfig variable to test are we on rpm 4.4.9
+ # on 4.4.9 we should not redefine %clean to contain %clean, and redefine %__spec_clean_body instead
+ # on 4.4.2 we must redefine %clean to contain %clean