File DIE.spec of Package DIE

#
# spec file for package DIE
#
# Copyright (c) 2022 SUSE LLC
#
# 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:           DIE
Version:        3.05
Release:        0
Summary:        Determine types of files for Windows, Linux and MacOS
# Main code is MIT
# LLVMDemangle is Apache-2.0 with LLVM Exceptions (possibly SUSE-GPL-2.0-with-linking-exception+) ?
# cppfilt is GPL-2.0-or-later
# capstone is BSD-3-Clause
License:        MIT AND Apache-2.0 and GPL-2.0-or-later and BSD-3-Clause
URL:            http://ntinfo.biz/
Source0:        %{name}-%{version}.tar.xz
# PATCH-FEATURE-OPENSUSE DIE-use_system_libs.patch
Patch0:         DIE-use_system_libs.patch
# PATCH-FIX-OPENSUSE DIE-fix_libexec_path.patch
Patch1:         DIE-fix_libexec_path.patch
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5OpenGL)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5Script)
BuildRequires:  cmake(Qt5ScriptTools)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5Sql)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Qwt6)
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(clzma)
BuildRequires:  pkgconfig(zlib)

%description
Detect It Easy, or abbreviated “DIE” is a program for determining types of files.

%prep
%autosetup -p1
dos2unix README.md
###sed -i 's/#VERSION#/1.0/' LINUX/die.desktop
#
sed -i 's|__LIBEXECDIR__|%{_libexecdir}|' XOptions/xoptions.cpp

# /usr/lib/die is hardcoded somewhere, find it

%build
# It should be possible to use system capstone when it reaches 5.0
%cmake
%cmake_build

%install
%cmake_install

# remove odd-sized icons
rm -rf %{buildroot}%{_datadir}/icons/hicolor/20x20

%fdupes %{buildroot}

%files
%license LICENSE XCapstone/3rdparty/Capstone/src/LICENSE.TXT XCapstone/3rdparty/Capstone/src/LICENSE_LLVM.TXT
%doc README.md
%{_bindir}/die*
%{_datadir}/applications//die.desktop
%{_datadir}/icons/hicolor/*/apps/die.png
%{_libdir}/die

%changelog
openSUSE Build Service is sponsored by