1
0
mirror of synced 2024-12-14 08:42:54 +01:00
ImHex/dist/rpm/imhex.spec
iTrooz_ e816b67472
build: Fix various issues for upstream Fedora compatibility (#642)
* cmake: use GNUInstallDirs to find install dirs on Linux

* install plugins to lib/imhex/plugins

* fix included files in imhex.spec

* fix the release CI + do not upload x86_64 folder for Fedora

* change rpm names

* added IMHEX_STRIP_RELEASE option to optionally strip releases files (was done all the time before)

* Customize our imhex.spec file (use online building for our Fedora package)

* added IMHEX_PLUGINS_IN_SHARE option for AppImage

* test
2022-08-04 20:37:57 +02:00

89 lines
2.5 KiB
RPMSpec

# ftbfs without this
%global _lto_cflags %{nil}
Name: ImHex
Version: %{_version}
Release: 0%{?dist}
Summary: A hex editor for reverse engineers and programmers
License: GPL-2.0-only
URL: https://imhex.werwolv.net/
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: dbus-devel
BuildRequires: file-devel
BuildRequires: freetype-devel
BuildRequires: fmt-devel
BuildRequires: gcc-c++
BuildRequires: mesa-libGL-devel
BuildRequires: glfw-devel
BuildRequires: json-devel
BuildRequires: libcurl-devel
BuildRequires: llvm-devel
BuildRequires: mbedtls-devel
BuildRequires: python3-devel
%if 0%{?fedora} >= 37
BuildRequires: yara-devel
%endif
%description
ImHex is a Hex Editor, a tool to display, decode and analyze binary data to
reverse engineer their format, extract informations or patch values in them.
What makes ImHex special is that it has many advanced features that can often
only be found in paid applications. Such features are a completely custom binary
template and pattern language to decode and highlight structures in the data, a
graphical node-based data processor to pre-process values before they're
displayed, a disassembler, diffing support, bookmarks and much much more. At the
same time ImHex is completely free and open source under the GPLv2 language.
%prep
# don't use the setup macro since we're pulling from git
cp -r %{_src_path}/* %{_builddir}/
%build
%cmake \
-DCMAKE_BUILD_TYPE=%{_build_type} \
-D USE_SYSTEM_NLOHMANN_JSON=ON \
-D USE_SYSTEM_FMT=ON \
-D USE_SYSTEM_CURL=ON \
-D USE_SYSTEM_LLVM=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D IMHEX_PATTERNS_PULL_MASTER=ON \
%if 0%{?fedora} >= 37
-D USE_SYSTEM_YARA=ON \
# if fedora <= 36 get updated to yara 4.2.x then they should \
# be able to build against system libs \
# https://bugzilla.redhat.com/show_bug.cgi?id=2112508 \
%endif
# when capstone >= 5.x is released we should be able to build against \
# system libs of it \
# -D USE_SYSTEM_CAPSTONE=ON
%cmake_build
%install
%cmake_install
desktop-file-validate %{buildroot}%{_datadir}/applications/imhex.desktop
%files
%dir %{_datadir}/licenses/imhex
%license %{_datadir}/licenses/imhex/LICENSE
%doc README.md
%{_bindir}/imhex
%dir %{_datadir}/imhex
%{_datadir}/imhex/*
%{_datadir}/pixmaps/imhex.png
%{_datadir}/applications/imhex.desktop
%{_prefix}/lib64/libimhex.so.%{_version}
%{_prefix}/lib64/imhex/plugins/*
%changelog