diff --git a/curl-ipv6tests.patch b/curl-ipv6tests.patch
deleted file mode 100644
index 7c81726..0000000
--- a/curl-ipv6tests.patch
+++ /dev/null
@@ -1,28 +0,0 @@
----
- tests/data/test241 | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- tests/data/test241.orig
-+++ tests/data/test241
-@@ -30,10 +30,10 @@ ipv6
- http-ipv6
-
-
--HTTP-IPv6 GET (using ip6-localhost)
-+HTTP-IPv6 GET (using ip6-localhost aka [::1])
-
-
---g "http://ip6-localhost:%HTTP6PORT/241"
-+-g "http://[::1]:%HTTP6PORT/241"
-
-
- ./server/resolve --ipv6 ip6-localhost
-@@ -48,7 +48,7 @@ HTTP-IPv6 GET (using ip6-localhost)
-
-
- GET /241 HTTP/1.1
--Host: ip6-localhost:%HTTP6PORT
-+Host: [::1]:%HTTP6PORT
- Accept: */*
-
-
diff --git a/curl-testsuite-remember-broken-servers.patch b/curl-testsuite-remember-broken-servers.patch
new file mode 100644
index 0000000..93cdb1f
--- /dev/null
+++ b/curl-testsuite-remember-broken-servers.patch
@@ -0,0 +1,252 @@
+Remember which servers failed to start and don't try to run them again.
+This is mainly useful when the ipv6 servers don't work.
+---
+ tests/runtests.pl | 70 +++++++++++++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 61 insertions(+), 9 deletions(-)
+
+--- tests/runtests.pl.orig
++++ tests/runtests.pl
+@@ -186,7 +186,8 @@ my $keepoutfiles; # keep stdout and stde
+ my $listonly; # only list the tests
+ my $postmortem; # display detailed info about failed tests
+
+-my %run; # running server
++my %run; # running server
++my %doesntrun; # servers that don't work, identified by pidfile
+
+ # torture test variables
+ my $torture;
+@@ -708,6 +709,11 @@ sub runhttpserver {
+ $nameext="-ipv6";
+ }
+
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
+ $pid = checkserver($pidfile);
+
+ if($pid > 0) {
+@@ -727,6 +733,7 @@ sub runhttpserver {
+ if($httppid <= 0 || !kill(0, $httppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the HTTP$nameext server\n";
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -735,6 +742,7 @@ sub runhttpserver {
+ logmsg "RUN: HTTP$nameext server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$httppid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -755,6 +763,7 @@ sub runhttpsserver {
+ my $STATUS;
+ my $RUNNING;
+ my $ip = $HOSTIP;
++ my $pidfile = $HTTPSPIDFILE;
+
+ if(!$stunnel) {
+ return 0;
+@@ -765,7 +774,12 @@ sub runhttpsserver {
+ $ip = $HOST6IP;
+ }
+
+- my $pid=checkserver($HTTPSPIDFILE);
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
++ my $pid=checkserver($pidfile);
+
+ if($pid > 0) {
+ # kill previous stunnel!
+@@ -775,12 +789,13 @@ sub runhttpsserver {
+ my $flag=$debugprotocol?"-v ":"";
+ my $cmd="$perl $srcdir/httpsserver.pl $flag -p https -s \"$stunnel\" -d $srcdir -r $HTTPPORT $HTTPSPORT";
+
+- my ($httpspid, $pid2) = startnew($cmd, $HTTPSPIDFILE,0);
++ my ($httpspid, $pid2) = startnew($cmd, $pidfile,0);
+
+ if($httpspid <= 0 || !kill(0, $httpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the HTTPS server\n";
+ stopservers($verbose);
++ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+@@ -789,6 +804,7 @@ sub runhttpsserver {
+ logmsg "RUN: HTTPS server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$httpspid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -823,6 +839,11 @@ sub runftpserver {
+ $nameext="-ipv6";
+ }
+
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
+ my $pid = checkserver($pidfile);
+ if($pid >= 0) {
+ stopserver($pid);
+@@ -850,7 +871,8 @@ sub runftpserver {
+ if($ftppid <= 0 || !kill(0, $ftppid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the FTP$id$nameext server\n";
+- return -1;
++ $doesntrun{$pidfile} = 1;
++ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+@@ -858,6 +880,7 @@ sub runftpserver {
+ logmsg "RUN: FTP$id$nameext server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$ftppid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -878,6 +901,7 @@ sub runftpsserver {
+ my $STATUS;
+ my $RUNNING;
+ my $ip = $HOSTIP;
++ my $pidfile = $FTPSPIDFILE;
+
+ if(!$stunnel) {
+ return 0;
+@@ -888,7 +912,12 @@ sub runftpsserver {
+ $ip = $HOST6IP;
+ }
+
+- my $pid=checkserver($FTPSPIDFILE);
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
++ my $pid=checkserver($pidfile);
+
+ if($pid > 0) {
+ # kill previous stunnel!
+@@ -898,12 +927,13 @@ sub runftpsserver {
+ my $flag=$debugprotocol?"-v ":"";
+ my $cmd="$perl $srcdir/httpsserver.pl $flag -p ftps -s \"$stunnel\" -d $srcdir -r $FTPPORT $FTPSPORT";
+
+- my ($ftpspid, $pid2) = startnew($cmd, $FTPSPIDFILE,0);
++ my ($ftpspid, $pid2) = startnew($cmd, $pidfile,0);
+
+ if($ftpspid <= 0 || !kill(0, $ftpspid)) {
+ # it is NOT alive
+ logmsg "RUN: failed to start the FTPS server\n";
+ stopservers($verbose);
++ $doesntrun{$pidfile} = 1;
+ return(0,0);
+ }
+
+@@ -912,6 +942,7 @@ sub runftpsserver {
+ logmsg "RUN: FTPS server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$ftpspid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -946,6 +977,11 @@ sub runtftpserver {
+ $nameext="-ipv6";
+ }
+
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
+ my $pid = checkserver($pidfile);
+ if($pid >= 0) {
+ stopserver($pid);
+@@ -968,8 +1004,9 @@ sub runtftpserver {
+
+ if($tftppid <= 0 || !kill(0, $tftppid)) {
+ # it is NOT alive
+- logmsg "RUN: failed to start the FTP$id$nameext server\n";
+- return -1;
++ logmsg "RUN: failed to start the TFTP$id$nameext server\n";
++ $doesntrun{$pidfile} = 1;
++ return (0,0);
+ }
+
+ # Server is up. Verify that we can speak to it.
+@@ -977,6 +1014,7 @@ sub runtftpserver {
+ logmsg "RUN: TFTP$id$nameext server failed verification\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$tftppid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+@@ -999,6 +1037,11 @@ sub runsshserver {
+ my $port = $SSHPORT;
+ my $pidfile = $SSHPIDFILE;
+
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
+ my $pid = checkserver($pidfile);
+ if($pid > 0) {
+ stopserver($pid);
+@@ -1014,11 +1057,13 @@ sub runsshserver {
+ logmsg "RUN: failed to start the SSH server\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$sshpid $pid2");
+- return -1;
++ $doesntrun{$pidfile} = 1;
++ return (0,0);
+ }
+
+ if (!verifyserver('ssh',$ip,$port)) {
+ logmsg "RUN: SSH server failed verification\n";
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ if($verbose) {
+@@ -1037,6 +1082,11 @@ sub runsocksserver {
+ my $port = $SOCKSPORT;
+ my $pidfile = $SOCKSPIDFILE;
+
++ # don't retry if the server doesn't work
++ if ($doesntrun{$pidfile}) {
++ return (0,0);
++ }
++
+ my $flag=$debugprotocol?"-v ":"";
+ my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} -vv >log/ssh.log 2>&1";
+ my ($sshpid, $pid2) =
+@@ -1047,12 +1097,14 @@ sub runsocksserver {
+ logmsg "RUN: failed to start the SOCKS server\n";
+ # failed to talk to it properly. Kill the server and return failure
+ stopserver("$sshpid $pid2");
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+
+ # Ugly hack but ssh doesn't support pid files
+ if (!verifyserver('socks',$ip,$port)) {
+ logmsg "RUN: SOCKS server failed verification\n";
++ $doesntrun{$pidfile} = 1;
+ return (0,0);
+ }
+ if($verbose) {
diff --git a/curl-testsuite-safely-skip-http-ipv6.patch b/curl-testsuite-safely-skip-http-ipv6.patch
new file mode 100644
index 0000000..6f831fe
--- /dev/null
+++ b/curl-testsuite-safely-skip-http-ipv6.patch
@@ -0,0 +1,18 @@
+If starting the http-ipv6 server fails, just skip that test like runftpserver()
+does. Also fix the log message in that case.
+---
+ tests/runtests.pl | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- tests/runtests.pl.orig
++++ tests/runtests.pl
+@@ -726,8 +726,7 @@ sub runhttpserver {
+
+ if($httppid <= 0 || !kill(0, $httppid)) {
+ # it is NOT alive
+- logmsg "RUN: failed to start the HTTP server\n";
+- stopservers($verbose);
++ logmsg "RUN: failed to start the HTTP$nameext server\n";
+ return (0,0);
+ }
+
diff --git a/curl.changes b/curl.changes
index 5949846..cffe6a5 100644
--- a/curl.changes
+++ b/curl.changes
@@ -1,3 +1,11 @@
+-------------------------------------------------------------------
+Fri Nov 16 12:06:39 CET 2007 - mmarek@suse.cz
+
+- fixed the testsuite on hosts that have no IPv6 support [#341994]
+ curl-testsuite-safely-skip-http-ipv6.patch
+ curl-testsuite-remember-broken-servers.patch
+- added stunnel to BuildRequires to enable SSL tests
+
-------------------------------------------------------------------
Tue Oct 30 09:14:04 CET 2007 - mmarek@suse.cz
diff --git a/curl.spec b/curl.spec
index 0da5cb1..eec6b7b 100644
--- a/curl.spec
+++ b/curl.spec
@@ -11,16 +11,19 @@
# norootforbuild
Name: curl
-BuildRequires: libidn-devel libopenssl-devel openldap2-devel zlib-devel
+BuildRequires: libidn-devel openldap2-devel openssl-devel zlib-devel
+# used by the testsuite
+BuildRequires: stunnel
Version: 7.17.1
-Release: 1
+Release: 5
AutoReqProv: on
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
-Patch2: curl-ipv6tests.patch
+Patch1: curl-testsuite-safely-skip-http-ipv6.patch
+Patch2: curl-testsuite-remember-broken-servers.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -84,6 +87,7 @@ Authors:
%prep
%setup -q
+%patch1
%patch2
%build
@@ -93,8 +97,6 @@ export CFLAGS="$RPM_OPT_FLAGS"
%else
export CFLAGS="$RPM_OPT_FLAGS -fstack-protector"
%endif
-# cleanup notice: removed the debugging option %_with_testsuite here,
-# removing it does not change the build configuration and make check:
./configure \
--prefix=%{_prefix} \
--enable-ipv6 \
@@ -155,6 +157,11 @@ rm -rf $RPM_BUILD_ROOT
%doc %{_mandir}/man1/curl-config.1.gz
%doc %{_mandir}/man3/*
%changelog
+* Fri Nov 16 2007 - mmarek@suse.cz
+- fixed the testsuite on hosts that have no IPv6 support [#341994]
+ curl-testsuite-safely-skip-http-ipv6.patch
+ curl-testsuite-remember-broken-servers.patch
+- added stunnel to BuildRequires to enable SSL tests
* Tue Oct 30 2007 - mmarek@suse.cz
- updated to 7.17.1
* automatically append ";type=" when using HTTP proxies for