]> git.pld-linux.org Git - packages/rpm-build-tools.git/blob - repackage.sh
- rpm 4.4.9 and 4.4.2 compatible %clean skipping, should also skip rpm 4.4.9 %install...
[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 # Usage:
8 # do %install and rpm package, skips %clean
9 # SPECS$ ./repackage.sh kdelibs.spec
10 #
11 # after that is done you could try only package creation (as %clean was
12 # skipped), for adjusting %files lists:
13 # SPECS$ ./repackage.sh kdelibs.spec -bb
14 #
15 # See also: SPECS/compile.sh
16 #
17 # TODO
18 # - make builder to understand -bi and use builder for short-circuit
19
20 set -e
21
22 rpmbuild() {
23         # use gz payload as time is what we need here, not compress ratio
24         set -x
25         /usr/bin/rpmbuild \
26                 --define '_source_payload w9.gzdio' \
27                 --define '__spec_clean_body %{nil}' \
28                 --define 'clean %%clean \
29                 exit 0%{nil}' \
30                 --define 'check %%check \
31                 exit 0%{nil}' \
32                 ${TARGET:+--target $TARGET} \
33                 $BCONDS \
34                 --short-circuit \
35                 "$@" || exit
36 }
37
38 specfile="${1%.spec}.spec"; shift
39 set -- "$specfile" "$@"
40
41 tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
42 if [ "$tmp" ]; then
43         TARGET="$tmp"
44 fi
45
46 BCONDS=$(./builder -nn -ncs --show-bcond-args $specfile)
47
48 # just create the rpm's if -bb is somewhere in the args
49 if [[ *$@* != *-bb* ]]; then
50         rpmbuild -bi "$@"
51 fi
52 rpmbuild -bb "$@"
This page took 0.03738 seconds and 4 git commands to generate.