File detect-it-easy.spec of Package detect-it-easy

#
# spec file for package detect-it-easy
#
# Copyright (c) 2022, Martin Hauke <mardnh@gmx.de>
#
# 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 https://bugs.opensuse.org/
#

Name:           detect-it-easy
Version:        3.07+git20221118
Release:        0
Summary:        Detect It Easy is a program for determining types of files
License:        MIT
Group:          Development/Tools/Other
URL:            https://horsicq.github.io/
#Git-Clone:     https://github.com/horsicq/DIE-engine.git
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Script)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Widgets)
# 3rd-party
Provides:       bundled(XArchive)
Provides:       bundled(XCapstone)
Provides:       bundled(XCppfilt)
#
ExclusiveArch:  x86_64
Recommends:     dejavu-fonts

%description
Detect It Easy, or abbreviated "DIE" is a program to analyze files you load into
the application. It detects, among other things, the compiler and linker used,
signatures, and other information about files.

The program has been designed specifically to reveal file signatures and how
they are packed.

DIE exists in three versions:
 * die:  Basic version
 * diel: Lite version
 * diec: Console version

All the three use the same signatures, which are located in the folder "db".

%prep
%setup -q
sed -i 's/\r$//' README.md Detect-It-Easy/changelog.txt
sed -i "s/#VERSION#/1.0/" LINUX/die.desktop

%build
%cmake
%cmake_build

%install
install -Dpm 0755 build/release/die  %{buildroot}%{_bindir}/die
install -Dpm 0755 build/release/diec %{buildroot}%{_bindir}/diec
install -Dpm 0755 build/release/diel %{buildroot}%{_bindir}/diel

# Install icons and desktop file
for res in 16 24 32 48 256; do
  install -Dpm 0644 LINUX/hicolor/"$res"x"$res"/apps/%{name}.png "%{buildroot}%{_datadir}/icons/hicolor/$res"x"$res/apps/%{name}.png"
done
install -Dpm 0644 LINUX/die.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop

# FIXME: use proper path "/usr/lib/die/" should not be used
install -d %{buildroot}%{_prefix}/lib/die/
cp -Rfv XStyles/qss/           %{buildroot}%{_prefix}/lib/die/
cp -Rfv Detect-It-Easy/info/   %{buildroot}%{_prefix}/lib/die/
cp -Rfv Detect-It-Easy/db/     %{buildroot}%{_prefix}/lib/die/
#
install -d %{buildroot}%{_prefix}/lib/die/signatures
cp -fv signatures/crypto.db    %{buildroot}%{_prefix}/lib/die/signatures/
cp -Rfv images                 %{buildroot}%{_prefix}/lib/die/

%fdupes %{buildroot}%{_prefix}/lib/die/

%files
%license LICENSE
%doc README.md Detect-It-Easy/changelog.txt
%{_bindir}/die
%{_bindir}/diec
%{_bindir}/diel
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_prefix}/lib/die/

%changelog
openSUSE Build Service is sponsored by