diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-03 17:10:47 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-03 17:10:47 +0100 |
commit | 4453ea12aa47475a2771800a2f464a6aed71292d (patch) | |
tree | 51cda24496495be10acb2a63bc3a96537ec354e0 /scripts/dbg_mkrpm | |
parent | 26c215c8d5fbcd07475b201c1acde63c24c3a0e4 (diff) | |
download | abrt-4453ea12aa47475a2771800a2f464a6aed71292d.tar.gz abrt-4453ea12aa47475a2771800a2f464a6aed71292d.tar.xz abrt-4453ea12aa47475a2771800a2f464a6aed71292d.zip |
update vda's debug scripts
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'scripts/dbg_mkrpm')
-rwxr-xr-x | scripts/dbg_mkrpm | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/scripts/dbg_mkrpm b/scripts/dbg_mkrpm index c55805cf..0149b215 100755 --- a/scripts/dbg_mkrpm +++ b/scripts/dbg_mkrpm @@ -1,30 +1,48 @@ #!/bin/sh -test -f abrt.spec || exit 1 -ABRTVER=`grep ^Version: abrt.spec | head -n1 | sed 's/.* //'` +#set -e -if ! test -f configure; then +#git clone git://git.fedorahosted.org/git/abrt.git +#SRCDIR="abrt" +#BUILDDIR="abrt" + +SRCDIR="." +BUILDDIR="../`basename "$PWD"`.builddir" + +if ! test -f "$SRCDIR/configure"; then echo "Autogenerating configure" - ./autogen.sh || { rm -f configure; exit 1; } + (cd "$SRCDIR" && ./autogen.sh) || { rm -f "$SRCDIR/configure"; exit 1; } fi +test -f "$SRCDIR/abrt.spec" || exit 1 +ABRTVER=`grep ^Version: "$SRCDIR/abrt.spec" | head -n1 | sed 's/.* //'` -T=/tmp/$$_$RANDOM -test -d "$T" && exit 1 +rm -rf "$BUILDDIR" +mkdir "$BUILDDIR" 2>/dev/null -rm -rf BUILDROOT "abrt-$ABRTVER" "abrt-$ABRTVER".tar "abrt-$ABRTVER".tar.gz \ - abrt*.rpm libreport*.rpm \ - 2>/dev/null +cp -a "$SRCDIR" "$BUILDDIR"/abrt-$ABRTVER -mkdir -p "$T"/"abrt-$ABRTVER" || exit -cp -a * "$T"/"abrt-$ABRTVER" || exit -(cd "$T" && tar -c "abrt-$ABRTVER") >"abrt-$ABRTVER".tar || exit -rm -rf "$T" || exit +cd "$BUILDDIR" || exit 1 -gzip "abrt-$ABRTVER".tar || exit +tar -czf abrt-$ABRTVER.tar.gz abrt-$ABRTVER +cp abrt-$ABRTVER/abrt.spec . +cp abrt-$ABRTVER/abrt.init . +cp abrt-$ABRTVER/abrt-ccpp.init . +#cp abrt-$ABRTVER/dbg_* . +rm -rf abrt-$ABRTVER # Less ugly way to pass exitcode (without bashisms)? -{ nice -n10 ./dbg_rpmbuildlocal -bb abrt.spec 2>&1; echo $? >"EXITCODE"; } | tee -a "$0.log" +{ nice -n10 rpmbuild \ + --define "_topdir $PWD" \ + --define "_builddir $PWD" \ + --define "_rpmdir $PWD" \ + --define "_sourcedir $PWD" \ + --define "_specdir $PWD" \ + --define "_srcrpmdir $PWD" \ + --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ + -bb abrt.spec 2>&1 +echo $? >"EXITCODE" +} | tee -a "$0.log" ret=`cat EXITCODE` rm EXITCODE exit "$ret" |