From bbfe156afe86fc06868360692b2ebb42b43686bc Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Fri, 19 Oct 2018 22:54:41 +0100 Subject: [PATCH 1/5] Initial build Signed-off-by: Jonathan Dieter --- .gitignore | 1 + duperemove-use-system-xxhash.patch | 77 ++++++++++++++++++++++++++++++ duperemove.spec | 65 +++++++++++++++++++++++++ sources | 1 + 4 files changed, 144 insertions(+) create mode 100644 .gitignore create mode 100644 duperemove-use-system-xxhash.patch create mode 100644 duperemove.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..38a6b98 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/duperemove-0.11.tar.gz diff --git a/duperemove-use-system-xxhash.patch b/duperemove-use-system-xxhash.patch new file mode 100644 index 0000000..0298fa3 --- /dev/null +++ b/duperemove-use-system-xxhash.patch @@ -0,0 +1,77 @@ +diff -urb duperemove-0.11a/csum-xxhash.c duperemove-0.11b/csum-xxhash.c +--- duperemove-0.11a/csum-xxhash.c 2018-05-15 20:47:26.000000000 +0100 ++++ duperemove-0.11b/csum-xxhash.c 2018-09-10 11:11:17.768921930 +0100 +@@ -43,7 +43,7 @@ + } + + struct xxhash_running_checksum { +- XXH64_state_t td64; ++ XXH64_state_t *td64; + }; + DECLARE_RUNNING_CSUM_CAST_FUNCS(xxhash_running_checksum); + +@@ -51,7 +51,8 @@ + { + struct xxhash_running_checksum *c = + calloc(1, sizeof(struct xxhash_running_checksum)); +- XXH64_reset(&c->td64, 0); ++ c->td64 = XXH64_createState(); ++ XXH64_reset(c->td64, 0); + return priv_to_rc(c); + } + +@@ -59,7 +60,7 @@ + unsigned int len, unsigned char *buf) + { + struct xxhash_running_checksum *c = rc_to_priv(_c); +- XXH64_update(&c->td64, buf, len); ++ XXH64_update(c->td64, buf, len); + } + + static void xxhash_finish_running_checksum(struct running_checksum *_c, +@@ -68,7 +69,8 @@ + struct xxhash_running_checksum *c = rc_to_priv(_c); + unsigned long long *hash = (unsigned long long*)digest; + +- *hash = XXH64_digest(&c->td64); ++ *hash = XXH64_digest(c->td64); ++ XXH64_freeState(c->td64); + free(c); + } + +diff -urb duperemove-0.11a/Makefile duperemove-0.11b/Makefile +--- duperemove-0.11a/Makefile 2018-05-15 20:47:26.000000000 +0100 ++++ duperemove-0.11b/Makefile 2018-09-10 11:09:11.808519081 +0100 +@@ -8,13 +8,13 @@ + + HEADERS=csum.h hash-tree.h results-tree.h kernel.h list.h rbtree.h dedupe.h \ + btrfs-ioctl.h filerec.h btrfs-util.h debug.h util.h \ +- memstats.h file_scan.h find_dupes.h run_dedupe.h xxhash.h \ ++ memstats.h file_scan.h find_dupes.h run_dedupe.h \ + bswap.h dbfile.h interval_tree.h interval_tree_generic.h \ + rbtree_augmented.h list_sort.h stats.h + CFILES=duperemove.c hash-tree.c results-tree.c rbtree.c dedupe.c filerec.c \ + btrfs-util.c util.c memstats.c file_scan.c find_dupes.c run_dedupe.c \ + csum.c dbfile.c interval_tree.c list_sort.c stats.c debug.c +-hash_CFILES=csum-xxhash.c xxhash.c csum-murmur3.c ++hash_CFILES=csum-xxhash.c csum-murmur3.c + + CFILES += $(hash_CFILES) + +@@ -24,7 +24,7 @@ + + DIST_CFILES:=$(CFILES) $(hashstats_CFILES) $(btrfs_extent_same_CFILES) \ + $(csum_test_CFILES) +-DIST_SOURCES:=$(DIST_CFILES) $(HEADERS) LICENSE LICENSE.xxhash Makefile \ ++DIST_SOURCES:=$(DIST_CFILES) $(HEADERS) LICENSE Makefile \ + rbtree.txt README.md $(MANPAGES) SubmittingPatches docs/duperemove.html + DIST=duperemove-$(VER) + DIST_TARBALL=$(RELEASE).tar.gz +@@ -45,6 +45,7 @@ + glib_LIBS=$(shell pkg-config --libs glib-2.0) + sqlite_CFLAGS=$(shell pkg-config --cflags sqlite3) + sqlite_LIBS=$(shell pkg-config --libs sqlite3) ++hash_LIBS=-lxxhash + + ifdef DEBUG + DEBUG_FLAGS = -ggdb3 -fsanitize=address -fno-omit-frame-pointer \ diff --git a/duperemove.spec b/duperemove.spec new file mode 100644 index 0000000..3b9ea70 --- /dev/null +++ b/duperemove.spec @@ -0,0 +1,65 @@ +Name: duperemove +Version: 0.11 +Release: 2%{?dist} +Summary: Tools for deduping file systems +License: GPLv2 +URL: https://github.com/markfasheh/%{name} +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Patch1: duperemove-use-system-xxhash.patch +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(sqlite3) +BuildRequires: libgcrypt-devel +BuildRequires: xxhash-devel +BuildRequires: libatomic +BuildRequires: gcc + +%description +Duperemove is a simple tool for finding duplicated extents and +submitting them for deduplication. When given a list of files it will +hash their contents on a block by block basis and compare those hashes +to each other, finding and categorizing extents that match each other. + +When given the -d option, duperemove will submit those extents for +deduplication using the btrfs-extent-same ioctl. + +%prep +%autosetup +rm -f xxhash.c xxhash.h + +%build +%set_build_flags +%make_build + +%install +%make_install SBINDIR=%{_sbindir} MANDIR=%{_mandir} + +%files +%doc README.md +%license LICENSE +%{_mandir}/man8/btrfs-extent-same*.8* +%{_mandir}/man8/duperemove*.8* +%{_mandir}/man8/hashstats*.8* +%{_mandir}/man8/show-shared-extents*.8* +%{_sbindir}/btrfs-extent-same +%{_sbindir}/duperemove +%{_sbindir}/hashstats +%{_sbindir}/show-shared-extents + +%changelog +* Fri Oct 19 2018 Jonathan Dieter - 0.11-2 +- Add missing BR +- Fix build to use build flags + +* Sat Oct 13 2018 Jonathan Dieter - 0.11-1 +- Bump to 0.11 +- Unbundle xxhash + +* Fri Nov 13 2015 Francesco Frassinelli - 0.10-1 +- Version bump; license and minor packaging issues fixed + +* Thu Jul 30 2015 Francesco Frassinelli - 0.09.5-2 +- %%license macro added + +* Sun Jul 19 2015 Francesco Frassinelli - 0.09.5-1 +- Initial build + diff --git a/sources b/sources new file mode 100644 index 0000000..8166c05 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (duperemove-0.11.tar.gz) = b1bc2beb92223f9b46f8838e2f983ec763a9dff302f4202a34cc5e10591b985519f0464b6eba566c56872e671ba80583c7fdf4a232325086141d011384a286cf From e03676de94da1196208796a68deeb02c98b57a3a Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sat, 20 Oct 2018 20:55:27 +0100 Subject: [PATCH 2/5] Add devsettool BR for EPEL Signed-off-by: Jonathan Dieter --- duperemove.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/duperemove.spec b/duperemove.spec index 3b9ea70..56a6826 100644 --- a/duperemove.spec +++ b/duperemove.spec @@ -1,6 +1,6 @@ Name: duperemove Version: 0.11 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tools for deduping file systems License: GPLv2 URL: https://github.com/markfasheh/%{name} @@ -12,6 +12,10 @@ BuildRequires: libgcrypt-devel BuildRequires: xxhash-devel BuildRequires: libatomic BuildRequires: gcc +# Enable devtoolset so we get libatomic in EPEL +%if 0%{?rhel} == 7 +BuildRequires: devtoolset-7-toolchain, devtoolset-7-libatomic-devel +%endif %description Duperemove is a simple tool for finding duplicated extents and @@ -28,6 +32,9 @@ rm -f xxhash.c xxhash.h %build %set_build_flags +%if 0%{?rhel} +. /opt/rh/devtoolset-7/enable +%endif %make_build %install @@ -46,6 +53,9 @@ rm -f xxhash.c xxhash.h %{_sbindir}/show-shared-extents %changelog +* Sat Oct 20 2018 Jonathan Dieter - 0.11-3 +- Add devsettool BR and build for EPEL + * Fri Oct 19 2018 Jonathan Dieter - 0.11-2 - Add missing BR - Fix build to use build flags From 83bf51328c8487cc280376296cb6348a6a10572c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 31 Jan 2019 17:59:34 +0000 Subject: [PATCH 3/5] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- duperemove.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/duperemove.spec b/duperemove.spec index 56a6826..953fa0f 100644 --- a/duperemove.spec +++ b/duperemove.spec @@ -1,6 +1,6 @@ Name: duperemove Version: 0.11 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Tools for deduping file systems License: GPLv2 URL: https://github.com/markfasheh/%{name} @@ -53,6 +53,9 @@ rm -f xxhash.c xxhash.h %{_sbindir}/show-shared-extents %changelog +* Thu Jan 31 2019 Fedora Release Engineering - 0.11-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Sat Oct 20 2018 Jonathan Dieter - 0.11-3 - Add devsettool BR and build for EPEL From 3c2ad1ad72f4ed615b81d444cd3227d78437909b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jul 2019 22:47:43 +0000 Subject: [PATCH 4/5] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- duperemove.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/duperemove.spec b/duperemove.spec index 953fa0f..a764676 100644 --- a/duperemove.spec +++ b/duperemove.spec @@ -1,6 +1,6 @@ Name: duperemove Version: 0.11 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Tools for deduping file systems License: GPLv2 URL: https://github.com/markfasheh/%{name} @@ -53,6 +53,9 @@ rm -f xxhash.c xxhash.h %{_sbindir}/show-shared-extents %changelog +* Wed Jul 24 2019 Fedora Release Engineering - 0.11-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Thu Jan 31 2019 Fedora Release Engineering - 0.11-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From a6852d25c811d5774d5424509b06ffc158087360 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Sun, 8 Dec 2019 20:40:06 +0000 Subject: [PATCH 5/5] Update to 0.11.1 Signed-off-by: Jonathan Dieter --- .gitignore | 1 + duperemove.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 38a6b98..f6e0009 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /duperemove-0.11.tar.gz +/duperemove-0.11.1.tar.gz diff --git a/duperemove.spec b/duperemove.spec index a764676..e252cbe 100644 --- a/duperemove.spec +++ b/duperemove.spec @@ -1,6 +1,6 @@ Name: duperemove -Version: 0.11 -Release: 5%{?dist} +Version: 0.11.1 +Release: 1%{?dist} Summary: Tools for deduping file systems License: GPLv2 URL: https://github.com/markfasheh/%{name} @@ -53,6 +53,9 @@ rm -f xxhash.c xxhash.h %{_sbindir}/show-shared-extents %changelog +* Sun Dec 08 2019 Jonathan Dieter - 0.11.1-1 +- New release + * Wed Jul 24 2019 Fedora Release Engineering - 0.11-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources index 8166c05..0ef0c00 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (duperemove-0.11.tar.gz) = b1bc2beb92223f9b46f8838e2f983ec763a9dff302f4202a34cc5e10591b985519f0464b6eba566c56872e671ba80583c7fdf4a232325086141d011384a286cf +SHA512 (duperemove-0.11.1.tar.gz) = 3c344b00b8fb58a259840aea977ba2e5123b651bb58ec84177bdfd8337a377361984b85c6325271b7d3e4ea216017fa6fda793136c83e9837a13ec041df326b9