Files
demus-packaging/macros.demus-packaging
demus 55bdece93f
Build and provide rpm of demus-packaging-utils / Build and deploy an rpm to the demus.dk repo (f44) (release) Successful in 24s
Build and provide rpm of demus-packaging-utils / Build and deploy an rpm to the demus.dk repo (rawhide) (release) Successful in 25s
Switch vendor archive update from alias to command and rename
2026-06-05 16:17:24 +02:00

18 lines
973 B
Plaintext

# Verify that the checksums listed in the given file match the checksums of the files in the current directory.
# If the checksum doesn't match an message is printed and the subshell is exited with a non-zero status,
# in order to fail the build.
# The macro should be the first statement in the %prep section.
#
# Control variables, flags and arguments:
# -s path to the file containing the list of checksums. If not provided, the default value is 'sources'
%verify_source_checksum(s:) %{expand:
%define checksumresult %{expand:%(cksum --check --quiet "%{-s:%{-s*}}%{!-s:sources}" 2>/dev/null)}
%[ %{len:%checksumresult} > 0 ? "echo -e 'ERROR: Checksums do not match\\n%{checksumresult}'; exit 1" : "%{nil}" ]
}
# Macro wrapping basename <file> <extension>, so the extension can stripped
%stripped_basename() %{expand:%(basename "%1" %2)}
# Strip the path and .sh extension from the given string
%binshellname() %{expand:%stripped_basename "%1" .sh}