File testdisk.spec of Package testdisk

%define realname testdisk
%define realver  7.1
%define srcext   tar.bz2

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

# Common info
Name:          %{realname}
Version:       %{realver}
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Productivity/File utilities
URL:           http://www.cgsecurity.org/
Summary:       Data recovery tools

# Install-time parameters
Provides:      photorec = %{version} fidentify = %{version}

# Build-time parameters
BuildRequires: pkgconfig gcc-c++
BuildRequires: ncurses-devel
BuildRequires: ntfs-3g-devel
BuildRequires: zlib-devel
BuildRequires: libjpeg-devel
BuildRequires: libcom_err-devel
BuildRequires: libuuid-devel
BuildRequires: pkgconfig(Qt5Core) pkgconfig(Qt5Gui) pkgconfig(Qt5Widgets)
#BuildRequires: pkgconfig(ext2fs)
#BuildRequires: mimehandler(application/x-linguist)
%if 0%{?suse_version}
BuildRequires: libext2fs-devel
BuildRequires: libqt5-linguist
%else
BuildRequires: e2fsprogs-devel
BuildRequires: qt5-linguist
%endif
BuildRoot:     %{_tmppath}/%{name}-root
Source:        http://www.cgsecurity.org/%{realname}-%{realver}%{?extraver}.%{srcext}

%description
TestDisk checks the partition and boot sectors of your disks.
It is very useful in recovering lost partitions.

PhotoRec is file data recovery software designed to recover
lost pictures from digital camera memory or even Hard Disks.
It has been extended to search also for non audio/video headers.

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

%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_CXXFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}'
%configure \
 --disable-static \
 --without-reiserfs \
 --without-ewf \
 --disable-assert \
 --enable-sudo \
 --enable-qt \
 CFLAGS="$_CFLAGS" \
 CXXFLAGS="$_CXXFLAGS" \
 LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}

%install
%{__make} install DESTDIR=%{buildroot}
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}%{_datadir}/doc/%{name}

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

%files
%defattr(-,root,root)
%doc AUTHORS COPYING INFO NEWS README.md THANKS documentation.html
%{_bindir}/*
%{_datadir}/applications/qphotorec.desktop
%{_datadir}/icons/hicolor/48x48/apps/qphotorec.png
%{_datadir}/icons/hicolor/scalable/apps/qphotorec.svg
%doc %{_mandir}/man8/*
%doc %{_mandir}/zh_CN/man8/*

%changelog
openSUSE Build Service is sponsored by