]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
repackage: Add rpm 4.16 compatibility
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 20 Dec 2021 14:58:35 +0000 (16:58 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Wed, 22 Feb 2023 18:16:57 +0000 (20:16 +0200)
repackage.sh

index 96a4fd9a210331cd15910eb948d5ee0b35a28257..69a73d73c3fcbad3976ebe26cdf343567190065f 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # will build package, skipping %prep and %build stage
 # i use it a lot!
 #
 
 set -e
 
+dump() {
+       local a
+       for a in "$@"; do
+               echo "$a"
+       done
+}
+
 skip_dep_generators() {
        local dep
        for dep in \
@@ -35,8 +42,8 @@ skip_dep_generators() {
                python \
                ruby \
        ; do
-               printf "--define __%s_provides%%{nil}\n" $dep
-               printf "--define __%s_requires%%{nil}\n" $dep
+               args+=("--define=__${dep}_provides %%{nil}")
+               args+=("--define=__${dep}_requires %%{nil}")
        done
 }
 
@@ -68,10 +75,17 @@ rpmbuild() {
        # we use %__ldconfig variable to test are we on rpm 4.4.9
        # on 4.4.9 we should not redefine %clean to contain %clean, and redefine %__spec_clean_body instead
        # on 4.4.2 we must redefine %clean to contain %clean
+       local -a args=()
+       if [ -n "${bb+1}" ]; then
+               skip_dep_generators
+               args+=(--define '%py_postclean(-x:) %{nil}')
+       fi
+
        set -x
        /usr/bin/rpmbuild \
                ${TARGET:+--target $TARGET} \
                --short-circuit \
+               --define 'disable_short_circuited_deps 0' \
                --define "_specdir $specdir" --define "_sourcedir $specdir" \
                --define 'clean %%%{!?__ldconfig:clean}%{?__ldconfig:check} \
                exit 0%{nil}' \
@@ -82,8 +96,7 @@ rpmbuild() {
                --define '__spec_install_pre %___build_pre' \
                --define '__spec_clean_body %{nil}' \
                --define '_enable_debug_packages 0' \
-               ${bb+$(skip_dep_generators)} \
-               ${bb+--define '%py_postclean(-x:) %{nil}'} \
+               "${args[@]}" \
                $a || exit
 }
 
This page took 0.151476 seconds and 4 git commands to generate.