File duperemove.spec of Package duperemove
#
# spec file for package duperemove
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define modname duperemove
%define tar_version v0.09.beta2
Name: duperemove
BuildRequires: gcc-c++
BuildRequires: glib2-devel
BuildRequires: libgcrypt-devel
Version: 0.09~beta2
Release: 0
Summary: Software to find duplicate extents in files and remove them
License: GPL-2.0
Group: System/Filesystems
Url: https://github.com/markfasheh/duperemove
Source: %{modname}-%{tar_version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Duperemove finds duplicate extents in files and prints them to the
console. It also has the option to remove duplicates on those file
systems which support the btrfs-extent-same ioctl.
%define samename btrfs-extent-same
%package -n btrfs-extent-same
Summary: Debug/Test tool to exercise the btrfs out-of-band deduplication ioctl
Group: System/Filesystems
%description -n btrfs-extent-same
Debug/Test tool to exercise a btrfs ioctl for deduplicating file regions.
%prep
%setup -q -n %{modname}-%{tar_version}
%build
make CFLAGS="%optflags"
make hashstats CFLAGS="%optflags"
make btrfs-extent-same CFLAGS="%optflags"
%install
mkdir -p %{buildroot}/%{_sbindir}
cp %{_builddir}/%{modname}-%{tar_version}/%{modname} %{buildroot}/%{_sbindir}
cp %{_builddir}/%{modname}-%{tar_version}/hashstats %{buildroot}/%{_sbindir}
cp %{_builddir}/%{modname}-%{tar_version}/%{samename} %{buildroot}/%{_sbindir}
mkdir -p %{buildroot}%{_mandir}/man8
cp %{_builddir}/%{modname}-%{tar_version}/%{modname}.8 %{buildroot}/%{_mandir}/man8/
cp %{_builddir}/%{modname}-%{tar_version}/%{samename}.8 %{buildroot}/%{_mandir}/man8/
%files -n btrfs-extent-same
%defattr(-, root, root)
%{_sbindir}/%{samename}
%{_mandir}/man?/%{samename}.8.gz
%files
%defattr(-, root, root)
%doc LICENSE README
%{_sbindir}/duperemove
%{_sbindir}/hashstats
%{_mandir}/man?/%{modname}.8.gz
%changelog