if ! rpmbuild -bs --define "_sourcedir $(pwd)/$dir" --define "_srcrpmdir $(pwd)/$dir" $dir/*.spec; then
echo "Failed to create a source RPM in directory $dir."
echo "If you want to ignore this directory, you should add"
if ! rpmbuild -bs --define "_sourcedir $(pwd)/$dir" --define "_srcrpmdir $(pwd)/$dir" $dir/*.spec; then
echo "Failed to create a source RPM in directory $dir."
echo "If you want to ignore this directory, you should add"