]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- grap specdir
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 29 Apr 2009 07:06:35 +0000 (07:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    repackage.sh -> 1.30

repackage.sh

index 062e864a655cecc0cbaa5f1f3c6883db3ea5b9b1..07a3faec0e5cc5db1c4b8ca3a707de2c1aa296aa 100644 (file)
@@ -21,13 +21,18 @@ set -e
 
 rpmbuild() {
        # preprocess args, we must have --target as first arg to rpmbuild
-       local a
+       # we need to grab also dir where spec resides
+       local a spec specdir
        while [ $# -gt 0 ]; do
                case "$1" in
                --target)
                        shift
                        TARGET=$1
                        ;;
+               *.spec)
+                       spec="$1"
+                       a="$a $1"
+                       ;;
                *)
                        a="$a $1"
                        ;;
@@ -35,6 +40,8 @@ rpmbuild() {
                shift
        done
 
+    specdir=$(dirname "$(pwd)/${spec:-.}")
+
        # use gz payload as time is what we need here, not compress ratio
 
        # we use %__ldconfig variable to test are we on rpm 4.4.9
@@ -44,6 +51,7 @@ rpmbuild() {
        /usr/bin/rpmbuild \
                ${TARGET:+--target $TARGET} \
                --short-circuit \
+               --define "_specdir $specdir" --define "_sourcedir $specdir" \
                --define 'clean %%%{!?__ldconfig:clean}%{?__ldconfig:check} \
                exit 0%{nil}' \
                --define 'check %%check \
This page took 0.328713 seconds and 4 git commands to generate.