Package: libcurl4
Version: 8.8.0
Revision: 1
Description: Lib. for transferring files with URL syntax
DescDetail: <<
	curl is a command line tool for transferring files with URL syntax,
	supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP,
	LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT,
	FTP uploading, HTTP form based upload, proxies, cookies, user+password
	authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file
	transfer resume, proxy tunneling and a busload of other useful tricks.
<<
DescPackaging: <<
  No longer build static libs.
  
  Packages depending on libcurl4 no longer need to depend on its dependencies,
  just Depend on libcurl4-shlibs and BuildDepend on libcurl4.
  
  Add -dead_strip_dylibs to LDFLAGS on >=10.5 to not link indirect libs.
  
  Use native SecureTransport instead of OpenSSL on 10.8+.
      
  Versions of curl before 7.11.1-11 were maintained by Max Horn.

  Shell-completions modules are not installed, so it doesn't matter if
  zsh/fish are not found by ./configure

  Disable some optional-library detection that fink doesn't currently
  have, for consistent build results if fink were to get them

  Our 7.74.0-2 had been defaulting to secure-transport for SSL. We now
  explicitly set that option for consistency.
<<
Maintainer: Daniel Johnson <daniel@daniel-johnson.org>
Homepage: http://curl.se/
License: BSD

Source: https://curl.se/download/curl-%v.tar.xz
Source-Checksum: SHA256(0f58bb95fc330c8a46eeb3df5701b0d90c9d9bfcc42bd1cd08791d12551d4400)

Depends: %N-shlibs (= %v-%r)
BuildDepends: <<
	fink (>= 0.32),
	fink-package-precedence,
	gsasl19-dev,
	libbrotli1 (>= 1.0.7-1),
	libidn2.0-dev,
	libnghttp2.14 (>= 1.41.0-1),
	librtmp1,
	libssh2.1 (>= 1.9.0-1),
	libzstd1-dev,
	openldap2-dev,
	pkgconfig
<<
BuildDependsOnly: True

PatchScript: <<
	#Clear out unnecessary junk.
	perl -ni -e 'print unless /\.private:/' libcurl.pc.in
	# harden build
	perl -pi -e "s/(xc_lt_shlib_use_no_undefined=)'no'/\1'yes'/" configure
	# safer linker flags
	perl -pi -e 's|-framework |-Wl,-framework,|g' configure
<<

SetLDFLAGS: -Wl,-dead_strip_dylibs
SetCFLAGS: -Os
# Some libcares2 have bugs that affect curl. Leaving disabled until
# that situation is resolved in a release. When we do enable, set a
# versioned dep to make sure the bug-fix is present. See:
#   https://github.com/c-ares/c-ares/issues/454
#   https://github.com/c-ares/c-ares/issues/783
#
# HTTPSRR is marked experimental, so leaving is disabled for now.
ConfigureParams: <<
	--with-secure-transport \
	--without-openssl \
	--without-gnutls \
	--with-libssh2=%p \
	--with-gssapi=/usr \
	--enable-ldap \
	--disable-ldaps \
	--with-ldap-lib=ldap \
	--with-lber-lib=lber \
	--with-libidn2 \
	--with-librtmp \
	--with-nghttp2=%p \
	--with-brotli=%p \
	--with-zstd \
	--without-libpsl \
	--without-ngtcp2 \
	--without-quiche \
	--enable-symbol-hiding \
	--enable-threaded-resolver \
	--disable-static \
	--enable-dependency-tracking \
	--disable-silent-rules
<<

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

InstallScript: <<
	make install DESTDIR=%d
<<
DocFiles: CHANGES COPYING README RELEASE-NOTES

SplitOff: <<
	Package: %N-shlibs
  
	Depends: <<
		gsasl19-shlibs,
		libbrotli1-shlibs (>= 1.0.7-1),
		libidn2.0-shlibs,
		libnghttp2.14-shlibs (>= 1.41.0-1),
		librtmp1-shlibs,
		libssh2.1-shlibs (>= 1.9.0-1),
		libzstd1-shlibs,
		openldap2-shlibs
	<<
    
	Files: lib/libcurl.4.*dylib
	Shlibs: %p/lib/libcurl.4.dylib 13.0.0 %n (>= 7.84.0-1)
	DocFiles: CHANGES COPYING README RELEASE-NOTES
<<

SplitOff2: <<
  Package: curl
  Description: Tool for transferring files with URL syntax
  DescUsage: For additional documentation see the %N package.
  
  Depends: %N-shlibs (>= %v-%r)
  
  Files: bin/curl share/man/man1/curl.1
  DocFiles: CHANGES COPYING README RELEASE-NOTES docs/BINDINGS.md docs/BUGS.md docs/CONTRIBUTE.md docs/FAQ docs/FEATURES.md docs/HISTORY.md docs/KNOWN_BUGS docs/INTERNALS.md docs/THANKS docs/TODO docs/TheArtOfHttpScripting.md docs/SSLCERTS.md docs/VERSIONS.md
<<

InfoTest: <<
  TestDepends: stunnel4
  TestScript: <<
    #!/bin/bash -ev
    
    #These tests fail if you use OpenDNS or your ISP sucks
    #and uses wildcard dns lookups.
    #echo '20' >>tests/data/DISABLED
    #echo '237' >>tests/data/DISABLED
    #echo '507' >>tests/data/DISABLED
    #echo '534' >>tests/data/DISABLED
    
    #This test fails when run as root.
	#echo '1001' >>tests/data/DISABLED
	#echo '1112' >>tests/data/DISABLED
	
	#This test seems to hang.
	#echo '283' >>tests/data/DISABLED
	#echo '525' >>tests/data/DISABLED
	#echo '554' >>tests/data/DISABLED
	#echo '587' >>tests/data/DISABLED
	#echo '906' >>tests/data/DISABLED
	#echo '1006' >>tests/data/DISABLED
	#echo '1007' >>tests/data/DISABLED
	#echo '1086' >>tests/data/DISABLED
	#echo '1099' >>tests/data/DISABLED
	#echo '1316' >>tests/data/DISABLED
	#echo '2002' >>tests/data/DISABLED
	#echo '2003' >>tests/data/DISABLED
	
	echo '310' >>tests/data/DISABLED
	#echo '311' >>tests/data/DISABLED
	#echo '312' >>tests/data/DISABLED
	echo '313' >>tests/data/DISABLED

	# These tests don't work with darwinssl.
	#echo '305' >>tests/data/DISABLED
	#echo '404' >>tests/data/DISABLED
	
	#echo '1801' >>tests/data/DISABLED
	
	# This test started failing with 7.50.0. Looks harmless.
	#echo '506' >>tests/data/DISABLED

	# peer not verified
	echo '678' >>tests/data/DISABLED

	# These fail with 'curl: (90) SSL: public key does not match pinned public key' or '...pinnedpubkey but right CN'
	echo '2034' >>tests/data/DISABLED
	echo '2035' >>tests/data/DISABLED
	echo '2037' >>tests/data/DISABLED
	echo '2038' >>tests/data/DISABLED
	echo '2041' >>tests/data/DISABLED
	echo '2042' >>tests/data/DISABLED

	#echo '2056' >>tests/data/DISABLED
	#echo '2057' >>tests/data/DISABLED

	#echo '1452' >>tests/data/DISABLED

	# This fails with bad certificate (on their side?)
	echo '3000' >>tests/data/DISABLED
	echo '3001' >>tests/data/DISABLED

	#The SSH tests will also be skipped as root but this isn't fatal.

    #Build and run the tests. Disable use of valgrind because it takes a LONG time.
    make test-full TEST_F="-a -p -r -n" || exit 2
    fink-package-precedence --prohibit-bdep=%n . || exit 2
  <<
<<