0dc2d23
Name:           imhex
ec7a0ff
Version:        1.31.0
ec7a0ff
Release:        1%{?dist}
0dc2d23
Summary:        A hex editor for reverse engineers and programmers
0dc2d23
0dc2d23
License:        GPL-2.0-only AND Zlib AND MIT AND Apache-2.0
ec7a0ff
# imhex is gplv2.  capstone is custom.
0dc2d23
# see license dir for full breakdown
0dc2d23
URL:            https://imhex.werwolv.net/
0dc2d23
# We need the archive with deps bundled
0dc2d23
Source0:        https://github.com/WerWolv/%{name}/releases/download/v%{version}/Full.Sources.tar.gz#/%{name}-%{version}.tar.gz
e76ac7a
# default to including the same-version patterns as a suggested package
e76ac7a
Source1:        https://github.com/WerWolv/ImHex-Patterns/archive/refs/tags/ImHex-v%{version}.tar.gz#/%{name}-patterns-%{version}.tar.gz
0dc2d23
0dc2d23
BuildRequires:  cmake
0dc2d23
BuildRequires:  desktop-file-utils
0dc2d23
BuildRequires:  dbus-devel
0dc2d23
BuildRequires:  file-devel
0dc2d23
BuildRequires:  freetype-devel
0dc2d23
BuildRequires:  fmt-devel
0dc2d23
BuildRequires:  gcc-c++
0dc2d23
BuildRequires:  libappstream-glib
0dc2d23
BuildRequires:  libglvnd-devel
0dc2d23
BuildRequires:  glfw-devel
0dc2d23
BuildRequires:  json-devel
0dc2d23
BuildRequires:  libcurl-devel
ec7a0ff
%if 0%{?fedora} < 39 || 0%{?rhel}
0dc2d23
BuildRequires:  llvm-devel
ec7a0ff
%else
ec7a0ff
BuildRequires:  llvm16-devel
ec7a0ff
%endif
0dc2d23
BuildRequires:  mbedtls-devel
0dc2d23
BuildRequires:  yara-devel
72b1903
BuildRequires:  nativefiledialog-extended-devel
2f51b5b
%if 0%{?rhel}
ec7a0ff
BuildRequires:  gcc-toolset-13
ec7a0ff
%endif
ec7a0ff
%if 0%{?fedora} >= 40
ec7a0ff
BuildRequires:  capstone-devel
0dc2d23
%endif
0dc2d23
e76ac7a
Recommends:     imhex-patterns = %{version}-%{release}
e76ac7a
0dc2d23
Provides:       bundled(gnulib)
ec7a0ff
%if 0%{?fedora} < 40
0dc2d23
Provides:       bundled(capstone) = 5.0-rc2
ec7a0ff
%endif
0dc2d23
Provides:       bundled(imgui)
0dc2d23
Provides:       bundled(libromfs)
0dc2d23
Provides:       bundled(microtar)
0dc2d23
Provides:       bundled(libpl)
9475799
Provides:       bundled(xdgpp)
a9cba8d
# working on packaging this, bundling for now as to now delay updates
a9cba8d
Provides:       bundled(miniaudio) = 0.11.11
0dc2d23
0dc2d23
# ftbfs on these arches.  armv7hl might compile when capstone 5.x
0dc2d23
# is released upstream and we can build against it
0dc2d23
# [7:02 PM] WerWolv: We're not supporting 32 bit anyways soooo
0dc2d23
# [11:38 AM] WerWolv: Officially supported are x86_64 and aarch64
65037ff
ExclusiveArch:  x86_64 %{arm64}
0dc2d23
0dc2d23
%description
0dc2d23
ImHex is a Hex Editor, a tool to display, decode and analyze binary data to
0dc2d23
reverse engineer their format, extract informations or patch values in them.
0dc2d23
0dc2d23
What makes ImHex special is that it has many advanced features that can often
0dc2d23
only be found in paid applications. Such features are a completely custom binary
0dc2d23
template and pattern language to decode and highlight structures in the data, a
0dc2d23
graphical node-based data processor to pre-process values before they're
0dc2d23
displayed, a disassembler, diffing support, bookmarks and much much more. At the
0dc2d23
same time ImHex is completely free and open source under the GPLv2 language.
0dc2d23
0dc2d23
e76ac7a
%package patterns
e76ac7a
Summary:        Hex patterns, include patterns and magic files for the use with the ImHex Hex Editor
e76ac7a
License:        GPL-2.0-only
e76ac7a
Requires:       imhex >= %{version}-%{release}
e76ac7a
%description patterns
e76ac7a
Hex patterns, include patterns and magic files for the use with
e76ac7a
the ImHex Hex Editor
e76ac7a
e76ac7a
0dc2d23
%prep
0dc2d23
%autosetup -n ImHex
0dc2d23
# remove bundled libs we aren't using
0dc2d23
rm -rf lib/external/{curl,fmt,llvm,nlohmann_json,yara}
ec7a0ff
%if 0%{?fedora} >= 40
ec7a0ff
rm -rf lib/external/capstone
ec7a0ff
%endif
0dc2d23
0dc2d23
%build
72b1903
%if 0%{?rhel}
ec7a0ff
. /opt/rh/gcc-toolset-13/enable
72b1903
%set_build_flags
72b1903
CXXFLAGS+=" -std=gnu++2b"
72b1903
%endif
0dc2d23
%cmake \
0dc2d23
 -D CMAKE_BUILD_TYPE=Release             \
0dc2d23
 -D IMHEX_STRIP_RELEASE=OFF              \
0dc2d23
 -D IMHEX_OFFLINE_BUILD=ON               \
0dc2d23
 -D USE_SYSTEM_NLOHMANN_JSON=ON          \
0dc2d23
 -D USE_SYSTEM_FMT=ON                    \
0dc2d23
 -D USE_SYSTEM_CURL=ON                   \
0dc2d23
 -D USE_SYSTEM_LLVM=ON                   \
ec7a0ff
%if 0%{?fedora >= 39}
a58012a
 -D LLVM_ROOT=%{_libdir}/llvm16/lib/cmake/llvm/ \
ec7a0ff
%endif
0dc2d23
 -D USE_SYSTEM_YARA=ON                   \
72b1903
 -D USE_SYSTEM_NFD=ON                    \
ec7a0ff
%if 0%{?fedora} >= 40
ec7a0ff
 -D USE_SYSTEM_CAPSTONE=ON
ec7a0ff
%endif
0dc2d23
0dc2d23
%cmake_build
0dc2d23
0dc2d23
0dc2d23
%check
0dc2d23
# build binaries required for tests
0dc2d23
%cmake_build --target unit_tests
0dc2d23
%ctest --exclude-regex '(Helpers/StoreAPI|Helpers/TipsAPI|Helpers/ContentAPI)'
0dc2d23
# Helpers/*API exclude tests that require network access
0dc2d23
0dc2d23
0dc2d23
%install
0dc2d23
%cmake_install
0dc2d23
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
0dc2d23
Jonathan d40f747
# this is a symlink for the old appdata name that we don't need
Jonathan d40f747
rm -f %{buildroot}%{_metainfodir}/net.werwolv.%{name}.appdata.xml
Jonathan d40f747
0dc2d23
# AppData
Jonathan d40f747
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
0dc2d23
0dc2d23
# install licenses
ec7a0ff
%if ! 0%{?fedora} >= 40
0dc2d23
cp -a lib/external/capstone/LICENSE.TXT                           %{buildroot}%{_datadir}/licenses/%{name}/capstone-LICENSE
0dc2d23
cp -a lib/external/capstone/suite/regress/LICENSE                 %{buildroot}%{_datadir}/licenses/%{name}/capstone-regress-LICENSE
ec7a0ff
%endif
0dc2d23
cp -a lib/external/microtar/LICENSE                               %{buildroot}%{_datadir}/licenses/%{name}/microtar-LICENSE
0dc2d23
cp -a lib/external/xdgpp/LICENSE                                  %{buildroot}%{_datadir}/licenses/%{name}/xdgpp-LICENSE
0dc2d23
e76ac7a
# install patterns
1cc6b22
/usr/bin/tar -xf %{SOURCE1}
e76ac7a
mkdir %{buildroot}%{_datadir}/imhex
e76ac7a
for i in constants encodings includes magic nodes patterns plugins scripts tests themes tips yara;
e76ac7a
do
e76ac7a
    cp -ra ImHex-Patterns-ImHex-v%{version}/$i %{buildroot}%{_datadir}/imhex/$i
e76ac7a
done
0dc2d23
0dc2d23
%files
0dc2d23
%license %{_datadir}/licenses/%{name}/
0dc2d23
%doc README.md
0dc2d23
%{_bindir}/imhex
0dc2d23
%{_datadir}/pixmaps/%{name}.png
0dc2d23
%{_datadir}/applications/%{name}.desktop
0dc2d23
%{_libdir}/libimhex.so*
0dc2d23
%{_libdir}/%{name}/
Jonathan d40f747
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
0dc2d23
0dc2d23
e76ac7a
%files patterns
e76ac7a
%license ImHex-Patterns-ImHex-v%{version}/LICENSE
e76ac7a
%{_datadir}/imhex/*
e76ac7a
e76ac7a
0dc2d23
%changelog
ec7a0ff
* Thu Nov 30 2023 Jonathan Wright <jonathan@almalinux.org> - 1.31.0-1
ec7a0ff
- Build fedora 40+ against system capstone
ec7a0ff
- Build fedora 39+ with llvm16-devel (compat package) rhbz#2246094
ec7a0ff
- Build EPEL9 with GCC 13
ec7a0ff
- update to 1.31.0 rhbz#2217232
ec7a0ff
342e5ec
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.30.1-5
342e5ec
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
342e5ec
1cc6b22
* Mon Jul 03 2023 Jonathan Wright <jonathan@almalinux.org> - 1.30.1-4
1cc6b22
- Use tar to uncompress source1 - rhel9 does not have rpmuncompress
1cc6b22
e76ac7a
* Mon Jul 03 2023 Jonathan Wright <jonathan@almalinux.org> - 1.30.1-3
e76ac7a
- Create imhex-patterns subpackage rhbz#2219447
e76ac7a
a1e4225
* Wed Jun 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 1.30.1-2
a1e4225
- Rebuilt due to fmt 10 update.
a1e4225
f451a4f
* Mon Jun 26 2023 Jonathan Wright <jonathan@almalinux.org> - 1.30.1-1
876bc0a
- update to 1.30.1 rhbz#2217232
876bc0a
7581723
* Mon May 22 2023 Jonathan Wright <jonathan@almalinux.org> - 1.29.0-1
7581723
- update to 1.29.0 rhbz#2208884
7581723
8764a91
* Thu Apr 13 2023 Jonathan Wright <jonathan@almalinux.org> - 1.28.0-2
8764a91
- rebuild to fix FTI on f37 related to libyara
8764a91
a9cba8d
* Tue Apr 04 2023 Jonathan Wright <jonathan@almalinux.org> - 1.28.0-1
a9cba8d
- update to 1.28.0 rhbz#2184379
a9cba8d
28ca088
* Fri Mar 31 2023 Jonathan Wright <jonathan@almalinux.org> - 1.27.1-3
28ca088
- rebuild against yara 4.3
28ca088
65037ff
* Thu Feb 16 2023 Jonathan Wright <jonathan@almalinux.org> - 1.27.1-2
65037ff
- stop building on ppc64le
65037ff
15aa172
* Thu Feb 16 2023 Jonathan Wright <jonathan@almalinux.org> - 1.27.1-1
15aa172
- update to 1.27.1 rhbz#2170425
15aa172
8cbb55c
* Sun Feb 12 2023 Jonathan Wright <jonathan@almalinux.org> - 1.27.0-1
8cbb55c
- update to 1.27.0 rhbz#2169215
8cbb55c
046befd
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.2-3
046befd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
046befd
12c32b7
* Mon Jan 16 2023 Jonathan Wright <jonathan@almalinux.org> - 1.26.2-2
12c32b7
- remove unndeeded BR on python3-devel
12c32b7
4c3ad59
* Thu Jan 05 2023 Jonathan Wright <jonathan@almalinux.org> - 1.26.2-1
4c3ad59
- update to 1.26.2 rhbz#2158673
4c3ad59
9475799
* Wed Jan 04 2023 Jonathan Wright <jonathan@almalinux.org> - 1.26.0-1
9475799
- update to 1.26.0 rhbz#2158207
9475799
Jonathan 87592f0
* Tue Nov 15 2022 Jonathan Wright <jonathan@almalinux.org> - 1.25.0-1
Jonathan 87592f0
- update to 1.25.0 rhbz#2142599
Jonathan 87592f0
Jonathan e3eecdb
* Wed Oct 12 2022 Jonathan Wright <jonathan@almalinux.org> - 1.24.3-1
Jonathan e3eecdb
- update to 1.24.3
Jonathan e3eecdb
Jonathan 1a673a4
* Mon Oct 10 2022 Jonathan Wright <jonathan@almalinux.org> - 1.24.2-1
Jonathan 1a673a4
- update to 1.24.2
Jonathan 1a673a4
Jonathan 8cbdc44
* Mon Oct 10 2022 Jonathan Wright <jonathan@almalinux.org> - 1.24.1-1
Jonathan 8cbdc44
- update to 1.24.1
Jonathan 8cbdc44
Jonathan 375cc5c
* Mon Oct 10 2022 Jonathan Wright <jonathan@almalinux.org> - 1.24.0-1
Jonathan 375cc5c
- Update to 1.24.0 rhbz#2133163
Jonathan 375cc5c
Jonathan 3ecbb1a
* Sat Sep 17 2022 Jonathan Wright <jonathan@almalinux.org> - 1.23.2-1
Jonathan 3ecbb1a
- Update to 1.23.2 rhbz#2127614
Jonathan 3ecbb1a
Jonathan d40f747
* Thu Sep 15 2022 Jonathan Wright <jonathan@almalinux.org> - 1.23.0-1
Jonathan d40f747
- Update to 1.23.0 rhbz#2127174
Jonathan d40f747
Jonathan 096f571
* Sun Sep 04 2022 Jonathan Wright <jonathan@almalinux.org> - 1.22.0-1
Jonathan 096f571
- Update to 1.22.0 rhbz#2124107
Jonathan 096f571
0b65d20
* Wed Aug 17 2022 Jonathan Wright <jonathan@almalinux.org> - 1.21.2-2
0b65d20
- Document packaged intervaltree lib
0b65d20
72b1903
* Wed Aug 17 2022 Jonathan Wright <jonathan@almalinux.org> - 1.21.2-1
72b1903
- Update to 1.21.2 (fixes rhbz#2119220)
72b1903
- Use system libnfd (nativefiledialog-extended)
72b1903
- More EPEL spec prep
72b1903
f4c1b9c
* Mon Aug 15 2022 Jonathan Wright <jonathan@almalinux.org> - 1.21.1-1
f4c1b9c
- Update to 1.21.1
f4c1b9c
ceccc98
* Sun Aug 14 2022 Jonathan Wright <jonathan@almalinux.org> - 1.21.0-2
ceccc98
- Updates requires to ensure package needed for file dialogs is present
ceccc98
da6dba7
* Sun Aug 14 2022 Jonathan Wright <jonathan@almalinux.org> - 1.21.0-1
da6dba7
- Update to 1.21.0
da6dba7
2f51b5b
* Fri Aug 12 2022 Jonathan Wright <jonathan@almalinux.org> - 1.20.0-2
2f51b5b
- EPEL9 prep
2f51b5b
- Build on ppc64le
2f51b5b
0dc2d23
* Fri Aug 05 2022 Jonathan Wright <jonathan@almalinux.org> - 1.20.0-1
0dc2d23
- Initial package build