]> git.pld-linux.org Git - packages/rpm-build-tools.git/blame - repackage.sh
- incude usage count of bconds in second column
[packages/rpm-build-tools.git] / repackage.sh
CommitLineData
b0f3c13a
ER
1#!/bin/sh
2# will build package, skipping %prep and %build stage
3# i use it a lot!
4#
5# -glen 2005-03-03
201eefee 6#
5f775b93
ER
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#
201eefee 17# TODO
1e4db2ae 18# - make builder to understand -bi and use builder for short-circuit
b0f3c13a
ER
19
20set -e
21
22rpmbuild() {
23 set -x
4a529b9f 24 /usr/bin/rpmbuild ${TARGET:+--target $TARGET} $BCONDS --short-circuit --define '_source_payload w9.gzdio' "$@" || exit
b0f3c13a 25}
e5c7e9c1 26
d0560858
ER
27specfile="${1%.spec}.spec"; shift
28set -- "$specfile" "$@"
91e42acf 29
36c6591f 30tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
595e4fde
ER
31if [ "$tmp" ]; then
32 TARGET="$tmp"
33fi
34
4dbb5c3b 35BCONDS=$(./builder -nn -ncs --show-bcond-args $specfile)
36c6591f 36
e5c7e9c1
ER
37# just create the rpm's if -bb is somewhere in the args
38if [[ *$@* != *-bb* ]]; then
4a529b9f 39 rpmbuild -bi "$@"
e5c7e9c1 40fi
4a529b9f 41rpmbuild -bb --define 'clean %{nil}' "$@"
This page took 0.06986 seconds and 4 git commands to generate.