5c52339
#!/bin/bash
5c52339
5c52339
set -e
5c52339
5c52339
FEDORA=`git symbolic-ref --short HEAD | awk '/^f[0-9]+/ { print gensub("^f", "", 1)}'`
5c52339
5c52339
old_fedora=$[${FEDORA} - 1]
5c52339
here="`pwd`"
5c52339
5c52339
set -x
5c52339
5c52339
rpmbuild \
5c52339
    --define "_sourcedir ${here}" --define "_specdir ${here}" --define "_builddir ${here}" --define "_srcrpmdir ${here}" --define "_rpmdir ${here}" \
5c52339
    --define "dist .fc${FEDORA}.infra" \
5c52339
    --define "fedora ${FEDORA}" \
5c52339
    --eval "%undefine rhel" \
5c52339
    --define "fc${FEDORA} 1" \
5c52339
    --eval "%undefine fc${old_fedora}" \
5c52339
    --nodeps -bs bodhi.spec
5c52339
5c52339
set +x
5c52339
latest_srpm=`ls -rt1 bodhi-*.infra.src.rpm | tail -n 1`
5c52339
echo "Now build in Koji with:"
5c52339
echo "koji build f${FEDORA}-infra $latest_srpm"