Package: libtorrent21-shlibs
# v0.14 is libN=22
Version: 0.13.8
Revision: 1
License: GPL/OpenSSL
HomePage: https://rakshasa.github.io/rtorrent/
Description: Bittorrent library
Maintainer: David Fang <fangism@users.sourceforge.net>

Depends: openssl110-shlibs
BuildDepends: <<
	autoconf2.6,
	automake1.15,
	fink (>= 0.30.0),
	fink-package-precedence,
	libtool2,
	openssl110-dev,
	pkgconfig
<<

Source: https://github.com/rakshasa/rtorrent-archive/raw/master/libtorrent-%v.tar.gz
Source-Checksum: SHA256(ed115a28f4ae8cfcd33b94a597c076ca74fd549867a26e4fac9505c27288e983)


PatchScript: <<
	# harden the build
	perl -pi -e 's/(-version-info)/-no-undefined \1/' src/Makefile.am

	autoreconf -vfi
<<

GCC: 4.0
SetCXXFLAGS: -std=c++11 -g -O2

ConfigureParams: <<
	--with-kqueue
<<
CompileScript: <<
	%{default_script}
	fink-package-precedence --prohibit-bdep=%n .
<<

### Currently failing to compile on std::array.assign calls...
### I think we should replace with std::fill.

# tests currently fail linking
InfoTest: <<
	TestConfigureParams: LIBS=-lz
	TestDepends: cppunit1.15.1
	TestScript: make -k check || exit 2
<<
Shlibs: %p/lib/libtorrent.21.dylib 22.0.0 %n (>= 0.13.6-1)

DocFiles: <<
	AUTHORS
	COPYING
	ChangeLog
	NEWS
	README
<<

SplitOff: << 
	Package: libtorrent21
	Depends: %N (= %v-%r)
	BuildDependsOnly: true
	Conflicts: libtorrent15, libtorrent19, libtorrent20, libtorrent21
	Replaces: libtorrent15, libtorrent19, libtorrent20, libtorrent21
	Files: <<
		include
		lib/libtorrent.{la,dylib}
		lib/pkgconfig
	<<
	DocFiles: <<
		AUTHORS
		COPYING
		ChangeLog
		NEWS
		README
	<<
<<

DescPackaging: <<
Library version info and name change inconsistently between major versions.

Former maintainer: Michal Suchanek <hramrach@centrum.cz>
<<
DescPort: <<
fangism:
Some C++ related patching was necessary to get the source to compile against
g++-4.0, even though upstream requires g++-4.2 or higher.
Also, some POSIX APIs that were expected for atomic operations were 
mapped to darwin8 equivalents.
Additional patching needed to C-cast (ewww...) address-of-unsigned to 
pointer-to-signed because of differences in the atomicity API.

OpenSSL1.1 patch from upstream: 4607bbf78040789dee29266878ce109136b984ef
<<