diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-15 17:33:18 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-15 17:33:18 +0100 |
commit | 29ecfb7cb4e9bffc891ebf023f3c71d5fa84180d (patch) | |
tree | 431adbda36a41210e1413d53f3d483a3093af800 /scripts | |
parent | 41799843c27d06629bd6ce4c7fd3a65a1149e08b (diff) | |
download | abrt-29ecfb7cb4e9bffc891ebf023f3c71d5fa84180d.tar.gz abrt-29ecfb7cb4e9bffc891ebf023f3c71d5fa84180d.tar.xz abrt-29ecfb7cb4e9bffc891ebf023f3c71d5fa84180d.zip |
update vda's dbg_mkrpm
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/dbg_mkrpm | 27 | ||||
-rwxr-xr-x | scripts/dbg_mkrpm.old | 48 |
2 files changed, 50 insertions, 25 deletions
diff --git a/scripts/dbg_mkrpm b/scripts/dbg_mkrpm index 0149b215..81769bd3 100755 --- a/scripts/dbg_mkrpm +++ b/scripts/dbg_mkrpm @@ -7,7 +7,9 @@ #BUILDDIR="abrt" SRCDIR="." -BUILDDIR="../`basename "$PWD"`.builddir" +BUILDDIR="00_builddir" + +rm -rf "$BUILDDIR" if ! test -f "$SRCDIR/configure"; then echo "Autogenerating configure" @@ -17,20 +19,25 @@ fi test -f "$SRCDIR/abrt.spec" || exit 1 ABRTVER=`grep ^Version: "$SRCDIR/abrt.spec" | head -n1 | sed 's/.* //'` -rm -rf "$BUILDDIR" +T=`mktemp -d` + +# Prepare source snapshot +cp -a "$SRCDIR" "$T"/"abrt-$ABRTVER" + +# Can't do it before copying, BUILDDIR may be a subdir of SRCDIR mkdir "$BUILDDIR" 2>/dev/null -cp -a "$SRCDIR" "$BUILDDIR"/abrt-$ABRTVER +# Prepare sources for rpmbuild +(tar -czf - -C "$T" "abrt-$ABRTVER") >"$BUILDDIR"/"abrt-$ABRTVER".tar.gz +rm -rf "$T" +cp "$SRCDIR"/abrt.spec "$BUILDDIR" +cp "$SRCDIR"/abrt.init "$BUILDDIR" +cp "$SRCDIR"/abrt-ccpp.init "$BUILDDIR" +cp "$SRCDIR"/dbg_* "$BUILDDIR" 2>/dev/null # developers' toys cd "$BUILDDIR" || exit 1 -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 - +# Build them # Less ugly way to pass exitcode (without bashisms)? { nice -n10 rpmbuild \ --define "_topdir $PWD" \ diff --git a/scripts/dbg_mkrpm.old b/scripts/dbg_mkrpm.old index c55805cf..0149b215 100755 --- a/scripts/dbg_mkrpm.old +++ b/scripts/dbg_mkrpm.old @@ -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" |