]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - compile.sh
- bump copyright year
[packages/rpm-build-tools.git] / compile.sh
old mode 100644 (file)
new mode 100755 (executable)
index 6faa9c8..8aa5607
@@ -2,27 +2,24 @@
 # will build package, skipping %prep and %build stage
 # i use it a lot!
 #
+# Usage:
+# make only %build stage (i.e. after %prep has been done), for example after
+# modifying some sources for more complicated specs whose %build is not just
+# %{__make}:
+# SPECS$ ./compile.sh kdelibs.spec
+#
+# See also: SPECS/repackage.sh
+#
 # -glen 2005-03-03
 
-set -e
-
-rpmbuild() {
-       set -x
-       /usr/bin/rpmbuild ${TARGET:+--target $TARGET} $BCONDS --short-circuit --define '_source_payload w9.gzdio' "$@" || exit
-}
-
-specfile="${1%.spec}.spec"; shift
-set -- "$specfile" "$@"
-
-tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
-if [ "$tmp" ]; then
-       TARGET="$tmp"
-fi
-
-BCONDS=$(./builder --show-bconds $specfile)
-# ignore output from older builders whose output is not compatible.
-if [ "$(echo "$BCONDS" | wc -l)" -gt 1 ]; then
-       BCONDS=""
+dir=$(dirname "$0")
+if [ $# = 0 ]; then
+       # if no spec name passed, glob *.spec
+       set -- *.spec
+       if [ ! -f "$1" -o $# -gt 1 ]; then
+               echo >&2 "ERROR: Too many or too few .spec files found"
+               echo >&2 "Usage: ${0##*/} PACKAGE.spec"
+               exit 1
+       fi
 fi
-
-rpmbuild -bc "$@"
+exec $dir/builder --no-md5 -ncs -nn --short-circuit -bc "$@"
This page took 0.024809 seconds and 4 git commands to generate.