]> git.pld-linux.org Git - packages/rpm-build-tools.git/blob - repackage.sh
- allow specfile without .spec extension
[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%.spec}.spec"; shift
18 set -- "$specfile" "$@"
19
20 tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
21 if [ "$tmp" ]; then
22         TARGET="$tmp"
23 fi
24
25 BCONDS=$(./builder --show-bconds $specfile)
26 # ignore output from older builders whose output is not compatible.
27 if [ "$(echo "$BCONDS" | wc -l)" -gt 1 ]; then
28         BCONDS=""
29 fi
30
31 # just create the rpm's if -bb is somewhere in the args
32 if [[ *$@* != *-bb* ]]; then
33         rpmbuild -bi "$@"
34 fi
35 rpmbuild -bb --define 'clean %{nil}' "$@"
This page took 0.033859 seconds and 4 git commands to generate.