From 6a93d746407dafc83e84c85a3b58663984a5ea06 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 23:38:47 +0100 Subject: [PATCH] update to 4.4 [release 4.4-1mamba;Sun Jul 25 2021] --- README.md | 3 ++ hashdeep.spec | 99 ++++++++++++++++++++++++++++++++++++ md5deep-4.3-gcc-4.7.patch | 14 +++++ md5deep-4.4-glibc-2.38.patch | 29 +++++++++++ 4 files changed, 145 insertions(+) create mode 100644 hashdeep.spec create mode 100644 md5deep-4.3-gcc-4.7.patch create mode 100644 md5deep-4.4-glibc-2.38.patch diff --git a/README.md b/README.md index e887820..963df2b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # hashdeep +md5deep computes the MD5, SHA-1, SHA-256, Tiger, or Whirlpool message digest for any number of files while optionally recursively digging through the directory structure. +Can also match input files against lists of known hashes in a variety of formats. + diff --git a/hashdeep.spec b/hashdeep.spec new file mode 100644 index 0000000..e468e98 --- /dev/null +++ b/hashdeep.spec @@ -0,0 +1,99 @@ +#% define patchl 001 + +Name: hashdeep +Version: 4.4 +Release: 1mamba +Summary: A set of programs to compute MD5, SHA-1, SHA-256 Tiger, Whirlpool message digests +Group: Applications/Security +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/jessek/hashdeep +Source: https://github.com/jessek/hashdeep.git/v%{version}/hashdeep-%{version}.tar.bz2 +Patch0: md5deep-4.3-gcc-4.7.patch +Patch1: md5deep-4.4-glibc-2.38.patch +License: Public Domain +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libgcc +BuildRequires: libstdc++6-devel +## AUTOBUILDREQ-END +Provides: md5deep +Obsoletes: md5deep < 4.4 + +%description +md5deep computes the MD5, SHA-1, SHA-256, Tiger, or Whirlpool message digest for any number of files while optionally recursively digging through the directory structure. +Can also match input files against lists of known hashes in a variety of formats. + +%debug_package + +%prep +%setup -q -n hashdeep-%{version} +%patch 0 -p1 +%patch 1 -p1 -b .glibc-2.38 +./bootstrap.sh + +%build +%configure +%make +#PREFIX=%{_prefix} MAN=%{_mandir}/man1 + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall +# \ +# PREFIX=%{buildroot}%{_prefix} \ +# MAN=%{buildroot}%{_mandir}/man1 + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%{_bindir}/hashdeep +%{_bindir}/md5deep +%{_bindir}/sha1deep +%{_bindir}/sha256deep +%{_bindir}/tigerdeep +%{_bindir}/whirlpooldeep +%{_mandir}/man1/hashdeep.1.* +%{_mandir}/man1/md5deep.* +%{_mandir}/man1/sha1deep.* +%{_mandir}/man1/sha256deep.* +%{_mandir}/man1/tigerdeep.* +%{_mandir}/man1/whirlpooldeep.* +%doc README + +%changelog +* Sun Jul 25 2021 Silvan Calarco 4.4-1mamba +- update to 4.4 + +* Sun Apr 14 2013 Silvan Calarco 4.3-2mamba +- added a patch to workaround a segfault with recent libstdc++6 when invoked with -e option + +* Fri Dec 21 2012 Automatic Build System 4.3-1mamba +- update to 4.3 + +* Tue Jul 26 2011 Automatic Build System 3.9.2-1mamba +- automatic update by autodist + +* Fri Jul 22 2011 Automatic Build System 3.9.1-1mamba +- automatic update to 3.0.3.0 by autodist + +* Tue Dec 21 2010 Automatic Build System 3.7-1mamba +- automatic update by autodist + +* Mon May 10 2010 Automatic Build System 3.6-1mamba +- automatic update by autodist + +* Mon Jul 13 2009 Automatic Build System 3.4-1mamba +- update to 3.4 + +* Wed Dec 12 2007 Aleph0 2.0.1-001-1mamba +- update to 2.0.1-001 + +* Tue Oct 23 2007 Silvan Calarco 2.0-1mamba +- update to 2.0 + +* Thu Sep 14 2006 Davide Madrisan 1.12-1qilnx +- package created by autospec diff --git a/md5deep-4.3-gcc-4.7.patch b/md5deep-4.3-gcc-4.7.patch new file mode 100644 index 0000000..cf59365 --- /dev/null +++ b/md5deep-4.3-gcc-4.7.patch @@ -0,0 +1,14 @@ +--- md5deep-4.3.patched/src/display.cpp 2013-04-14 18:22:37.512819799 +0200 ++++ md5deep-4.3/src/display.cpp 2012-06-05 13:00:57.000000000 +0200 +@@ -309,9 +309,9 @@ + uint64_t min = seconds/60; + seconds -= min * 60; + +- ss << mb_read << "MB of " << fdht->stat_megs() << "MB done, "; + char msg[64]; ++ snprintf(msg,sizeof(msg),"%lluMB of %lluMB done, %02"PRIu64":%02"PRIu64":%02"PRIu64" left", ++ mb_read, fdht->stat_megs(), hour, min, seconds); +- snprintf(msg,sizeof(msg),"%02"PRIu64":%02"PRIu64":%02"PRIu64" left", hour, min, seconds); + ss << msg; + } + ss << "\r"; diff --git a/md5deep-4.4-glibc-2.38.patch b/md5deep-4.4-glibc-2.38.patch new file mode 100644 index 0000000..79128eb --- /dev/null +++ b/md5deep-4.4-glibc-2.38.patch @@ -0,0 +1,29 @@ +From 6ef69a26126ee4e69a25392fd456b8a66c51dffd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 15 Nov 2016 02:46:55 +0000 +Subject: [PATCH] Fix errors found by clang + +Fixes errors like + +../../git/src/hash.cpp:282:19: error: ordered comparison between pointer and zero ('const unsigned char *' and 'int') + if(fdht->base>0){ + ~~~~~~~~~~^~ + +Signed-off-by: Khem Raj +--- + src/hash.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/hash.cpp b/src/hash.cpp +index 42161579f..52f419b0c 100644 +--- a/src/hash.cpp ++++ b/src/hash.cpp +@@ -279,7 +279,7 @@ void file_data_hasher_t::hash() + MAP_FILE| + #endif + MAP_SHARED,fd,0); +- if(fdht->base>0){ ++ if(fdht->base != (void *) -1){ + /* mmap is successful, so set the bounds. + * if it is not successful, we default to reading the fd + */