## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Python API needs some %bcond python 0 %bcond ctest 0 %global soversion 0 %global forgeurl0 https://github.com/lief-project/LIEF # Picking up a few changes that fix packaging issues %global version0 %{soversion}.16.5 %global date 20250521 %global commit0 dc66460141c7b14a8ac36e9d9478d73badbbc621 %forgemeta Name: lief Version: %forgeversion Release: %autorelease Summary: Library to Instrument Executable Formats # Fails to build on s390x # https://github.com/lief-project/LIEF/issues/1210 ExcludeArch: s390x # Main project is Apache-2.0 # Some bundled CMake files come from Kitware # - cmake/ios.toolchain.cmake SourceLicense: Apache-2.0 AND BSD-3-Clause License: Apache-2.0 URL: https://lief.re Source: %{forgesource0} BuildRequires: cmake BuildRequires: ninja-build BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: json-devel BuildRequires: spdlog-devel BuildRequires: expected-devel BuildRequires: utf8cpp-devel BuildRequires: mbedtls-devel BuildRequires: frozen-devel BuildRequires: span-devel BuildRequires: catch-devel %if %{with python} BuildRequires: python3-devel %endif %global _description %{expand: The purpose of this project is to provide a cross-platform library to parse, modify and abstract ELF, PE and MachO formats.} %description %{_description} %package devel Summary: Development files for lief Requires: lief = %{version}-%{release} %description devel %{_description} This package contains the development files. %if %{with python} %package -n python3-lief Summary: Python API for lief Requires: lief = %{version}-%{release} %description -n python3-lief %{_description} This package contains python API. %endif %prep %forgeautosetup -p1 rm -rf third-party/* %generate_buildrequires %if %{with python} pushd api/python %pyproject_buildrequires popd %endif %conf %cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE:STRING=ALWAYS \ -DLIEF_TESTS:BOOL=OFF \ -DLIEF_EXAMPLES:BOOL=OFF \ -DLIEF_C_API:BOOL=ON \ -DLIEF_PYTHON_API:BOOL=OFF \ -DLIEF_RUST_API:BOOL=OFF \ -DLIEF_SO_VERSION:BOOL=ON \ -DLIEF_LOGGING_DEBUG:BOOL=OFF \ -DLIEF_USE_MELKOR:BOOL=OFF \ -DLIEF_OPT_NLOHMANN_JSON_EXTERNAL:BOOL=ON \ -DLIEF_EXTERNAL_SPDLOG:BOOL=ON \ -DLIEF_OPT_EXTERNAL_EXPECTED:BOOl=ON \ -DLIEF_OPT_UTFCPP_EXTERNAL:BOOL=ON \ -DLIEF_OPT_MBEDTLS_EXTERNAL:BOOL=ON \ -DLIEF_OPT_FROZEN_EXTERNAL:BOOL=ON \ -DLIEF_OPT_EXTERNAL_SPAN:BOOL=ON %build %cmake_build %if %{with python} build_dir=$(pwd)/%_vpath_builddir pushd api/python %{pyproject_wheel %{shrink: -C cmake.build-type=RelWithDebInfo -C cmake.define.LIEF_ROOT=${build_dir} -C cmake.define.LIEF_PY_LIEF_EXT=true -C cmake.define.LIEF_PY_LIEF_EXT_SHARED=true }} popd %endif %install %cmake_install %if %{with python} pushd api/python %pyproject_install %pyproject_save_files -l lief popd %endif %check %if %{with ctest} %ctest %endif %files %license LICENSE %{_libdir}/libLIEF.so.%{soversion} %{_libdir}/libLIEF.so.%{soversion}.* %files devel %{_includedir}/LIEF %{_libdir}/pkgconfig/LIEF.pc %{_libdir}/cmake/LIEF %{_libdir}/libLIEF.so %if %{with python} %files -n python3-lief -f %{pyproject_files} %endif %changelog ## START: Generated by rpmautospec * Wed May 21 2025 John Doe - 0.16.5^20250521gitdc66460-1 - Uncommitted changes ## END: Generated by rpmautospec