diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 3b9528e6..9cc8f8b2 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -37,6 +37,7 @@ option(WITH_LIBRARY "Build library" ON) option(WITH_BINARY "Build binary" ON) option(WITH_STATIC "Static build" OFF) option(WITH_UPNP "Include support for UPnP client" OFF) +option(WITH_TORRENTS "Include torrent client" ON) option(WITH_GIT_VERSION "Use git commit info as version" OFF) option(WITH_ADDRSANITIZER "Build with address sanitizer unix only" OFF) option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF) @@ -147,6 +148,10 @@ if(WITH_UPNP) add_definitions(-DUSE_UPNP) endif() +if(NOT WITH_TORRENTS) + add_definitions(-DNO_TORRENTS) +endif() + if(WITH_GIT_VERSION) include(GetGitRevisionDescription) git_describe(GIT_VERSION) @@ -302,11 +307,11 @@ endif() if(Boost_json_FOUND AND NOT WITH_STATIC) add_definitions(-DBOOST_JSON_DYN_LINK) -endif() +endif() if(Boost_url_FOUND AND NOT WITH_STATIC) add_definitions(-DBOOST_URL_DYN_LINK) -endif() +endif() find_package(OpenSSL REQUIRED) if(NOT DEFINED OPENSSL_FOUND) diff --git a/contrib/rpm/i2pd-git.spec b/contrib/rpm/i2pd-git.spec index d933e5a2..b4d628f7 100644 --- a/contrib/rpm/i2pd-git.spec +++ b/contrib/rpm/i2pd-git.spec @@ -27,6 +27,14 @@ BuildRequires: systemd-units BuildRequires: openssl-devel-engine %endif +%if 0%{?rhel} <= 9 || 0%{?fedora} <= 43 +BuildRequires: boost-json +%endif + +%if 0%{?fedora} <= 43 +BuildRequires: boost-url +%endif + Requires: logrotate Requires: systemd Requires(pre): %{_sbindir}/useradd %{_sbindir}/groupadd @@ -46,6 +54,9 @@ cd build -DWITH_LIBRARY=OFF \ -DWITH_UPNP=ON \ -DWITH_HARDENING=ON \ +%if 0%{?rhel} <= 9 + -DWITH_TORRENTS=OFF +%endif %if 0%{?fedora} > 29 -DBUILD_SHARED_LIBS:BOOL=OFF \ .