]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/commitdiff
- merged 2.052 from PLD master
authorMarcin Krol <hawk@tld-linux.org>
Tue, 3 Feb 2026 23:41:57 +0000 (00:41 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 3 Feb 2026 23:41:57 +0000 (00:41 +0100)
macros.rust
macros.tld
rpm-tld-macros.spec

index ca49aa48e5cfbf3a74a39d814e25905bb17a016c..5f257379bf66fdf61f718b643db4583d2caad452 100644 (file)
@@ -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}
index 1231e528076815309a9fe3a5827183c294044ceb..45acfb21db3c8e69c3d4f4ea3a0c92b6eb4e3f04 100644 (file)
@@ -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}
index 821c44f822ac4e65dcc9429b863497eee95d6033..ed1018ce8d9795f1d6cd86c6297796b5c0b9495f 100644 (file)
@@ -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