# Detect the distribution in use %global __despace head -n 1 | tr -d '[:space:]' | sed -e 's/[(].*[)]//g' %global __lower4 cut -c 1-4 | tr '[:upper:]' '[:lower:]' %global __distfile %([ -f /etc/SuSE-release ] && echo /etc/SuSE-release || echo /etc/redhat-release) %global __distinit %(sed -e 's/ release .*//' -e 's/\\([A-Za-z]\\)[^ ]*/\\1/g' %{__distfile} | %{__despace} | %{__lower4}) %global __distvers %(sed -e 's/.* release \\([^. ]*\\).*/\\1/' %{__distfile} | %{__despace}) # Identify CentOS Linux and Scientific Linux as rhel %if "%{__distinit}" == "c" || "%{__distinit}" == "cl" || "%{__distinit}" == "sl" || "%{__distinit}" == "sls" %global __distinit rhel %endif # Dist tag for Fedora is still "fc" %if "%{__distinit}" == "f" %global __distinit fc %endif # Set to 0 for regular curl package, 1 for libcurl compatibility package %global compat 1 # Use OpenSSL cert bundle in %%{_sysconfdir}/pki/tls/certs if available %global use_pki %(if [ -f %{_sysconfdir}/pki/tls/certs/ca-bundle.crt ]; then echo 1; else echo 0; fi) %if %{use_pki} %global cert_bundle %{_sysconfdir}/pki/tls/certs/ca-bundle.crt %else %global cert_bundle %{_datadir}/ssl/certs/ca-bundle.crt %endif # Figure out openldap version %global ldap_version %(readlink %{_libdir}/libldap.so | sed 's,.*libldap-\\([0-9.]*\\)\\.so\\..*,\\1,') Version: 7.15.5 Release: 17.cf.%{__distinit}%{__distvers} %if %{compat} Summary: Curl library for compatibility with old applications Name: libcurl%(echo %{version} | tr -d .) Group: System Environment/Libraries Obsoletes: compat-libcurl < %{version}-%{release} Provides: compat-libcurl = %{version}-%{release} %else Summary: Utility for getting files from remote servers (FTP, HTTP, and others) Name: curl Group: Applications/Internet %endif License: MIT Source: http://curl.haxx.se/download/curl-%{version}.tar.bz2 Patch1: curl-7.15.0-curl_config-version.patch Patch2: curl-7.15.3-multilib.patch Patch3: curl-7.15.5-CVE-2009-0037.patch Patch4: curl-7.15.5-CVE-2009-2417.patch Patch5: curl-7.15.5-bz473128.patch Patch6: curl-7.15.5-bz479967.patch Patch7: curl-7.15.5-bz517084.patch Patch8: curl-7.15.5-bz517199.patch Patch9: curl-7.15.5-bz532069.patch Patch10: curl-7.15.5-bz563220.patch Patch11: curl-7.15.5-bz655073.patch Patch100: curl-7.15.5-privlibs.patch Patch101: http://curl.haxx.se/curl-gssapi-delegation.patch Patch102: curl-7.15.5-CVE-2011-3389.patch Patch103: curl-tailmatch.patch Patch104: libcurl-unescape.patch Patch105: curl-7.15.5-CVE-2014-0015.patch Patch300: curl-7.15.5-utf8.patch URL: http://curl.haxx.se/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu) BuildRequires: openssl-devel, pkgconfig, zlib-devel, openldap-devel, libidn-devel BuildRequires: groff Requires: openssl, %{cert_bundle} %if ! %{compat} %description cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, and Dict servers, using any of the supported protocols. cURL is designed to work without user interaction or any kind of interactivity. cURL offers many useful capabilities, like proxy support, user authentication, FTP upload, HTTP post, and file transfer resume. %package devel Summary: Files needed for building applications with libcurl Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: openssl-devel, libidn-devel, pkgconfig Requires: %{_datadir}/aclocal %description devel cURL is a tool for getting files from FTP, HTTP, Gopher, Telnet, and Dict servers, using any of the supported protocols. The curl-devel package includes files needed for developing applications which can use cURL's capabilities internally. %else %description This package provides an old version of cURL's libcurl library, necessary for some old applications that have not been rebuilt against an up to date version of cURL. %endif %prep %setup -q -n curl-%{version} # Fix curl-config missing vernum value (#174556) %patch1 -p1 -b .ver # Fix multilib problem using pkg-config (#181290) %patch2 -p1 -b .multilib # Fix local file access via unsafe redirects (CVE-2009-0037, #485271) %patch3 -p1 -b .CVE-2009-0037 # Fix incorrect verification of SSL certificate with NUL in name (CVE-2009-2417) %patch4 -p1 -b .CVE-2009-2417 # Document lack of IPv6, FTPS and LDAP support while using a socks proxy (#473128) %patch5 -p1 -b .bz473128 # Avoid tight loop if an upload connection is broken (#479967) %patch6 -p1 -b .bz479967 # Add options --ftp-account/--ftp-alternative-to-user to program help (#517084) %patch7 -p1 -b .bz517084 # Fix crash when reusing connection after negotiate-auth (#517199) %patch8 -p1 -b .bz517199 # Add support for CRL loading from a PEM file (#532069) %patch9 -p1 -b .bz532069 # Fix zlib-compression causing curl to pass more than CURL_MAX_WRITE_SIZE bytes # to write callback (CVE-2010-0734, #563220) %patch10 -p1 -b .bz563220 # Avoid use of uninitialized variable on failure of a LDAP request (#670523) # Proxy tunnel support for LDAP requests (#670523) %patch11 -p1 -b .bz655073 # Move LDFLAGS and LIBS to Libs.private in libcurl.pc (#213278) %patch100 -p1 -b .privlibs # Fix libcurl inappropriate GSSAPI delegation (CVE-2011-2192) %patch101 -p1 -b .CVE-2011-2192 # Fix SSL CBC IV vulnerability with OpenSSL (CVE-2011-3389) %patch102 -p1 -b .CVE-2011-3389 # Fix cookie domain tailmatch vulnerability (CVE-2013-1944) %patch103 -p1 -b .CVE-2013-1944 # Fix libcurl URL decode buffer boundary flaw (CVE-2013-2174) %patch104 -p1 -b .CVE-2013-2174 # Fix NTLM connection re-use flaw (CVE-2014-0015) %patch105 -b .CVE-2014-0015 # Convert docs to UTF-8 %patch300 -p1 %build CPPFLAGS=`pkg-config --cflags openssl`; export CPPFLAGS LDFLAGS=`pkg-config --libs openssl`; export LDFLAGS [ -x /usr/kerberos/bin/krb5-config ] && KERBEROS=/kerberos %configure --with-ssl=/usr \ --enable-ipv6 \ --enable-manual \ --with-ca-bundle=%{cert_bundle} \ --with-gssapi=/usr${KERBEROS} \ --with-libidn=/usr \ --with-ldap-lib=libldap-%{ldap_version}.so.0 \ --with-lber-lib=liblber-%{ldap_version}.so.0 \ --disable-static # Remove -L options for standard library directories sed -i -e 's,-L/usr/lib ,,g;s,-L/usr/lib64 ,,g;s,-L/usr/lib$,,g;s,-L/usr/lib64$,,g' \ Makefile libcurl.pc # Remove bogus rpath sed -i \ -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{_smp_mflags} %install rm -rf %{buildroot} make DESTDIR=%{buildroot} INSTALL="install -p" install install -d %{buildroot}%{_datadir}/aclocal install -m 644 -p docs/libcurl/libcurl.m4 %{buildroot}%{_datadir}/aclocal %clean rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc CHANGES README* COPYING %doc docs/BUGS docs/FAQ docs/FEATURES docs/TODO %doc docs/MANUAL docs/RESOURCES docs/TheArtOfHttpScripting %if ! %{compat} %{_bindir}/curl %{_mandir}/man1/curl.1* %else %exclude %{_bindir}/curl %exclude %{_mandir}/man1/curl.1* %endif %{_libdir}/libcurl.so.* # don't need curl's copy of the certs; use openssl's %exclude %{cert_bundle} %if ! %{compat} %files devel %defattr(-,root,root,-) %doc docs/examples/*.c docs/examples/Makefile.example docs/INTERNALS %doc docs/CONTRIBUTE %{_bindir}/curl-config %{_includedir}/curl %{_libdir}/*.so %{_libdir}/pkgconfig/libcurl.pc %{_mandir}/man1/curl-config.1* %{_mandir}/man3/* %{_datadir}/aclocal/libcurl.m4 %else %exclude %{_bindir}/curl-config %exclude %{_includedir}/curl %exclude %{_libdir}/*.so %exclude %{_libdir}/pkgconfig/libcurl.pc %exclude %{_mandir}/man1/curl-config.1* %exclude %{_mandir}/man3/* %exclude %{_datadir}/aclocal/libcurl.m4 %endif %exclude %{_libdir}/libcurl.la %changelog * Thu Jan 30 2014 Paul Howarth <paul@city-fan.org> 7.15.5-17.cf - fix NTLM connection re-use flaw (CVE-2014-0015) * Mon Jun 24 2013 Paul Howarth <paul@city-fan.org> 7.15.5-16.cf - fix cookie domain tailmatch vulnerability (CVE-2013-1944) - fix libcurl URL decode buffer boundary flaw (CVE-2013-2174) * Tue Jan 24 2012 Paul Howarth <paul@city-fan.org> 7.15.5-15.cf - fix SSL CBC IV vulnerability (CVE-2011-3389) - use a patch rather than scripted iconv to fix character encoding * Fri Oct 14 2011 Paul Howarth <paul@city-fan.org> 7.15.5-14.cf - fix dist tag for CentOS 6 and Scientific Linux * Thu Jun 23 2011 Paul Howarth <paul@city-fan.org> 7.15.5-13.cf - fix libcurl inappropriate GSSAPI delegation (CVE-2011-2192) - nobody else likes macros for commands - use %%global in preference to %%define * Fri Jan 28 2011 Paul Howarth <paul@city-fan.org> 7.15.5-12.cf - avoid use of uninitialized variable on failure of a LDAP request (#670523) - proxy tunnel support for LDAP requests (#670523) * Tue May 25 2010 Paul Howarth <paul@city-fan.org> 7.15.5-11.cf - fix dist tag for RHEL-6 Beta * Wed Apr 7 2010 Paul Howarth <paul@city-fan.org> 7.15.5-10.cf - fix zlib-compression causing curl to pass more than CURL_MAX_WRITE_SIZE bytes to write callback (CVE-2010-0734, #563220) - fix curl-config missing vernum value (#174556) - document lack of IPv6, FTPS and LDAP support if using a socks proxy (#473128) - avoid tight loop if an upload connection is broken (#479967) - add options --ftp-account/--ftp-alternative-to-user to program help (#517084) - fix crash when reusing connection after negotiate-auth (#517199) - add support for CRL loading from a PEM file (#532069) - handle move of kerberos installation prefix in krb5 >= 1.8 - enable built-in manual for non-compat build (requires buildreq groff) - comment patches in spec file * Sun Feb 21 2010 Paul Howarth <paul@city-fan.org> 7.15.5-9.cf - dist tag for Rawhide no longer needs special-casing * Tue Sep 1 2009 Paul Howarth <paul@city-fan.org> 7.15.5-8.cf - rebuild for openssl 1.0 in Rawhide * Wed Aug 19 2009 Paul Howarth <paul@city-fan.org> 7.15.5-7.cf - fix CVE-2009-2417 (incorrect verification of SSL certificate with NUL in name) - use RHEL5 patch for CVE-2009-0037 - renumber patches as per RHEL5 package * Thu Mar 5 2009 Paul Howarth <paul@city-fan.org> 7.15.5-6.cf - add patch for CVE-2009-0037 (#485271), local file access via unsafe redirects - use a different libtool hack to avoid bogus rpaths; no longer need to buildreq libtool on x86_64 - try to avoid spurious linker options for looking in standard libraries - don't create/ship static libraries (#225671) - honour %%{_smp_mflags} - try to preserve timestamps where possible by using install -p - update to SLES-compatible dist tag macros * Fri Dec 7 2007 Paul Howarth <paul@city-fan.org> 7.15.5-5.cf - rebuild for new openssl in Rawhide - convert docs to UTF-8 - move docs/CONTRIBUTE to devel package - package libcurl.m4 in devel package (#239664), thanks to Quy Tonthat * Thu Mar 22 2007 Paul Howarth <paul@city-fan.org> 7.15.5-4.cf - use versioned obsolete for compat-libcurl - add buildreqs openldap-devel and libidn-devel - don't package generated makefiles for docs/examples to avoid multilib conflicts - remove redundant buildreq automake - use system libtool to avoid bogus rpaths on x86_64 - fix dist tag for Fedora 7 - prevent curl from dlopen()ing missing ldap libraries so that ldap:// requests work without needing openldap-devel at runtime (#215928) - add Requires: pkgconfig for curl-devel - move LDFLAGS and LIBS to Libs.private in libcurl.pc.in (#213278) - fix multilib problem using pkg-config * Mon Oct 30 2006 Paul Howarth <paul@city-fan.org> 7.15.5-3.cf - first libcurl7155 package; curl 7.16.0 has soname bump - further dist tag tweaks for rawhide - convert spec file to UTF8 * Thu Sep 14 2006 Paul Howarth <paul@city-fan.org> 7.15.5-2.cf - fix dist tag for development releases - add buildreq zlib-devel * Mon Aug 7 2006 Paul Howarth <paul@city-fan.org> 7.15.5-1.cf - update to 7.15.5 - define %%{__id_u} in a more portable way * Mon Jun 12 2006 Paul Howarth <paul@city-fan.org> 7.15.4-1.cf - update to 7.15.4 * Tue Mar 21 2006 Paul Howarth <paul@city-fan.org> 7.15.3-2.cf - fix multilib problem - #181290 - curl-devel.i386 not installable together with curl-devel.x86-64 * Mon Mar 20 2006 Paul Howarth <paul@city-fan.org> 7.15.3-1.cf - update to 7.15.3 * Tue Feb 28 2006 Paul Howarth <paul@city-fan.org> 7.15.2-1.cf - update to 7.15.2 - support building on CentOS * Wed Dec 7 2005 Paul Howarth <paul@city-fan.org> 7.15.1-1.cf - update to 7.15.1 - remove buildroot unconditionally in %%clean and %%install - simplify distribution detection - include pkgconfig file in devel subpackage * Fri Oct 14 2005 Paul Howarth <paul@city-fan.org> 7.15.0-1.cf - compat package renamed to libcurlVERSION for forward compatibility when a new soname is used in upstream curl, so that multiple versions of the libcurl library can be installed in parallel - don't use %%{_bindir} in command paths, use /usr/bin explicitly - spec file cleanup * Mon Sep 5 2005 Paul Howarth <paul@city-fan.org> 7.14.1-2.cf - build fully distro-specific packages to avoid dependency issues * Fri Sep 2 2005 Paul Howarth <paul@city-fan.org> 7.14.1-1.cf - update to 7.14.1 * Wed Jul 27 2005 Paul Howarth <paul@city-fan.org> 7.14.0-3.cf - different summary, group, and description in compat mode - use the correct cert bundle location for FC4 - use exclude in the file lists rather than deleting files from the buildroot - add explicit requirement for the CA bundle file - license is MIT, not MPL * Thu Jun 30 2005 Paul Howarth <paul@city-fan.org> 7.14.0-2.cf - enable building with dist tag if required: e.g. $ rpmbuild --define "dist .fc4" ... * Tue May 17 2005 Paul Howarth <paul@city-fan.org> 7.14.0-1.cf - update to 7.14.0 * Wed Apr 6 2005 Paul Howarth <paul@city-fan.org> 7.13.2-1.cf - update to 7.13.2 - remove SSL patch, included upstream * Sat Mar 5 2005 Paul Howarth <paul@city-fan.org> 7.13.1-1.cf - update to 7.13.1 - add patch to fix SSL breakage - modify install process to avoid need for path patch * Fri Feb 25 2005 Paul Howarth <paul@city-fan.org> 7.13.0-2.cf - fix for CAN-2005-0490 * Wed Feb 2 2005 Paul Howarth <paul@city-fan.org> 7.13.0-1.cf - update to 7.13.0 * Mon Jan 31 2005 Paul Howarth <paul@city-fan.org> 7.12.3-2.cf - add .cf repo tag - remove INSTALL from docs - enable GSSAPI auth (#129353) * Tue Dec 21 2004 Paul Howarth <paul@city-fan.org> 7.12.3-1 - update to 7.12.3 * Fri Nov 26 2004 Paul Howarth <paul@city-fan.org> 7.12.2-2 - add libidn-devel dependency to curl-devel (http://www.redhat.com/archives/fedora-list/2004-November/msg07551.html) * Tue Oct 19 2004 Paul Howarth <paul@city-fan.org> 7.12.2-1 - update to 7.12.2 * Wed Oct 6 2004 Paul Howarth <paul@city-fan.org> 7.12.1-2 - include facility to build compat-libcurl package containing only the library - remove certaltname patch completely - include COPYING - general tidy-up of spec file * Wed Aug 11 2004 Paul Howarth <paul@city-fan.org> 7.12.1-1 - update to 7.12.1 * Thu Jun 03 2004 Paul Howarth <paul@city-fan.org> 7.12.0-1 - update to 7.12.0 * Tue Apr 27 2004 Paul Howarth <paul@city-fan.org> 7.11.2-1 - update to 7.11.2 - remove parts of curl-7.10.6-certaltname.patch that fix no-longer-applicable cosmetic issues and rename to curl-7.11.2-certaltname.patch * Mon Mar 22 2004 Paul Howarth <paul@city-fan.org> 7.11.1-1 - update to 7.11.1 - remove no-longer-applicable curl-7.10.4-nousr.patch * Fri Jan 23 2004 Paul Howarth <paul@city-fan.org> 7.11.0-1 - update to 7.11.0 * Wed Oct 15 2003 Adrian Havill <havill@redhat.com> 7.10.6-7 - aclocal before libtoolize - move OpenLDAP license so it's present as a doc file, present in both the source and binary as per conditions * Mon Oct 13 2003 Adrian Havill <havill@redhat.com> 7.10.6-6 - add OpenLDAP copyright notice for usage of code, add OpenLDAP license for this code * Tue Oct 07 2003 Adrian Havill <havill@redhat.com> 7.10.6-5 - match serverAltName certs with SSL (#106168) * Tue Sep 16 2003 Adrian Havill <havill@redhat.com> 7.10.6-4.1 - bump n-v-r for RHEL * Tue Sep 16 2003 Adrian Havill <havill@redhat.com> 7.10.6-4 - restore ca cert bundle (#104400) - require openssl, we want to use its ca-cert bundle * Sun Sep 7 2003 Joe Orton <jorton@redhat.com> 7.10.6-3 - rebuild * Fri Sep 5 2003 Joe Orton <jorton@redhat.com> 7.10.6-2.2 - fix to include libcurl.so * Mon Aug 25 2003 Adrian Havill <havill@redhat.com> 7.10.6-2.1 - bump n-v-r for RHEL * Mon Aug 25 2003 Adrian Havill <havill@redhat.com> 7.10.6-2 - devel subpkg needs openssl-devel as a Require (#102963) * Mon Jul 28 2003 Adrian Havill <havill@redhat.com> 7.10.6-1 - bumped version * Tue Jul 01 2003 Adrian Havill <havill@redhat.com> 7.10.5-1 - bumped version * Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com> - rebuilt * Sat Apr 12 2003 Florian La Roche <Florian.LaRoche@redhat.de> - update to 7.10.4 - adapt nousr patch * Wed Jan 22 2003 Tim Powers <timp@redhat.com> - rebuilt * Tue Jan 21 2003 Joe Orton <jorton@redhat.com> 7.9.8-4 - don't add -L/usr/lib to 'curl-config --libs' output * Tue Jan 7 2003 Nalin Dahyabhai <nalin@redhat.com> 7.9.8-3 - rebuild * Wed Nov 6 2002 Joe Orton <jorton@redhat.com> 7.9.8-2 - fix `curl-config --libs` output for libdir!=/usr/lib - remove docs/LIBCURL from docs list; remove unpackaged libcurl.la - libtoolize and reconf * Mon Jul 22 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.8-1 - 7.9.8 (# 69473) * Fri Jun 21 2002 Tim Powers <timp@redhat.com> - automated rebuild * Sun May 26 2002 Tim Powers <timp@redhat.com> - automated rebuild * Thu May 16 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.7-1 - 7.9.7 * Wed Apr 24 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.6-1 - 7.9.6 * Thu Mar 21 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.5-2 - Stop the curl-config script from printing -I/usr/include and -L/usr/lib (#59497) * Fri Mar 8 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.5-1 - 7.9.5 * Tue Feb 26 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.3-2 - Rebuild * Wed Jan 23 2002 Nalin Dahyabhai <nalin@redhat.com> 7.9.3-1 - update to 7.9.3 * Wed Jan 09 2002 Tim Powers <timp@redhat.com> 7.9.2-2 - automated rebuild * Wed Jan 9 2002 Trond Eivind Glomsrød <teg@redhat.com> 7.9.2-1 - 7.9.2 * Fri Aug 17 2001 Nalin Dahyabhai <nalin@redhat.com> - include curl-config in curl-devel - update to 7.8 to fix memory leak and strlcat() symbol pollution from libcurl * Wed Jul 18 2001 Crutcher Dunnavant <crutcher@redhat.com> - added openssl-devel build req * Mon May 21 2001 Tim Powers <timp@redhat.com> - built for the distro * Tue Apr 24 2001 Jeff Johnson <jbj@redhat.com> - upgrade to curl-7.7.2. - enable IPv6. * Fri Mar 2 2001 Tim Powers <timp@redhat.com> - rebuilt against openssl-0.9.6-1 * Thu Jan 4 2001 Tim Powers <timp@redhat.com> - fixed mising ldconfigs - updated to 7.5.2, bug fixes * Mon Dec 11 2000 Tim Powers <timp@redhat.com> - updated to 7.5.1 * Mon Nov 6 2000 Tim Powers <timp@redhat.com> - update to 7.4.1 to fix bug #20337, problems with curl -c - not using patch anymore, it's included in the new source. Keeping for reference * Fri Oct 20 2000 Nalin Dahyabhai <nalin@redhat.com> - fix bogus req in -devel package * Fri Oct 20 2000 Tim Powers <timp@redhat.com> - devel package needed defattr so that root owns the files * Mon Oct 16 2000 Nalin Dahyabhai <nalin@redhat.com> - update to 7.3 - apply vsprintf/vsnprintf patch from Colin Phipps via Debian * Mon Aug 21 2000 Nalin Dahyabhai <nalin@redhat.com> - enable SSL support - fix packager tag - move buildroot to %%{_tmppath} * Tue Aug 1 2000 Tim Powers <timp@redhat.com> - fixed vendor tag for bug #15028 * Mon Jul 24 2000 Prospector <prospector@redhat.com> - rebuilt * Tue Jul 11 2000 Tim Powers <timp@redhat.com> - workaround alpha build problems with optimizations * Mon Jul 10 2000 Tim Powers <timp@redhat.com> - rebuilt * Mon Jun 5 2000 Tim Powers <timp@redhat.com> - put man pages in correct place - use %%makeinstall * Mon Apr 24 2000 Tim Powers <timp@redhat.com> - updated to 6.5.2 * Wed Nov 3 1999 Tim Powers <timp@redhat.com> - updated sources to 6.2 - gzip man page * Mon Aug 30 1999 Tim Powers <timp@redhat.com> - changed group * Thu Aug 26 1999 Tim Powers <timp@redhat.com> - changelog started - general cleanups, changed prefix to /usr, added manpage to files section - including in Powertools