summaryrefslogtreecommitdiffstats
path: root/scripts/dbg_mkrpm
blob: e5f0fe97fefc7e0617c713e8443e5f9ec7994ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

test -f abrt.spec || exit 1
ABRTVER=`grep ^Version: abrt.spec | head -n1 | sed 's/.* //'`

if ! test -f configure; then
        echo "Autogenerating configure"
        ./autogen.sh || { rm -f configure; exit 1; }
fi


T=/tmp/$$_$RANDOM
test -d "$T" && exit 1

rm -rf BUILDROOT "abrt-$ABRTVER" "abrt-$ABRTVER".tar "abrt-$ABRTVER".tar.gz \
    abrt*.rpm \
    2>/dev/null

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

gzip "abrt-$ABRTVER".tar || exit

# Less ugly way to pass exitcode (without bashisms)?
{ ./dbg_rpmbuildlocal -bb abrt.spec 2>&1; echo $? >"EXITCODE"; } | tee -a "$0.log"
ret=`cat EXITCODE`
rm EXITCODE
exit "$ret"