%global sover 3 %bcond_without python %bcond_without c %bcond_with check %global forgeurl https://github.com/savoirfairelinux/opendht Version: 3.6.0 %forgemeta Name: opendht Release: %autorelease Summary: A C++17 Distributed Hash Table implementation License: GPL-3.0-only URL: %{forgeurl} Source0: %{forgesource} #Patch0: opendht-cmake.patch BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: ninja-build BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(nettle) BuildRequires: pkgconfig(libargon2) BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(simdutf) BuildRequires: pkgconfig(fmt) BuildRequires: pkgconfig(readline) BuildRequires: pkgconfig(asio) BuildRequires: pkgconfig(libllhttp) BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(msgpack) # testing BuildRequires: pkgconfig(cppunit) %description OpenDHT is a lightweight C++17 Distributed Hash Table implementation. OpenDHT provides an easy to use distributed in-memory data store. Every node in the network can read and write values to the store. Values are distributed over the network, with redundancy. - Lightweight and scalable, designed for large networks and small devices - High resilience to network disruption - Public key cryptography layer providing optional data signature and encryption (using GnuTLS) - IPv4 and IPv6 support - Clean and powerful C++17 map API - Bindings for C, Rust & Python 3 - REST API with optional HTTP client+server with push notification support %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %if %{with python} %package python3 Summary: Python 3 bindings for the %{name} BuildRequires: python3-devel Requires: %{name}%{?_isa} = %{version}-%{release} %description python3 The python3-%{name} package contains Python bindings for %{name}. %endif %if %{with c} %package c Summary: C bindings for the %{name} %description c The %{name}-c package contains Python bindings for %{name}. %package c-devel Summary: Development files for %{name}-c Requires: %{name}-c%{?_isa} = %{version}-%{release} %description c-devel The %{name}-c-devel package contains libraries and header files for developing applications that use %{name}. %endif %package tools Summary: Tools for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description tools The %{name}-tools package contains tools about %{name}. %prep %forgeautosetup -p1 pushd python export OPENDHT_INCLUDE_DIR=../include export OPENDHT_LIBRARY_DIR=../redhat-linux-build echo $(pwd) %pyproject_buildrequires popd %build %cmake \ -GNinja \ -DOPENDHT_SYSTEMD=ON \ -DOPENDHT_SYSTEMD_UNIT_FILE_LOCATION=%{_unitdir} \ -DOPENDHT_INDEX=ON \ -DOPENDHT_PUSH_NOTIFICATIONS=ON \ -DOPENDHT_TESTS_NETWORK=OFF \ %if %{with python} -DOPENDHT_PYTHON=ON \ %endif %if %{with c} -DOPENDHT_C=ON \ %endif %cmake_build pushd python %pyproject_wheel popd %install %cmake_install pushd python %pyproject_install %pyproject_save_files opendht popd %if %{with check} %check %ctest %endif %files %license COPYING %doc README.md %{_libdir}/libopendht.so.%{sover}* %files devel %{_libdir}/libopendht.so %{_includedir}/opendht.h %{_includedir}/opendht/ %{_libdir}/pkgconfig/opendht.pc %dir %{_libdir}/cmake/opendht %{_libdir}/cmake/opendht/*.cmake %{_datadir}/doc/opendht/ %if %{with python} %files python3 %{python3_sitearch}/opendht-%{version}-py%{python3_version}.egg-info/ %{python3_sitearch}/opendht*.so %endif %if %{with c} %files c %{_libdir}/libopendht-c.so.%{sover}* %files c-devel %{_libdir}/pkgconfig/opendht-c.pc %{_libdir}/libopendht-c.so %endif %files tools %config(noreplace) %{_sysconfdir}/dhtcluster.conf %config(noreplace) %{_sysconfdir}/dhtnode.conf %{_bindir}/dhtchat %{_bindir}/dhtnode %{_bindir}/dhtscanner %{_bindir}/dhtcluster %{_unitdir}/dhtcluster.service %{_unitdir}/dhtnode.service %{_mandir}/man1/dhtnode.1.gz %changelog %autochangelog