]> git.pld-linux.org Git - packages/rpm-build-tools.git/blob - repackage.sh
53e529c885a1e92984314673539364e41de6b651
[packages/rpm-build-tools.git] / repackage.sh
1 #!/bin/sh
2 # will build package, skipping %prep and %build stage
3 # i use it a lot!
4 #
5 # -glen 2005-03-03
6 #
7 # TODO
8 # - make builder to understand -bi and use builder for short-circuit
9
10 set -e
11
12 rpmbuild() {
13         set -x
14         /usr/bin/rpmbuild ${TARGET:+--target $TARGET} $BCONDS --short-circuit --define '_source_payload w9.gzdio' "$@" || exit
15 }
16
17 specfile="$1"
18
19 tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
20 if [ "$tmp" ]; then
21         TARGET="$tmp"
22 fi
23
24 BCONDS=$(./builder --show-bconds $specfile)
25 # ignore output from older builders whose output is not compatible.
26 if [ "$(echo "$bconds" | wc -l)" -gt 1 ]; then
27         BCONDS=""
28 fi
29
30 # just create the rpm's if -bb is somewhere in the args
31 if [[ *$@* != *-bb* ]]; then
32         rpmbuild -bi "$@"
33 fi
34 rpmbuild -bb --define 'clean %{nil}' "$@"
This page took 0.031802 seconds and 3 git commands to generate.