%global debug_package %{nil} %{!?dnf_lowest_compatible: %global dnf_lowest_compatible 4.4.3} Name: dnf-plugin-p2p Version: 0.3.7 Release: 1%{?dist} Summary: Peer-to-peer package sharing plugin for libdnf5 License: GPL-2.0-or-later URL: https://github.com/staernid/libdnf-p2p-sharing Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: https://files.pythonhosted.org/packages/fc/21/d5585856169c595d99a596dd8000afae40053f9f5c955d8ec8fb2ec3247c/fastecdsa-2.3.2.tar.gz Source2: https://files.pythonhosted.org/packages/bc/52/5ed393ab49df7e3b03995d3c4e53bae1e8c2ca40909cf25a41b346c09a38/py_multibase-2.0.0.tar.gz Source3: https://files.pythonhosted.org/packages/da/d8/16bf2e958a80a85b2c905c03e412c20ba7ed5911946e2b7050f3b8fa612b/py-multihash-2.0.1.tar.gz Source4: https://files.pythonhosted.org/packages/5e/26/ef24db0fbfec080b72c5ac4a1000da3a4d696a1e31862c695d683097a1b5/py_multicodec-1.0.0.tar.gz Source5: https://files.pythonhosted.org/packages/96/8e/68c2bd0346247570e8e01e8c170a0237884e95cdfa43989527b71adaa978/py_cid-0.5.0.tar.gz Source6: https://files.pythonhosted.org/packages/b5/74/a87aafa40ec3a37089148b859892cbe2eef08d132c816d58a60459be5337/trio-typing-0.10.0.tar.gz Source7: https://files.pythonhosted.org/packages/39/5b/99ee4dd6080d857f029ad209860d461305f5fba9fef2316548a1d131e4c2/rpcudp-5.0.1.tar.gz Source8: https://github.com/libp2p/py-libp2p/archive/e11ec4c173028af04637dc499de6521b6704253f/libp2p-0.6.0.tar.gz Source9: https://files.pythonhosted.org/packages/source/p/pycryptodome/pycryptodome-3.20.0.tar.gz Source11: https://files.pythonhosted.org/packages/0a/21/a1b12adc1c63541f9216a753d85c0da4536597ef3d48ccdb6cecde56cebf/multiaddr-0.0.11.tar.gz Source12: https://files.pythonhosted.org/packages/ce/b6/6fa6b3b598a03cba5e80f829e0dadbb49d7645f523d209b2fb7ea0bbb02a/async_generator-1.10.tar.gz # Patches for bundled py-libp2p (applied during %install, not %prep) # See patches/0001-fix-peerstore-crash-on-expired-peer-gc.patch for details Source10: 0001-fix-peerstore-crash-on-expired-peer-gc.patch BuildRequires: cmake >= 3.5.0 BuildRequires: python3-sphinx BuildRequires: python3-devel BuildRequires: python3-pip BuildRequires: python3-wheel BuildRequires: python3-setuptools BuildRequires: python3-hatchling BuildRequires: gcc BuildRequires: gmp-devel BuildRequires: systemd-rpm-macros Requires: python3-libdnf5-python-plugins-loader Requires: python3-%{name}-common = %{version}-%{release} Requires: %{name}-proxy = %{version}-%{release} Provides: dnf5-plugin-p2p = %{version}-%{release} Provides: libdnf5-plugin-p2p-sharing = %{version}-%{release} Provides: python3-libdnf5-plugin-p2p-sharing = %{version}-%{release} Obsoletes: libdnf5-plugin-p2p-sharing < %{version}-%{release} Obsoletes: python3-libdnf5-plugin-p2p-sharing < %{version}-%{release} %description Peer-to-peer package sharing plugin for libdnf5. %package -n python3-%{name}-common Summary: Common Python modules for dnf-plugin-p2p BuildArch: noarch Provides: python3-libdnf-p2p-sharing-common = %{version}-%{release} Obsoletes: python3-libdnf-p2p-sharing-common < %{version}-%{release} %description -n python3-%{name}-common This package contains the shared Python modules used by the libdnf5 P2P plugin and the P2P proxy server. %package proxy Summary: P2P proxy server daemon for dnf-plugin-p2p Requires: python3-trio Requires: python3-dns Requires: python3-aioquic Requires: python3-anyio Requires: python3-base58 Requires: python3-cbor2 Requires: python3-coincurve Requires: python3-noiseprotocol Requires: python3-protobuf Requires: python3-pynacl Requires: python3-requests Requires: python3-zeroconf Requires: python3-trio-websocket Requires: python3-morphys Requires: python3-lru-dict Requires: python3-varint Requires: python3-netaddr Requires: python3-typing-extensions Requires: python3-baseconv Requires: python3-httpx Requires: python3-psutil Requires: python3-miniupnpc %{?sysusers_requires_compat} Provides: bundled(python3dist(fastecdsa)) = 2.3.2 Provides: bundled(python3dist(py-multibase)) = 2.0.0 Provides: bundled(python3dist(py-multihash)) = 2.0.1 Provides: bundled(python3dist(py-multicodec)) = 1.0.0 Provides: bundled(python3dist(py-cid)) = 0.5.0 Provides: bundled(python3dist(trio-typing)) = 0.10.0 Provides: bundled(python3dist(rpcudp)) = 5.0.1 Provides: bundled(python3dist(libp2p)) = 0.6.0 Provides: bundled(python3dist(pycryptodome)) = 3.20.0 Provides: bundled(python3dist(multiaddr)) = 0.0.11 Provides: bundled(python3dist(async_generator)) = 1.10 Provides: libdnf-p2p-sharing-proxy = %{version}-%{release} Obsoletes: libdnf-p2p-sharing-proxy < %{version}-%{release} %description proxy This package contains the local P2P proxy server daemon. %prep %autosetup %build %cmake %cmake_build %install %cmake_install # Install bundled python dependencies directly into the libexec plugin folder # This pulls the pre-downloaded PyPI tarballs from %{_sourcedir} python3 -m pip install \ --no-index \ --find-links=%{_sourcedir} \ --target=%{buildroot}%{_libexecdir}/%{name} \ --no-build-isolation \ --no-deps \ fastecdsa py-multibase py-multihash py-multicodec py-cid trio-typing rpcudp libp2p pycryptodome multiaddr async_generator # Apply patches to bundled py-libp2p after pip install pushd %{buildroot}%{_libexecdir}/%{name} patch -p1 --no-backup-if-mismatch < %{SOURCE10} popd # Remove demo and entrypoint executables installed by bundled packages into bin/ rm -rf %{buildroot}%{_libexecdir}/%{name}/bin mkdir -p %{buildroot}%{_localstatedir}/cache/dnf-plugin-p2p %files %config(noreplace) %{_sysconfdir}/dnf/libdnf5-plugins/python_plugins_loader.d/p2p_plugin.conf %{_sysconfdir}/profile.d/libdnf-python-plugin.sh %{_sysconfdir}/environment.d/libdnf-python-plugin.conf %{python3_sitelib}/libdnf_plugins/p2p_plugin.py %{python3_sitelib}/libdnf_plugins/__pycache__/p2p_plugin*.pyc %files -n python3-%{name}-common %{python3_sitelib}/libdnf_p2p_sharing/ %files proxy %{_bindir}/dnf-p2p-client %{_libexecdir}/%{name}/ %{_unitdir}/dnf-p2p-proxy.service %{_sysusersdir}/dnf-p2p.conf %{_datadir}/selinux/packages/%{name}/ %dir %attr(0755, dnf-p2p, dnf-p2p) %{_localstatedir}/cache/dnf-plugin-p2p %pre proxy %sysusers_create_compat systemd/sysusers.d/dnf-p2p.conf %post proxy %systemd_post dnf-p2p-proxy.service # Fix ownership of existing cache directory and files if upgrading/installing if [ -d %{_localstatedir}/cache/dnf-plugin-p2p ]; then chown -R dnf-p2p:dnf-p2p %{_localstatedir}/cache/dnf-plugin-p2p || : if [ -x /usr/sbin/restorecon ]; then /usr/sbin/restorecon -R %{_localstatedir}/cache/dnf-plugin-p2p || : fi fi %preun proxy %systemd_preun dnf-p2p-proxy.service %postun proxy %systemd_postun_with_restart dnf-p2p-proxy.service %changelog * Fri Oct 02 2026 dnf-plugin-p2p contributors - 0.3.7-1 - Fix proxy host binding to 0.0.0.0 and prioritize physical LAN subnets over Tailscale - Fix py-libp2p peerstore self-eviction on host key expiration - Automatically migrate legacy nested cache packages to active cache directory - Optimize cache hit checks using in-memory index to eliminate disk hashing latency - Stream large P2P package transfers directly to DNF to eliminate progress bar stalls * Thu Oct 01 2026 dnf-plugin-p2p contributors - 0.3.6-1 - Release 0.3.6 * Wed Sep 30 2026 dnf-plugin-p2p contributors - 0.3.5-1 - Release 0.3.5 * Sat Jul 04 2026 dnf-plugin-p2p contributors - 0.3.4-1 - Release 0.3.4 * Sun Jun 21 2026 dnf-plugin-p2p contributors - 0.3.3-1 - Release 0.3.3 * Sun Jun 21 2026 dnf-plugin-p2p contributors - 0.3.2-1 - Release 0.3.2 * Sun Jun 21 2026 dnf-plugin-p2p contributors - 0.3.1-1 - Release 0.3.1 * Sun Jun 21 2026 dnf-plugin-p2p contributors - 0.3.0-1 - Release 0.3.0 * Fri Jun 19 2026 dnf-plugin-p2p contributors - 0.2.1-1 - Release 0.2.1 * Fri Jun 19 2026 dnf-plugin-p2p contributors - 0.2.0-1 - Release 0.2.0 * Fri Jun 19 2026 dnf-plugin-p2p contributors - 0.1.0-2 - Rework into working state * Fri Jun 19 2026 dnf-plugin-p2p contributors - 0.1.0-1 - Rename package to dnf-plugin-p2p and align subpackages, files, and paths.