From: Marcin Krol Date: Tue, 3 Feb 2026 23:41:57 +0000 (+0100) Subject: - merged 2.052 from PLD X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=packages%2Frpm-tld-macros.git - merged 2.052 from PLD --- diff --git a/macros.rust b/macros.rust index ca49aa4..5f25737 100644 --- a/macros.rust +++ b/macros.rust @@ -1,5 +1,5 @@ %debuginforustflags -C debuginfo=%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:2}%{!?__dic_1:0}%{expand:%%undefine __dic_%{?_enable_debug_packages}} -C strip=none -%rpmrustflags %debuginforustflags +%rpmrustflags %debuginforustflags %{!?nospecflags:%{?specrustflags}} %rust_arches %{x8664} %{ix86} x32 aarch64 armv6hl armv7hl armv7hnl %rust_target \\\ @@ -109,3 +109,34 @@ Requires: glibc >= 1:2.23\ Requires: uname(release) >= 4.4\ %endif\ %{nil} + +%update_cargo_checksum() %{!?1:%{error:%%%0 macro requires an argument}} { \ +__update_cargo_checksum() { \ +local file cksum_dir cksum_path cksum_filename cksum cksum_key;\ +cksum_filename=.cargo-checksum.json;\ +for file in "$@"; do \ +if [ ! -f "$file" ]; then \ +echo "ERROR: file '$file' does not exist" >&2;\ +exit 1;\ +fi;\ +unset cksum_path;\ +cksum_dir=$(dirname $(readlink -f "$file"));\ +while [ "$cksum_dir" != "%{_builddir}" ] && [ "$cksum_dir" != / ]; do \ +test -f "$cksum_dir/$cksum_filename" && cksum_path="$cksum_dir/$cksum_filename" && break;\ +cksum_dir=$(dirname "$cksum_dir");\ +done;\ +if [ -z "$cksum_path" ]; then \ +echo "ERROR: cannot find $cksum_filename file for '$file'" >&2;\ +exit 1;\ +fi;\ +cksum_key=$(realpath --relative-to="$cksum_dir" "$file");\ +if ! grep -q "\\"$cksum_key\\"[[:space:]]*:" "$cksum_path"; then \ +echo "ERROR: no entry found for '$cksum_key' in '$cksum_path'" >&2;\ +exit 1;\ +fi;\ +cksum=$(sha256sum "$file"|cut -f1 -d' ');\ +sed -i -re "s;(\\"$cksum_key\\"\\\\s*:\\\\s*)\\"[^\\"]*\\";\\\\1\\"$cksum\\";" "$cksum_path";\ +done;\ +}; __update_cargo_checksum %* \ +}\ +%{nil} diff --git a/macros.tld b/macros.tld index 1231e52..45acfb2 100644 --- a/macros.tld +++ b/macros.tld @@ -1174,6 +1174,7 @@ fi; \ # detect quote character runtime %__qchar_4 \\\\%{nil} %__qchar_5 \\\\\\%{nil} +%__qchar_6 \\\\%{nil} %__qchar %{expand:%%global __qchar %%__qchar_%(echo %{_rpmversion} | cut -c1)}%__qchar #%_noautocompressdoc %{nil} diff --git a/rpm-tld-macros.spec b/rpm-tld-macros.spec index 821c44f..ed1018c 100644 --- a/rpm-tld-macros.spec +++ b/rpm-tld-macros.spec @@ -1,4 +1,4 @@ -%define rpm_macros_rev 2.050 +%define rpm_macros_rev 2.052 %define find_lang_rev 1.42 # split into individual X_prov_ver if there is a reason to desync %define prov_ver 4.15