File curl.spec of Package curl

#
# spec file for package curl (Version 7.19.0)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#

# norootforbuild


Name:           curl
BuildRequires:  libidn-devel openldap2-devel openssl-devel zlib-devel
%if 0%{suse_version} > 930
BuildRequires:  krb5-devel
%else
BuildRequires:  heimdal-devel
%endif
%if 0%{?_with_libssh2:1}
BuildRequires:  libssh2-devel openssh
%endif
%if 0%{?_with_stunnel:1}
# used by the testsuite
BuildRequires:  stunnel
%endif
Version:        7.19.0
Release:        12.<RELEASE0>
AutoReqProv:    on
# bug437293
%ifarch ppc64
Obsoletes:      curl-64bit
%endif
#
License:        BSD 3-Clause; X11/MIT
Group:          Productivity/Networking/Web/Utilities
Summary:        A Tool for Transferring Data from URLs
Url:            http://curl.haxx.se/
Source:         curl-%{version}.tar.bz2
Patch1:         curl-7.19.0-CVE-2009-0037.patch
Patch2:         curl-7.19.0-proxy-ftp-passwd.patch
Patch3:         curl-7.19.0-CVE-2009-2417.patch
Patch4:         OpenSSL-SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG-opti.patch
Patch5:         OpenSSL-don-t-disable-security-work-around.patch
Patch6:         Curl-input-negotiatie.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Curl is a client to get documents and files from or send documents to a
server using any of the supported protocols (HTTP, HTTPS, FTP, FTPS,
TFTP, DICT, TELNET, LDAP, or FILE). The command is designed to work
without user interaction or any kind of interactivity.



Authors:
--------
    Daniel Stenberg <Daniel.Stenberg@haxx.se>

%package -n libcurl4
License:        BSD 3-Clause; X11/MIT
Summary:        cURL shared library version 4
Group:          Productivity/Networking/Web/Utilities
# curl-ca-bundle doesn't exist since openSUSE 11.0, remove it on update
# XXX: nothing actually provides curl-ca-bundle anymore
#Provides:       curl-ca-bundle
Obsoletes:      curl-ca-bundle

%description -n libcurl4
cURL shared library version 4.



Authors:
--------
    Daniel Stenberg <Daniel.Stenberg@haxx.se>

%package -n libcurl-devel
License:        BSD 3-Clause; X11/MIT
Summary:        A Tool for Transferring Data from URLs
Group:          Development/Libraries/C and C++
Requires:       libcurl4 = %{version} glibc-devel
# curl-devel (v 7.15.5) was last used in 10.2
Provides:       curl-devel <= 7.15.5
Obsoletes:      curl-devel < 7.16.2

%description -n libcurl-devel
Curl is a client to get documents and files from or send documents to a
server using any of the supported protocols (HTTP, HTTPS, FTP, GOPHER,
DICT, TELNET, LDAP, or FILE). The command is designed to work without
user interaction or any kind of interactivity.



Authors:
--------
    Daniel Stenberg <Daniel.Stenberg@haxx.se>

%prep
%setup -q
%patch1
%patch2
%patch3
%patch4 -p0
%patch5 -p0
%patch6 -p1 

%build
autoreconf -fi
# local hack to make curl-config --libs stop printing libraries it depends on
# (currently, libtool sets link_all_deplibs=(yes|unknown) everywhere,
# will hopefully change in the future)
sed -i 's/link_all_deplibs=unknown/link_all_deplibs=no/' configure
export CFLAGS="$RPM_OPT_FLAGS"
./configure \
	--prefix=%{_prefix} \
	--enable-ipv6 \
	--with-ssl \
	--with-ca-path=/etc/ssl/certs/ \
%if %suse_version > 930
	--with-gssapi=/usr/lib/mit \
%else
	--with-gssapi=/usr/lib/heimdal \
%endif
	%{?_with_libssh2} \
	--libdir=%{_libdir} \
	--enable-hidden-symbols \
	--disable-static
: if this fails, the above sed hack did not work
./libtool --config | grep -q link_all_deplibs=no
# enable-hidden-symbols needs gcc4 and causes that curl exports only its API
make %{?jobs:-j%jobs}
cd tests
make
# make sure the testsuite runs don't race on MP machines in autobuild
if test -z "$BUILD_INCARNATION" -a -r /.buildenv; then
	. /.buildenv
fi
if test -z "$BUILD_INCARNATION"; then
	BUILD_INCARNATION=0
fi
base=$((8990 + $BUILD_INCARNATION * 20))
perl ./runtests.pl -a -b$base || {
%if 0%{?curl_testsuite_nonfatal:1}
	echo "WARNING: runtests.pl failed with code $?, continuing nevertheless"
%else
	exit
%endif
}

%install
make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
rm $RPM_BUILD_ROOT%_libdir/libcurl.la
install -d $RPM_BUILD_ROOT/usr/share/aclocal
install -m 644 docs/libcurl/libcurl.m4 $RPM_BUILD_ROOT/usr/share/aclocal/

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libcurl4 -p /sbin/ldconfig

%postun -n libcurl4 -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README RELEASE-NOTES
%doc docs/{BUGS,FAQ,FEATURES,MANUAL,RESOURCES,TODO,TheArtOfHttpScripting}
%doc lib/README.curl_off_t
%{_prefix}/bin/curl
%doc %{_mandir}/man1/curl.1.gz

%files -n libcurl4
%defattr(-,root,root)
%{_libdir}/libcurl.so.4*

%files -n libcurl-devel
%defattr(-,root,root)
%{_prefix}/bin/curl-config
%{_prefix}/include/curl
%{_prefix}/share/aclocal/libcurl.m4
%{_libdir}/libcurl.so
%{_libdir}/pkgconfig/libcurl.pc
%doc %{_mandir}/man1/curl-config.1.gz
%doc %{_mandir}/man3/*

%changelog
openSUSE Build Service is sponsored by