File libtorrent.spec of Package libtorrent

#
# spec file for package libtorrent
#
# 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 http://bugs.opensuse.org/
#


%define _buildshell /bin/sh
%define lname	libtorrent25
Name:           libtorrent
Version:        0.15.7
Release:        lp156.1.1
Summary:        A BitTorrent library written in C++
License:        SUSE-GPL-2.0+-with-openssl-exception
Group:          Productivity/Networking/File-Sharing
URL:            https://github.com/rakshasa/libtorrent
Source:         https://github.com/rakshasa/rtorrent/releases/download/v%version/libtorrent-%version.tar.gz
BuildRequires:  automake
%if 0%{?suse_version} && 0%{?suse_version} < 1600
BuildRequires:  gcc13-c++
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  libtool
BuildRequires:  pkgconfig(cppunit)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  zlib-devel

%description
LibTorrent is a BitTorrent library written in C++. It transfers
directly from file pages to the network stack, and achieves 3x higher
seed speeds than the official client on high-bandwidth links.

%package -n %lname
Summary:        A BitTorrent library written in C++
Group:          System/Libraries

%description -n %lname
LibTorrent is a BitTorrent library written in C++. It transfers
directly from file pages to the network stack, and achieves 3x higher
seed speeds than the official client on high-bandwidth links.

%package devel
Summary:        Development files for libtorrent, a C++ BitTorrent library
Group:          Development/Libraries/C and C++
Requires:       %lname = %version

%description devel
LibTorrent is a BitTorrent library written in C++. It transfers
directly from file pages to the network stack, and achieves 3x higher
seed speeds than the official client on high-bandwidth links.

%prep
%autosetup -p1

%build
%if 0%{?suse_version} && 0%{?suse_version} < 1600
export CXX=g++-13
%endif
export CFLAGS="%optflags -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS"
autoreconf -fiv
%configure --enable-ipv6 --with-posix-fallocate
%make_build

%install
%make_install
find "%buildroot" -type f -name "*.la" -delete

%ldconfig_scriptlets -n %lname

%files -n %lname
%_libdir/libtorrent.so.*

%files devel
%_includedir/torrent/
%_libdir/libtorrent.so
%_libdir/pkgconfig/libtorrent.pc

%changelog
* Sun Oct  5 2025 Pavel A. Yakovlev
- Update to release 0.15.7
* Sun Jun 22 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15.5
  * Ignore invalid completed chunks value when encountering such.
* Mon Jun  2 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15.4
  * Threads were not rejoined, which has been fixed
  * Moved TrackerList and TrackerController out of the public API
  * Use poll interrupting callbacks for SCGI requests
  * Updated ThrottleList to use new Scheduler
* Fri May  2 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15.3
  * Fixed slow SCGI replies
  * Cleaned up thread/scheduler code
- Delete 0001-0.15.2-Missing-header-algorithm.patch
  0002-Fixed-DhtController-m_router-check-and-log-unit-test.patch
  (merged)
* Fri Mar 28 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15.2
  * preparation for multi-threaded trackers
  * added a thread-safe DNS resolver
- Add 0001-0.15.2-Missing-header-algorithm.patch,
  0002-Fixed-DhtController-m_router-check-and-log-unit-test.patch
* Thu Jan  2 2025 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15.1
  * Resolved a crash with Handshake buffer resizing
  * Respect failure intervals for trackers
  * Fix file truncation on resume with fallocate enabled
* Thu Dec 26 2024 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.15
  * Resolved a crash with Handshake buffer resizing.
  * Respect failure intervals for trackers.
  * Fix file truncation on resume with fallocate enabled.
* Sun Sep 29 2024 Jan Engelhardt <jengelh@inai.de>
- Update to release 0.14.0
  * Significant performance improvements to improve throughput and
    reduce CPU usage.
  * A fix for a torrent client crash with the socket address object.
  * Support for 33 Gbit/s throttles on ruTorrent.
* Fri Sep  4 2020 Jan Engelhardt <jengelh@inai.de>
- Remove outdated specfile constructs.
* Wed Jul 24 2019 hiwatari.seiji@gmail.com
- Update to 0.13.8
  * Close log files when reusing a name. (pyroscope)
  * Increased max timeout for tracker requests.
  * Set max piece size 512mb.
  * Switch to C++11 MRT RNG for random bytes. (lps-rocks)
  * Added support for openssl 1.1.
  * Fix honoring throttle.min_peers* settings in rtorrent. (chros)
  * Improved failed tracker bencode parsing. (chros)
  * Added example rtorrent.rc. (g0tmi1k)
  * Added a temporary name filter. (Toff)
  * Added 'log.close' command.
  * Added 'd.tracker_announce.force' command.
  * Added 'event.system.startup_done/shutdown' commands/events. (chros)
  * Added 'd.custom.if_z' command. (pyroscope)
  * Added 'd.multicall.filtered' command. (pyroscope)
  * Added 'event.view.hide/show' commands. (pyroscope)
- Update to 0.13.7
  * Fixed ip filter memory usage. (sallyswiss/chros73)
  * Add space to fmt str in log_gz_file_write. (pastly)
  * Fix compilation issue with gcc v6.x and empty CXXFLAGS. (chros73)
  * Fix BEP7 compatibility with IPv6 trackers and IPv4 peers.
  * Include SCGI/XMLRPC example in rtorrent.rc. (ss23)
  * Handle SIGHUP like SIGINT. (pyroscope)
  * Fix Throttle args. (chros73)
  * Fix missing ranlib - not defined but used. (duraki)
  * Fix no // are at start of expanded paths. (pyroscope)
  * Fix ncurses header include. (theirix)
  * Fix segfault when viewing a magnet download in the leeching view. (slingamn)
* Mon Dec 11 2017 jengelh@inai.de
- Update to new snapshot 0.13.6.g126
  * OpenSSL 1.1 support
  * Some support for IPv6 binds
* Tue Jun  6 2017 jengelh@inai.de
- Update to new snapshot 0.13.6.g72
  * IPv6 support
  * Send correct network-ordered port number in PEX messages.
  * Support for DHT logging.
  * Fix BEP7 compatibility with IPv6 trackers and IPv4 peers.
- Remove cppunit.diff (no longer needed)
* Wed May  3 2017 jengelh@inai.de
- Add cppunit.diff to support newer cppunit
* Sun Nov 15 2015 mpluskal@suse.com
- Remove unneeded options/dependencies (xmlrpc)
  * all support is done in rtorrent
* Fri Nov 13 2015 tampakrap@opensuse.org
- Update to new upstream release 0.13.6
  * Added check for failed DH_compute_key, throwing
  e_handshake_invalid_encryption
- Moved fully to github, change URL and Source accordingly
* Sat Jul 19 2014 jengelh@inai.de
- Update to new upstream release 0.13.4
  * Don't start requesting more peers if connected to PEX-enabled
  peers.
  * Added exception for if the transfer list isn't empty at dtor.
  * Added special handling of peers that do choke+unchoke before
  transfering pieces.
* Fri Feb  8 2013 jengelh@inai.de
- Update to new upstream release 0.13.3
  * No changelog provided
  * Required by rtorrent-0.9.3
- Use more robust make install call
- Build with -fno-strict-aliasing because the code is scaredly
  full of type punning dereferences (reflected in the build log).
- Remove libtorrent-decls.diff, libtorrent-gcc4.3-0.12.2.patch:
  issues resolved upstream
* Wed Mar  7 2012 cfarrell@suse.com
- license update: SUSE-GPL-2.0+-with-openssl-exception
  Package allows linking against openSSL. Use the SUSE- proprietary prefix
  until upstream spdx.org accepts the linking exception
* Tue Feb 21 2012 jengelh@medozas.de
- Run format_spec_file to please the automatic factory
  pre-checkin checker scripts
* Tue Jan 31 2012 jengelh@medozas.de
- Remove redundant tags/sections per specfile guideline suggestions
- Parallel building using %%_smp_mflags
- New patch libtorrent-decls.diff: add missing includes to
  fix build errors
* Sat May  9 2009 bitshuffler#suse@irc.freenode.org
- Initial RPM
openSUSE Build Service is sponsored by