packaging: honour rpm build target options handed in to makerpms.sh
authorMichael Adam <obnox@samba.org>
Fri, 22 Jul 2011 08:27:40 +0000 (10:27 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 22 Jul 2011 13:51:09 +0000 (15:51 +0200)
This allows to call e.g. "makerpms.sh -bs" to build only the source RPM.
(cherry picked from commit c6bfba2bb66962b7b05d708f0747002700991472)

packaging/RPM/makerpms.sh

index a51099c543e9ab58e4b58cb717d149e55c9f70dd..50baa43533beaf345d0201591543206012ed6206 100755 (executable)
@@ -85,7 +85,18 @@ cp -p ${DIRNAME}/${SPECFILE} ${SPECDIR}
 ## Build
 ##
 echo "$(basename $0): Getting Ready to build release package"
-${RPMBUILD} -ba --clean --rmsource ${EXTRA_OPTIONS} ${SPECDIR}/${SPECFILE} || exit 1
+
+case ${EXTRA_OPTIONS} in
+       *-b*)
+               BUILD_TARGET=""
+               ;;
+       *)
+               BUILD_TARGET="-ba"
+               ;;
+esac
+
+
+${RPMBUILD} ${BUILD_TARGET} --clean --rmsource ${EXTRA_OPTIONS} ${SPECDIR}/${SPECFILE} || exit 1
 
 echo "$(basename $0): Done."