Index: contrib/crossrpms/rtems4.10/arm/rtems-4.10-arm-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/arm/rtems-4.10-arm-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/arm/rtems-4.10-arm-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/avr/rtems-4.10-avr-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/avr/rtems-4.10-avr-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/avr/rtems-4.10-avr-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/bfin/rtems-4.10-bfin-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -133,8 +140,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -153,7 +158,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/h8300/rtems-4.10-h8300-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/h8300/rtems-4.10-h8300-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/h8300/rtems-4.10-h8300-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/i386/rtems-4.10-i386-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/i386/rtems-4.10-i386-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/i386/rtems-4.10-i386-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/lm32/rtems-4.10-lm32-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/lm32/rtems-4.10-lm32-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/lm32/rtems-4.10-lm32-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/m32c/rtems-4.10-m32c-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/m32r/rtems-4.10-m32r-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/m32r/rtems-4.10-m32r-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/m32r/rtems-4.10-m32r-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/m68k/rtems-4.10-m68k-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/m68k/rtems-4.10-m68k-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/m68k/rtems-4.10-m68k-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/mips/rtems-4.10-mips-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/mips/rtems-4.10-mips-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/mips/rtems-4.10-mips-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/mipstx39/rtems-4.10-mipstx39-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/mipstx39/rtems-4.10-mipstx39-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/mipstx39/rtems-4.10-mipstx39-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/powerpc/rtems-4.10-powerpc-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/sh/rtems-4.10-sh-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
Index: contrib/crossrpms/rtems4.10/sparc/rtems-4.10-sparc-rtems4.10-gdb.spec
===================================================================
--- contrib/crossrpms/rtems4.10/sparc/rtems-4.10-sparc-rtems4.10-gdb.spec	(revision 6d41d1865268de0e5cb0a74843941abb8e6e50db)
+++ contrib/crossrpms/rtems4.10/sparc/rtems-4.10-sparc-rtems4.10-gdb.spec	(revision c74285e50cd083e43970ce0fceaeedb97c4138f4)
@@ -53,5 +53,5 @@
 Group:		Development/Tools
 Version:	%{gdb_rpmvers}
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	GPL/LGPL
 URL: 		http://sources.redhat.com/gdb
@@ -103,6 +103,13 @@
 BuildRequires:  %{_host_rpmprefix}termcap-devel
 %endif
-%endif
-BuildRequires:  %{_host_rpmprefix}readline-devel
+%bcond_with system_readline
+%endif
+
+%if 0%{?fedora} >= 12
+%bcond_with system_readline
+%else
+%bcond_without system_readline
+%endif
+%{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel}
 BuildRequires:  %{_host_rpmprefix}ncurses-devel
 
@@ -125,7 +132,7 @@
 
 # A copy of a gdb development snapshot having been retrieved from
-# ftp://sources.redhat.com/pub/gdb/snapshots/current/gdb-%{gdb_version}.tar.bz2
+# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{gdb_version}.tar.bz2
 Source0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}.tar.bz2
-Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090917.diff
+Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.10/gdb-%{gdb_version}-rtems4.10-20090918.diff
 
 %description
@@ -139,8 +146,6 @@
 cd ..
 
-%if "%{gdb_version}" >= "6.7"
 # Force using a system-provided libreadline
-rm -f gdb-%{gdb_version}/readline/configure
-%endif
+%{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure}
 %build
   export PATH="%{_bindir}:${PATH}"
@@ -159,7 +164,5 @@
     --disable-werror \
     %{build_sim} \
-%if "%{gdb_version}" >= "6.7"
-    --with-system-readline \
-%endif
+    %{?with_system_readline:--with-system-readline} \
 %if "%{gdb_version}" >= "6.6"
     --with-expat \
