]> git.pld-linux.org Git - packages/rpm-build-tools.git/blob - repackage.sh
- do not cvs up just to lookup bconds
[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 -nn -ncs --show-bcond-args $specfile)
26
27 # just create the rpm's if -bb is somewhere in the args
28 if [[ *$@* != *-bb* ]]; then
29         rpmbuild -bi "$@"
30 fi
31 rpmbuild -bb --define 'clean %{nil}' "$@"
This page took 0.031628 seconds and 4 git commands to generate.