File libtorrent-rasterbar-custom.spec of Package libtorrent-rasterbar-custom
#
# spec file for package qbittorrent
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _name libtorrent
%define source_name libtorrent-rasterbar
%define libver 2_0
%define sover 2.0
Name: libtorrent-rasterbar-custom
Version: 2.0.11
Release: 0
Summary: Efficient feature-complete C++ BitTorrent implementation
License: BSD-2-Clause
URL: https://www.libtorrent.org/
Source0: https://github.com/arvidn/libtorrent/releases/download/v%{version}/%{source_name}-%{version}.tar.gz
# For SUSE / FEDORA / MAGEIA
%if 0%{?suse_version} && 0%{?is_opensuse} || 0%{?sle_version} && 0%{?is_opensuse} || 0%{?fedora} || 0%{?mageia}
BuildRequires: cmake
BuildRequires: cmake(Boost) => 1.89.0 boost-custom-devel => 1.89.0
BuildRequires: gcc gcc-c++ glibc glibc-devel
BuildRequires: (ninja or ninja-build)
BuildRequires: pkgconfig
BuildRequires: pkgconfig(openssl) => 3.6.0 openssl-custom-devel => 3.6.0
# For SUSE Leap 15.6 Only
%if 0%{?sle_version} == 150600 && 0%{?is_opensuse}
BuildRequires: gcc13 libstdc++6-devel-gcc13
%endif
#
# For SUSE TumbleWeed Only
%if 0%{?suse_version} > 1600
BuildRequires: gcc-devel
%endif
#
# For FEDORA Only
%if 0%{?fedora}
BuildRequires: gcc-plugin-devel
%endif
%endif
#
# For DebBuild only:
%if "%{_vendor}" == "debbuild"
BuildRequires: boost-custom-devel
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: ninja-build
BuildRequires: openssl
%endif
#
Requires: %{source_name}%{libver}
Recommends: (python3-libtorrent-rasterbar or rb_libtorrent-python3)
Provides: %{source_name}%{libver} = %{version}
Provides: %{source_name}%{sover}t64 = %{version}
Provides: %{name}%{libver} = %{version}
Provides: %{source_name} = %{version}
Provides: rb_%{_name} = %{version}
Conflicts: %{source_name} rb_%{_name} %{source_name}%{libver}
Conflicts: %{source_name}%{sover} %{source_name}%{sover}t64
Obsoletes: %{source_name} < %{version}
Obsoletes: rb_%{_name} < %{version}
Obsoletes: %{source_name}%{libver} < %{version}
Obsoletes: %{source_name}%{sover}t64 < %{version}
%description
LibTorrent Rasterbar is a high-performance,
feature-rich C++ library implementing the BitTorrent protocol,
along with support for the most popular protocol extensions.
Designed for both real-world deployments and embedded systems,
LibTorrent Rasterbar provides a
flexible and efficient solution for peer-to-peer file distribution.
The library is highly configurable and can be integrated into
both client and server applications.
Its main goals are efficiency, scalability, and ease of use.
LibTorrent Rasterbarr includes advanced features such as
DHT (Distributed Hash Table), uTP (Micro Transport Protocol),
support for magnet links, IPv6, and robust extension mechanisms.
With a comprehensive API and thorough documentation,
LibTorrent Rasterbar enables developers to build modern BitTorrent
applications with minimal effort while maintaining optimal
resource usage and performance.
%package -n %{source_name}%{libver}
Summary: Efficient feature-complete C++ BitTorrent implementation; Library version 2_0
Provides: %{name} %{source_name}
%description -n %{source_name}%{libver}
LibTorrent Rasterbar is a high-performance,
feature-rich C++ library implementing the BitTorrent protocol,
along with support for the most popular protocol extensions.
Designed for both real-world deployments and embedded systems,
LibTorrent Rasterbar provides a
flexible and efficient solution for peer-to-peer file distribution.
The library is highly configurable and can be integrated into
both client and server applications.
Its main goals are efficiency, scalability, and ease of use.
LibTorrent Rasterbarr includes advanced features such as
DHT (Distributed Hash Table), uTP (Micro Transport Protocol),
support for magnet links, IPv6, and robust extension mechanisms.
With a comprehensive API and thorough documentation,
LibTorrent Rasterbar enables developers to build modern BitTorrent
applications with minimal effort while maintaining optimal
resource usage and performance.
%package devel
Summary: Development files and Headers for LibTorrent Rasterbar
# For SUSE, FEDORA and MAGEIA
%if 0%{?suse_version} && 0%{?is_opensuse} || 0%{?sle_version} && 0%{?is_opensuse} || 0%{?fedora} || 0%{?mageia}
Requires: %{name} = %{version}
Requires: %{source_name} = %{version}
Requires: %{source_name}%{libver} = %{version}
Requires: cmake
Requires: cmake(Boost) => 1.89.0 boost-custom-devel => 1.89.0
Requires: gcc-c++ glibc glibc-devel
Requires: pkgconfig
Requires: pkgconfig(openssl) => 3.6.0 openssl-custom-devel => 3.6.0
%endif
#
# For DebBuild Only
%if "%{_vendor}" == "debbuild"
Requires: %{name}
Requires: %{source_name}%{libver} = %{version}
Requires: boost-custom-devel
Requires: gcc
Requires: openssl
%endif
#
Provides: %{source_name}-dev
Provides: %{source_name}-devel
Provides: rb_%{_name}-devel
Conflicts: %{source_name}-dev
Conflicts: %{source_name}-devel
Conflicts: rb_%{_name}-devel
Obsoletes: %{source_name}-dev < %{version}
Obsoletes: %{source_name}-devel < %{version}
Obsoletes: rb_%{_name}-devel < %{version}
%description devel
Development files such are headers, pkg-config,
CMake files and symlinks for LibTorrent Rasterbar.
%prep
%autosetup -n %{source_name}-%{version}
%build
# Set GCC Version 13 Instead of GCC Version 7 (Default) for SUSE Leap 15.6
%if 0%{?sle_version} == 150600 && 0%{?is_opensuse}
export CC="%{_bindir}/gcc-13"
export CXX="%{_bindir}/g++-13"
%endif
#
%cmake \
-GNinja \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS="ON" \
-Dpython-bindings="OFF"
# For SUSE Only
%if 0%{?suse_version} && 0%{?is_opensuse} || 0%{?sle_version} && 0%{?is_opensuse}
%ninja_build
%endif
#
# For FEDORA Only
%if 0%{?fedora}
%ninja_build -C "redhat-linux-build/"
%endif
#
# For MAGEIA Only
%if 0%{?mageia}
%ninja_build -C "build/"
%endif
#
# For DebBuild Only
%if "%{_vendor}" == "debbuild"
ninja -v -j${RPM_BUILD_NCPUS} -C "build/"
%endif
#
%install
# For SUSE / MAGEIA
%if 0%{?suse_version} && 0%{?is_opensuse} || 0%{?sle_version} && 0%{?is_opensuse} || 0%{?mageia}
%ninja_install -C "build/"
%endif
#
# For FEDORA Only
%if 0%{?fedora}
%ninja_install -C "redhat-linux-build/"
%endif
#
# For DebBuild Only
%if "%{_vendor}" == "debbuild"
DESTDIR=%{buildroot} ninja install -v -j${RPM_BUILD_NCPUS} -C "build/"
%endif
#
%check
# To run tests, uncomment if you have test dependencies
# For SUSE / FEDORA
%if 0%{?suse_version} && 0%{?is_opensuse} || 0%{?sle_version} && 0%{?is_opensuse} || 0%{?fedora}
%ctest
# For MAGEIA / DebBuild
%else
ctest --output-on-failure --force-new-ctest-process -j${RPM_BUILD_NCPUS}
%endif
#
%post -n %{source_name}%{libver}
# Update the dynamic linker cache to reflect the current set of shared libraries installed on the SYSTEM (postin)
ldconfig
#
%postun -n %{source_name}%{libver}
# Update the dynamic linker cache to reflect the current set of shared libraries installed on the SYSTEM (postun)
ldconfig
#
%files -n %{source_name}%{libver}
%license COPYING
%doc ChangeLog "README.rst"
%{_libdir}/%{source_name}.so.*
%files devel
"%{_datadir}/cmake/Modules/FindLibtorrentRasterbar.cmake"
"%{_includedir}/%{_name}/"
"%{_libdir}/%{source_name}.so"
"%{_libdir}/pkgconfig/%{source_name}.pc"
"%{_libdir}/cmake/LibtorrentRasterbar/"
%changelog