File whdd.spec of Package whdd

%define realname whdd
%define srcext   tar.bz2

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}
Version:       2.2
Release:       %{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Hardware/Other
URL:           https://github.com/whdd/whdd
Summary:       HDD diagnostic and data recovery tool for Linux

# Install-time parameters

# Build-time parameters
BuildRequires: cmake >= 2.8.4
BuildRequires: gcc-c++
BuildRequires: dialog-devel >= 1.2 ncurses-devel
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

%description
WHDD is a HDD diagnostic and data recovery tool for Linux.

It is capable of testing a hard drive with reading and writing, providing
intuitive visualization of the process. Visualization or these tests is very
similar to MHDD.

Amongst others, there is a function for copying the device. The copying procedure
algorithms are optimized for least harm to already-defective source device.
The meaning of this becomes clear in a demo.

WHDD may work with your hard drives on low level, sending ATA commands to device,
the benefits are:

  * no system freeze while accessing damaged device (device is soft-reset on timeout);
  * better timing precision.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}

%build
%{__mkdir} build
cd build
cmake .. \
 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
 -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}" \
 -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}" \
 -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--strip-all -shared %{?gcc_lto}" \
 -DCMAKE_SKIP_RPATH=YES \
 -DCFLAGS="%{optflags} -std=gnu99 -pthread -D_GNU_SOURCE -I%{_includedir}/ncurses %{?gcc_lto}" \
 -DDIALOG_INCLUDE_DIR=%{_includedir}/dialog \
 -DCLI=YES
%{__make} %{?_smp_mflags} VERBOSE=1

%install
%{__make} -C build install DESTDIR=%{buildroot}

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README
%{_sbindir}/whdd
%{_sbindir}/whdd-cli

%changelog
openSUSE Build Service is sponsored by