2 # will build package, skipping %prep and %build stage
8 # do %install and rpm package, skips %clean
9 # SPECS$ ./repackage.sh kdelibs.spec
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
15 # See also: SPECS/compile.sh
18 # - make builder to understand -bi and use builder for short-circuit
23 # preprocess args, we must have --target as first arg to rpmbuild
24 # we need to grab also dir where spec resides
26 while [ $# -gt 0 ]; do
43 specdir=$(dirname "$(pwd)/${spec:-.}")
45 # use gz payload as time is what we need here, not compress ratio
47 # we use %__ldconfig variable to test are we on rpm 4.4.9
48 # on 4.4.9 we should not redefine %clean to contain %clean, and redefine %__spec_clean_body instead
49 # on 4.4.2 we must redefine %clean to contain %clean
52 ${TARGET:+--target $TARGET} \
54 --define "_specdir $specdir" --define "_sourcedir $specdir" \
55 --define 'clean %%%{!?__ldconfig:clean}%{?__ldconfig:check} \
57 --define 'check %%check \
59 --define '_source_payload w5.gzdio' \
60 --define '_binary_payload w5.gzdio' \
61 --define '__spec_install_pre %___build_pre' \
62 --define '__spec_clean_body %{nil}' \
63 --define '_enable_debug_packages 0' \
69 while [ $# -gt 0 ]; do
71 --target|--with|--without)
88 eval rpm-specdump $a || echo >&2 $?
92 # if no spec name passed, glob *.spec
94 if [ ! -f "$1" -o $# -gt 1 ]; then
95 echo >&2 "ERROR: Too many or too few .spec files found"
96 echo >&2 "Usage: ${0##*/} PACKAGE.spec"
100 # $1 must be spec, ensure it has .spec ext
102 set -- ${spec%.spec}.spec "$@"
105 tmp=$(specdump "$@" | awk '$2 == "_target_cpu" {print $3}')
110 # just create the rpm's if -bb is somewhere in the args
111 if [[ *$@* != *-bb* ]]; then