summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-05-13 23:26:09 +1000
committerChris Johns <chrisj@rtems.org>2014-05-13 23:26:09 +1000
commit9a15c40e1b2ac56a678e79519e1e78160009af92 (patch)
tree308f3f407a06c4073612b813d4d40ed0c5c5c60e
parent4.11/rtems-lm32: Use gcc-4.9.0 and fix gdb simulator build on Windows. (diff)
downloadrtems-source-builder-9a15c40e1b2ac56a678e79519e1e78160009af92.tar.bz2
sb: Implement %source and %patch to manage source and patches.
Remove the numbered source and patches and automatically manage sources and patches. This removes the overhead in maintaining large collections of patches.
-rw-r--r--rtems/config/4.10/rtems-bfin.bset2
-rw-r--r--rtems/config/4.11/rtems-lm32.bset2
-rw-r--r--rtems/config/4.11/rtems-microblaze.bset4
-rw-r--r--rtems/config/4.11/rtems-sparc.bset2
-rw-r--r--rtems/config/4.11/rtems-v850.bset2
-rw-r--r--rtems/config/rtems-binutils-patches.cfg27
-rw-r--r--rtems/config/rtems-gcc-patches.cfg51
-rw-r--r--rtems/config/rtems-gdb-patches.cfg27
-rw-r--r--rtems/config/tools/rtems-binutils-2.20.1-1.cfg9
-rw-r--r--rtems/config/tools/rtems-binutils-2.22-1.cfg3
-rw-r--r--rtems/config/tools/rtems-binutils-2.23.1-1.cfg5
-rw-r--r--rtems/config/tools/rtems-binutils-2.23.2-1.cfg5
-rw-r--r--rtems/config/tools/rtems-binutils-2.24-1.cfg5
-rw-r--r--rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg13
-rw-r--r--rtems/config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1.cfg7
-rw-r--r--rtems/config/tools/rtems-gcc-4.5.3-newlib-2.0.0-1.cfg3
-rw-r--r--rtems/config/tools/rtems-gcc-4.5.3-newlib-2.1.0-1.cfg3
-rw-r--r--rtems/config/tools/rtems-gcc-4.6.3-newlib-1.20.0-1.cfg4
-rw-r--r--rtems/config/tools/rtems-gcc-4.7.2-newlib-1.20.0-1.cfg5
-rw-r--r--rtems/config/tools/rtems-gcc-4.7.2-newlib-2.0.0-1.cfg3
-rw-r--r--rtems/config/tools/rtems-gcc-4.7.3-newlib-2.0.0-1.cfg3
-rw-r--r--rtems/config/tools/rtems-gcc-4.8-ss-newlib-2.0.0-1.cfg2
-rw-r--r--rtems/config/tools/rtems-gcc-4.8.0-newlib-cvs-1.cfg10
-rw-r--r--rtems/config/tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg14
-rw-r--r--rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-1.cfg11
-rw-r--r--rtems/config/tools/rtems-gcc-4.8.2-newlib-cvs-1.cfg12
-rw-r--r--rtems/config/tools/rtems-gcc-4.9.0-newlib-2.1.0-1.cfg9
-rw-r--r--rtems/config/tools/rtems-gdb-6.8-1.cfg6
-rw-r--r--rtems/config/tools/rtems-gdb-7.3.1-1.cfg7
-rw-r--r--rtems/config/tools/rtems-gdb-7.5-1.cfg3
-rw-r--r--rtems/config/tools/rtems-gdb-7.5.1-1.cfg5
-rw-r--r--rtems/config/tools/rtems-gdb-7.6-1.cfg5
-rw-r--r--rtems/config/tools/rtems-gdb-7.6.1-1.cfg5
-rw-r--r--rtems/config/tools/rtems-gdb-7.6.2-1.cfg8
-rw-r--r--rtems/config/tools/rtems-gdb-7.7-1.cfg12
-rw-r--r--rtems/config/tools/rtems-kernel-4-1.cfg23
-rw-r--r--rtems/config/tools/rtems-kernel-4.11.cfg2
-rw-r--r--rtems/config/tools/rtems-nios2-binutils-2.20-1.cfg4
-rw-r--r--rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg65
-rw-r--r--rtems/config/tools/rtems-nios2-gdb-7.0-1.cfg2
-rw-r--r--source-builder/config/autoconf-2-1.cfg7
-rw-r--r--source-builder/config/automake-1-1.cfg7
-rw-r--r--source-builder/config/binutils-2-1.cfg22
-rw-r--r--source-builder/config/dtc-1-1.cfg13
-rw-r--r--source-builder/config/expat-2-1.cfg6
-rw-r--r--source-builder/config/gcc-4.3-1.cfg14
-rw-r--r--source-builder/config/gcc-4.4-1.cfg14
-rw-r--r--source-builder/config/gcc-4.5-1.cfg20
-rw-r--r--source-builder/config/gcc-4.6-1.cfg14
-rw-r--r--source-builder/config/gcc-4.7-1.cfg14
-rw-r--r--source-builder/config/gcc-4.8-1.cfg20
-rw-r--r--source-builder/config/gcc-4.9-1.cfg20
-rw-r--r--source-builder/config/gcc-common-1.cfg90
-rw-r--r--source-builder/config/gdb-6-1.cfg18
-rw-r--r--source-builder/config/gdb-7-1.cfg22
-rw-r--r--source-builder/config/gettext-0-1.cfg19
-rw-r--r--source-builder/config/glib-2-1.cfg19
-rw-r--r--source-builder/config/libffi-3-1.cfg19
-rw-r--r--source-builder/config/libiconv-1-1.cfg19
-rw-r--r--source-builder/config/libtool-2-1.cfg7
-rw-r--r--source-builder/config/libusb-1-1.cfg12
-rw-r--r--source-builder/config/m4-1-1.cfg10
-rw-r--r--source-builder/config/pixman-0-1.cfg19
-rw-r--r--source-builder/config/qemu-1-1.cfg19
-rw-r--r--source-builder/sb/build.py232
-rw-r--r--source-builder/sb/config.py12
-rw-r--r--source-builder/sb/download.py7
-rw-r--r--source-builder/sb/macros.py48
-rw-r--r--source-builder/sb/setbuilder.py8
-rw-r--r--source-builder/sb/sources.py74
-rw-r--r--source-builder/sb/version.py2
71 files changed, 483 insertions, 734 deletions
diff --git a/rtems/config/4.10/rtems-bfin.bset b/rtems/config/4.10/rtems-bfin.bset
index 4024292..24887d1 100644
--- a/rtems/config/4.10/rtems-bfin.bset
+++ b/rtems/config/4.10/rtems-bfin.bset
@@ -20,7 +20,7 @@
#
# GDB simulator fix for the sed command.
#
-%define rtems_gdb_patch2 %{rtems_gdb_patches}/bfin/gdb-7.3.1-bfin-sim-fix-sed-20130319.diff
+%patch add gdb %{rtems_gdb_patches}/bfin/gdb-7.3.1-bfin-sim-fix-sed-20130319.diff
#
# Tools configuration.
diff --git a/rtems/config/4.11/rtems-lm32.bset b/rtems/config/4.11/rtems-lm32.bset
index a6d5622..da79cd4 100644
--- a/rtems/config/4.11/rtems-lm32.bset
+++ b/rtems/config/4.11/rtems-lm32.bset
@@ -20,7 +20,7 @@
#
# Fix the simulator UART interface.
#
-%define rtems_gdb_patch3 %{rtems_gdb_patches}/lm32/gdb-sim-lm32uart.diff
+%patch add gdb %{rtems_gdb_patches}/lm32/gdb-sim-lm32uart.diff
#
# Tools configuration.
diff --git a/rtems/config/4.11/rtems-microblaze.bset b/rtems/config/4.11/rtems-microblaze.bset
index 067e272..97b2638 100644
--- a/rtems/config/4.11/rtems-microblaze.bset
+++ b/rtems/config/4.11/rtems-microblaze.bset
@@ -20,12 +20,12 @@
#
# GCC 4.7.2 Microblaze Patch
#
-%define rtems_gcc_patch2 %{rtems_gcc_patches}/microblaze/gcc-4.7.2-microblaze-ldscript-2.diff
+%patch add gcc %{rtems_gcc_patches}/microblaze/gcc-4.7.2-microblaze-ldscript-2.diff
#
# GCC 4.8.2 Microblaze Patch for libgcc.
#
-%define rtems_gcc_patch3 %{rtems_gcc_patches}/microblaze/rtems-gcc-microblaze-libgcc-20131017.diff
+%patch add gcc %{rtems_gcc_patches}/microblaze/rtems-gcc-microblaze-libgcc-20131017.diff
#
# Tools configuration.
diff --git a/rtems/config/4.11/rtems-sparc.bset b/rtems/config/4.11/rtems-sparc.bset
index f80d402..d4c842c 100644
--- a/rtems/config/4.11/rtems-sparc.bset
+++ b/rtems/config/4.11/rtems-sparc.bset
@@ -20,7 +20,7 @@
#
# GDB patche
#
-%define rtems_gdb_patch1 %{rtems_gdb_patches}/sparc/gdb-7.6.2-sis-output-nouartrx.diff
+%patch add gdb %{rtems_gdb_patches}/sparc/gdb-7.6.2-sis-output-nouartrx.diff
#
# Tools configuration.
diff --git a/rtems/config/4.11/rtems-v850.bset b/rtems/config/4.11/rtems-v850.bset
index 8e3abab..1d0ac6c 100644
--- a/rtems/config/4.11/rtems-v850.bset
+++ b/rtems/config/4.11/rtems-v850.bset
@@ -20,7 +20,7 @@
#
# GCC 4.8 V850 Patch
#
-%define rtems_gcc_patch3 %{rtems_gcc_patches}/v850/gcc-4.8.2-rtems4.11-20140349.diff
+%patch add gcc %{rtems_gcc_patches}/v850/gcc-4.8.2-rtems4.11-20140349.diff
#
# Tools configuration.
diff --git a/rtems/config/rtems-binutils-patches.cfg b/rtems/config/rtems-binutils-patches.cfg
deleted file mode 100644
index b9d85c2..0000000
--- a/rtems/config/rtems-binutils-patches.cfg
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Manage RTEMS Binutils specific patches in the build sets
-#
-%if %{defined rtems_binutils_patch1}
- Patch1: %{rtems_binutils_patch1}
-%endif
-%if %{defined rtems_binutils_patch2}
- Patch2: %{rtems_binutils_patch2}
-%endif
-%if %{defined rtems_binutils_patch3}
- Patch3: %{rtems_binutils_patch3}
-%endif
-%if %{defined rtems_binutils_patch4}
- Patch4: %{rtems_binutils_patch4}
-%endif
-%if %{defined rtems_binutils_patch11}
- Patch11: %{rtems_binutils_patch11}
-%endif
-%if %{defined rtems_binutils_patch12}
- Patch12: %{rtems_binutils_patch12}
-%endif
-%if %{defined rtems_binutils_patch13}
- Patch13: %{rtems_binutils_patch13}
-%endif
-%if %{defined rtems_binutils_patch14}
- Patch14: %{rtems_binutils_patch14}
-%endif
diff --git a/rtems/config/rtems-gcc-patches.cfg b/rtems/config/rtems-gcc-patches.cfg
deleted file mode 100644
index 82568c9..0000000
--- a/rtems/config/rtems-gcc-patches.cfg
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Manage RTEMS GCC/Newlib specific patches in the build sets
-#
-%if %{defined rtems_gcc_patch1}
- Patch1: %{rtems_gcc_patch1}
- %if %{defined rtems_gcc_patch1_opts}
- %define patch1_opts %{rtems_gcc_patch1_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch2}
- Patch2: %{rtems_gcc_patch2}
- %if %{defined rtems_gcc_patch2_opts}
- %define patch2_opts %{rtems_gcc_patch2_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch3}
- Patch3: %{rtems_gcc_patch3}
- %if %{defined rtems_gcc_patch3_opts}
- %define patch3_opts %{rtems_gcc_patch3_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch4}
- Patch4: %{rtems_gcc_patch4}
- %if %{defined rtems_gcc_patch4_opts}
- %define patch4_opts %{rtems_gcc_patch4_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch11}
- Patch11: %{rtems_gcc_patch11}
- %if %{defined rtems_gcc_patch11_opts}
- %define patch11_opts %{rtems_gcc_patch11_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch12}
- Patch12: %{rtems_gcc_patch12}
- %if %{defined rtems_gcc_patch12_opts}
- %define patch12_opts %{rtems_gcc_patch12_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch13}
- Patch13: %{rtems_gcc_patch13}
- %if %{defined rtems_gcc_patch13_opts}
- %define patch13_opts %{rtems_gcc_patch13_opts}
- %endif
-%endif
-%if %{defined rtems_gcc_patch14}
- Patch14: %{rtems_gcc_patch14}
- %if %{defined rtems_gcc_patch14_opts}
- %define patch14_opts %{rtems_gcc_patch14_opts}
- %endif
-%endif
diff --git a/rtems/config/rtems-gdb-patches.cfg b/rtems/config/rtems-gdb-patches.cfg
deleted file mode 100644
index e6a72d8..0000000
--- a/rtems/config/rtems-gdb-patches.cfg
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Manage RTEMS GDB specific patches in the build sets
-#
-%if %{defined rtems_gdb_patch1}
- Patch1: %{rtems_gdb_patch1}
-%endif
-%if %{defined rtems_gdb_patch2}
- Patch2: %{rtems_gdb_patch2}
-%endif
-%if %{defined rtems_gdb_patch3}
- Patch3: %{rtems_gdb_patch3}
-%endif
-%if %{defined rtems_gdb_patch4}
- Patch4: %{rtems_gdb_patch4}
-%endif
-%if %{defined rtems_gdb_patch11}
- Patch11: %{rtems_gdb_patch11}
-%endif
-%if %{defined rtems_gdb_patch12}
- Patch12: %{rtems_gdb_patch12}
-%endif
-%if %{defined rtems_gdb_patch13}
- Patch13: %{rtems_gdb_patch13}
-%endif
-%if %{defined rtems_gdb_patch14}
- Patch14: %{rtems_gdb_patch14}
-%endif
diff --git a/rtems/config/tools/rtems-binutils-2.20.1-1.cfg b/rtems/config/tools/rtems-binutils-2.20.1-1.cfg
index 172d2b2..b721a10 100644
--- a/rtems/config/tools/rtems-binutils-2.20.1-1.cfg
+++ b/rtems/config/tools/rtems-binutils-2.20.1-1.cfg
@@ -7,17 +7,12 @@
%define binutils_version 2.20.1
-Patch0: %{rtems_binutils_patches}/binutils-2.20.1-rtems4.10-20100826.diff
+%patch add binutils %{rtems_binutils_patches}/binutils-2.20.1-rtems4.10-20100826.diff
%ifos win32 mingw ming32 cygwin
- Patch1: %{rtems_binutils_patches}/cygwin/binutils-2.20.1-cygwin-w64-20130324.diff
+ %patch add binutils %{rtems_binutils_patches}/cygwin/binutils-2.20.1-cygwin-w64-20130324.diff
%endif
#
-# RTEMS Build Set patches.
-#
-%include rtems-binutils-patches.cfg
-
-#
# The binutils build instructions. We use 2.xx Release 1.
#
%include %{_configdir}/binutils-2-1.cfg
diff --git a/rtems/config/tools/rtems-binutils-2.22-1.cfg b/rtems/config/tools/rtems-binutils-2.22-1.cfg
index aaeaf3e..664f5d9 100644
--- a/rtems/config/tools/rtems-binutils-2.22-1.cfg
+++ b/rtems/config/tools/rtems-binutils-2.22-1.cfg
@@ -7,8 +7,7 @@
%define binutils_version 2.22
-Patch0: %{rtems_binutils_patches}/binutils-2.22-rtems4.11-20120427.diff
-%include rtems-binutils-patches.cfg
+%patch add binutils %{rtems_binutils_patches}/binutils-2.22-rtems4.11-20120427.diff
#
# The binutils build instructions. We use 2.xx Release 1.
diff --git a/rtems/config/tools/rtems-binutils-2.23.1-1.cfg b/rtems/config/tools/rtems-binutils-2.23.1-1.cfg
index cfa904c..4f39a6b 100644
--- a/rtems/config/tools/rtems-binutils-2.23.1-1.cfg
+++ b/rtems/config/tools/rtems-binutils-2.23.1-1.cfg
@@ -15,11 +15,6 @@
%define with_deterministic_archives 1
#
-# Include the RTEMS specific patches
-#
-%include rtems-binutils-patches.cfg
-
-#
# The binutils build instructions. We use 2.xx Release 1.
#
%include %{_configdir}/binutils-2-1.cfg
diff --git a/rtems/config/tools/rtems-binutils-2.23.2-1.cfg b/rtems/config/tools/rtems-binutils-2.23.2-1.cfg
index f1b5079..d4f2c4b 100644
--- a/rtems/config/tools/rtems-binutils-2.23.2-1.cfg
+++ b/rtems/config/tools/rtems-binutils-2.23.2-1.cfg
@@ -15,11 +15,6 @@
%define with_deterministic_archives 1
#
-# Include the RTEMS specific patches
-#
-%include rtems-binutils-patches.cfg
-
-#
# The binutils build instructions. We use 2.xx Release 1.
#
%include %{_configdir}/binutils-2-1.cfg
diff --git a/rtems/config/tools/rtems-binutils-2.24-1.cfg b/rtems/config/tools/rtems-binutils-2.24-1.cfg
index 847680a..60cd982 100644
--- a/rtems/config/tools/rtems-binutils-2.24-1.cfg
+++ b/rtems/config/tools/rtems-binutils-2.24-1.cfg
@@ -15,11 +15,6 @@
%define with_deterministic_archives 1
#
-# Include the RTEMS specific patches
-#
-%include rtems-binutils-patches.cfg
-
-#
# The binutils build instructions. We use 2.xx Release 1.
#
%include %{_configdir}/binutils-2-1.cfg
diff --git a/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg b/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg
index f115447..12a8003 100644
--- a/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.3.2-newlib-1.16.0-1.cfg
@@ -18,15 +18,10 @@
#
# The RTEMS 4.9 patches
#
-Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
-Patch0: %{rtems_gcc_patches}/gcc-core-4.3.2-rtems4.9-20090825.diff
-Source1: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.bz2
-Patch10: %{rtems_newlib_patches}/newlib-1.16.0-rtems4.9-20090324.diff
-
-#
-# Generic RTEMS patch handling.
-#
-%include rtems-gcc-patches.cfg
+%source set gcc ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
+%patch add gcc %{rtems_gcc_patches}/gcc-core-4.3.2-rtems4.9-20090825.diff
+%source add gcc ftp://ftp.gnu.org/pub/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.bz2
+%patch add gcc %{rtems_newlib_patches}/newlib-1.16.0-rtems4.9-20090324.diff
#
# The gcc/newlib build instructions. We use 4.7 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1.cfg b/rtems/config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1.cfg
index 6035486..d240aa7 100644
--- a/rtems/config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.4.7-newlib-1.18.0-1.cfg
@@ -26,12 +26,11 @@
#
# The RTEMS 4.10 patches
#
-Patch0: %{rtems_gcc_patches}/gcc-core-4.4.7-rtems4.10-20120314.diff
+%patch add gcc %{rtems_gcc_patches}/gcc-core-4.4.7-rtems4.10-20120314.diff
%if %{enable_cxx}
-Patch1: %{rtems_gcc_patches}/gcc-g++-4.4.7-rtems4.10-20120314.diff
+ %patch add gcc %{rtems_gcc_patches}/gcc-g++-4.4.7-rtems4.10-20120314.diff
%endif
-Patch10: %{rtems_newlib_patches}/newlib-1.18.0-rtems4.10-20110518.diff
-%include rtems-gcc-patches.cfg
+%patch add newlib %{rtems_newlib_patches}/newlib-1.18.0-rtems4.10-20110518.diff
#
# The gcc/newlib build instructions. We use 4.4 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.0.0-1.cfg b/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.0.0-1.cfg
index 41c0fe1..0f5d225 100644
--- a/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.0.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.0.0-1.cfg
@@ -18,8 +18,7 @@
#
# Libiberty strsignal fix
#
-Patch0: %{rtems_gcc_patches}/gcc-4.5.3-strsignal-1.diff
-%include rtems-gcc-patches.cfg
+%patch add gcc %{rtems_gcc_patches}/gcc-4.5.3-strsignal-1.diff
#
# The gcc/newlib build instructions. We use 4.5 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.1.0-1.cfg b/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.1.0-1.cfg
index aad4679..668e356 100644
--- a/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.1.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.5.3-newlib-2.1.0-1.cfg
@@ -18,8 +18,7 @@
#
# Libiberty strsignal fix
#
-Patch0: %{rtems_gcc_patches}/gcc-4.5.3-strsignal-1.diff
-%include rtems-gcc-patches.cfg
+%patch add gcc %{rtems_gcc_patches}/gcc-4.5.3-strsignal-1.diff
#
# The gcc/newlib build instructions. We use 4.5 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.6.3-newlib-1.20.0-1.cfg b/rtems/config/tools/rtems-gcc-4.6.3-newlib-1.20.0-1.cfg
index 8a73626..9d63a92 100644
--- a/rtems/config/tools/rtems-gcc-4.6.3-newlib-1.20.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.6.3-newlib-1.20.0-1.cfg
@@ -34,8 +34,8 @@
#
# The RTEMS 4.11 patches
#
-Patch0: gcc-core-4.6.3-rtems4.11-20120303.diff
-Patch10: newlib-1.20.0-rtems4.11-20121011.diff
+%patch add gcc gcc-core-4.6.3-rtems4.11-20120303.diff
+%patch add newlib newlib-1.20.0-rtems4.11-20121011.diff
#
# The gcc/newlib build instructions. We use 4.4 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.7.2-newlib-1.20.0-1.cfg b/rtems/config/tools/rtems-gcc-4.7.2-newlib-1.20.0-1.cfg
index 18bb1b7..167d7c5 100644
--- a/rtems/config/tools/rtems-gcc-4.7.2-newlib-1.20.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.7.2-newlib-1.20.0-1.cfg
@@ -43,9 +43,8 @@
#
# The RTEMS 4.11 patches
#
-Patch0: %{rtems_gcc_patches}/gcc-4.7.2-rtems4.11-20121026.diff
-Patch10: %{rtems_newlib_patches}/newlib-1.20.0-rtems4.11-20121011.diff
-%include rtems-gcc-patches.cfg
+%patch add gcc %{rtems_gcc_patches}/gcc-4.7.2-rtems4.11-20121026.diff
+%patch add newlib %{rtems_newlib_patches}/newlib-1.20.0-rtems4.11-20121011.diff
#
# The gcc/newlib build instructions. We use 4.7 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.7.2-newlib-2.0.0-1.cfg b/rtems/config/tools/rtems-gcc-4.7.2-newlib-2.0.0-1.cfg
index 5d1d3d4..8914815 100644
--- a/rtems/config/tools/rtems-gcc-4.7.2-newlib-2.0.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.7.2-newlib-2.0.0-1.cfg
@@ -19,8 +19,7 @@
#
# The RTEMS 4.11 patches
#
-Patch0: %{rtems_gcc_patches}/gcc-4.7.2-rtems4.11-20121026.diff
-%include rtems-gcc-patches.cfg
+%patch add gcc %{rtems_gcc_patches}/gcc-4.7.2-rtems4.11-20121026.diff
# Incompatible with Texinfo 5
%if %{__makeinfo_ver} >= 5.0
diff --git a/rtems/config/tools/rtems-gcc-4.7.3-newlib-2.0.0-1.cfg b/rtems/config/tools/rtems-gcc-4.7.3-newlib-2.0.0-1.cfg
index 37f123a..518e28b 100644
--- a/rtems/config/tools/rtems-gcc-4.7.3-newlib-2.0.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.7.3-newlib-2.0.0-1.cfg
@@ -19,8 +19,7 @@
#
# The RTEMS 4.11 patches
#
-Patch0: %{rtems_gcc_patches}/gcc-4.7.3-rtems4.11-20130414.diff
-%include rtems-gcc-patches.cfg
+%patch add gcc %{rtems_gcc_patches}/gcc-4.7.3-rtems4.11-20130414.diff
# Incompatible with Texinfo 5
%if %{__makeinfo_ver} >= 5.0
diff --git a/rtems/config/tools/rtems-gcc-4.8-ss-newlib-2.0.0-1.cfg b/rtems/config/tools/rtems-gcc-4.8-ss-newlib-2.0.0-1.cfg
index 082fb66..0fd1641 100644
--- a/rtems/config/tools/rtems-gcc-4.8-ss-newlib-2.0.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.8-ss-newlib-2.0.0-1.cfg
@@ -18,7 +18,7 @@
#
# The RTEMS 4.11 patches
#
-Source0: ftp://gcc.gnu.org/pub/gcc/snapshots/%{gcc_version}/gcc-%{gcc_version}.tar.bz2
+%source set gcc ftp://gcc.gnu.org/pub/gcc/snapshots/%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# The gcc/newlib build instructions. We use 4.7 Release 1.
diff --git a/rtems/config/tools/rtems-gcc-4.8.0-newlib-cvs-1.cfg b/rtems/config/tools/rtems-gcc-4.8.0-newlib-cvs-1.cfg
index a243409..7c545fd 100644
--- a/rtems/config/tools/rtems-gcc-4.8.0-newlib-cvs-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.8.0-newlib-cvs-1.cfg
@@ -24,20 +24,14 @@
#
# Newlib is from CVS.
#
-Source10: cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
+%source set newlib cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
#
# Joel's stack_t patch.
#
-%define rtems_gcc_patch11 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
-%define rtems_gcc_patch11_opts -p0
+%patch add newlib -p0 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
#
-#
-# Manage RTEMS patches
-#
-%include rtems-gcc-patches.cfg
-
# The gcc/newlib build instructions. We use 4.8 Release 1.
#
%include %{_configdir}/gcc-4.8-1.cfg
diff --git a/rtems/config/tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg b/rtems/config/tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg
index d1cca38..32c6547 100644
--- a/rtems/config/tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.8.1-newlib-cvs-1.cfg
@@ -27,30 +27,24 @@
#
# Newlib is from CVS.
#
-Source10: cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
+%source set newlib cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
#
# Sebastian's atexit patch.
#
-%define rtems_gcc_patch1 %{rtems_gcc_patches}/gcc-4.8.1-rtems4.11-20130709.diff
+%patch add gcc %{rtems_gcc_patches}/gcc-4.8.1-rtems4.11-20130709.diff
#
# Chris's patch to use the POSIX thread model for C++.
#
-%define rtems_gcc_patch2 %{rtems_gcc_patches}/gcc-rtems-thread-model-posix-1.diff
+%patch add gcc %{rtems_gcc_patches}/gcc-rtems-thread-model-posix-1.diff
#
# Joel's stack_t patch.
#
-%define rtems_gcc_patch11 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
-%define rtems_gcc_patch11_opts -p0
+%patch add newlib -p0 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
#
-#
-# Manage RTEMS patches
-#
-%include rtems-gcc-patches.cfg
-
# The gcc/newlib build instructions. We use 4.8 Release 1.
#
%include %{_configdir}/gcc-4.8-1.cfg
diff --git a/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-1.cfg b/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-1.cfg
index 20cf7aa..33821a9 100644
--- a/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.8.2-newlib-2.1.0-1.cfg
@@ -1,5 +1,5 @@
#
-# GCC 4.8.2., Newlib CVS
+# GCC 4.8.2., Newlib 2.1.0
#
%include %{_configdir}/checks.cfg
@@ -22,14 +22,7 @@
#
# Joel's stack_t patch.
#
-%define rtems_gcc_patch11 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
-%define rtems_gcc_patch11_opts -p0
-
-#
-#
-# Manage RTEMS patches
-#
-%include rtems-gcc-patches.cfg
+%patch add newlib -p0 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
# The gcc/newlib build instructions. We use 4.8 Release 1.
#
diff --git a/rtems/config/tools/rtems-gcc-4.8.2-newlib-cvs-1.cfg b/rtems/config/tools/rtems-gcc-4.8.2-newlib-cvs-1.cfg
index 4a5b642..ca62545 100644
--- a/rtems/config/tools/rtems-gcc-4.8.2-newlib-cvs-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.8.2-newlib-cvs-1.cfg
@@ -22,25 +22,19 @@
#
# Newlib is from CVS.
#
-Source10: cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
+%source set newlib cvs://pserver:anoncvs@sourceware.org/cvs/src?module=newlib?src-prefix=src?date=%{newlib_version}?reset
#
# Chris's patch to use the POSIX thread model for C++.
#
-%define rtems_gcc_patch2 %{rtems_gcc_patches}/gcc-rtems-thread-model-posix-1.diff
+%patch add gcc %{rtems_gcc_patches}/gcc-rtems-thread-model-posix-1.diff
#
# Joel's stack_t patch.
#
-%define rtems_gcc_patch11 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
-%define rtems_gcc_patch11_opts -p0
+%patch add newlib -p0 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
#
-#
-# Manage RTEMS patches
-#
-%include rtems-gcc-patches.cfg
-
# The gcc/newlib build instructions. We use 4.8 Release 1.
#
%include %{_configdir}/gcc-4.8-1.cfg
diff --git a/rtems/config/tools/rtems-gcc-4.9.0-newlib-2.1.0-1.cfg b/rtems/config/tools/rtems-gcc-4.9.0-newlib-2.1.0-1.cfg
index 00b426e..3d99702 100644
--- a/rtems/config/tools/rtems-gcc-4.9.0-newlib-2.1.0-1.cfg
+++ b/rtems/config/tools/rtems-gcc-4.9.0-newlib-2.1.0-1.cfg
@@ -22,14 +22,7 @@
#
# Joel's stack_t patch.
#
-%define rtems_gcc_patch11 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
-%define rtems_gcc_patch11_opts -p0
-
-#
-#
-# Manage RTEMS patches
-#
-%include rtems-gcc-patches.cfg
+%patch add newlib -p0 %{rtems_newlib_patches}/newlib-sys-signal-20130532.diff
#
# The gcc/newlib build instructions. We use 4.9 Release 1.
diff --git a/rtems/config/tools/rtems-gdb-6.8-1.cfg b/rtems/config/tools/rtems-gdb-6.8-1.cfg
index 49953b7..9159352 100644
--- a/rtems/config/tools/rtems-gdb-6.8-1.cfg
+++ b/rtems/config/tools/rtems-gdb-6.8-1.cfg
@@ -10,10 +10,8 @@
#
# RTEMS Build Set patches.
#
-Source0: http://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2
-Patch0: %{rtems_gdb_patches}/gdb-6.8-rtems4.9-20091111.diff
-
-%include rtems-gdb-patches.cfg
+%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2
+%patch add gdb %{rtems_gdb_patches}/gdb-6.8-rtems4.9-20091111.diff
#
# The gdb build instructions. We use 6.xx Release 1.
diff --git a/rtems/config/tools/rtems-gdb-7.3.1-1.cfg b/rtems/config/tools/rtems-gdb-7.3.1-1.cfg
index 5061dde..874abfd 100644
--- a/rtems/config/tools/rtems-gdb-7.3.1-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.3.1-1.cfg
@@ -7,12 +7,7 @@
%define gdb_version 7.3.1
-Patch0: %{rtems_gdb_patches}/gdb-7.3.1-rtems4.10-20120918.diff
-
-#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
+%patch add gdb %{rtems_gdb_patches}/gdb-7.3.1-rtems4.10-20120918.diff
#
# The gdb build instructions. We use 7.xx Release 1.
diff --git a/rtems/config/tools/rtems-gdb-7.5-1.cfg b/rtems/config/tools/rtems-gdb-7.5-1.cfg
index 5a76c9b..7853d40 100644
--- a/rtems/config/tools/rtems-gdb-7.5-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.5-1.cfg
@@ -7,8 +7,7 @@
%define gdb_version 7.5
-Patch0: %{rtems_gdb_patches}/gdb-7.5-rtems4.11-20121003.diff
-%include rtems-gdb-patches.cfg
+%patch add gdb %{rtems_gdb_patches}/gdb-7.5-rtems4.11-20121003.diff
#
# The gdb build instructions. We use 7.xx Release 1.
diff --git a/rtems/config/tools/rtems-gdb-7.5.1-1.cfg b/rtems/config/tools/rtems-gdb-7.5.1-1.cfg
index fee1f03..7cebe17 100644
--- a/rtems/config/tools/rtems-gdb-7.5.1-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.5.1-1.cfg
@@ -8,11 +8,6 @@
%define gdb_version 7.5.1
#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
-
-#
# The gdb build instructions. We use 7.xx Release 1.
#
%include %{_configdir}/gdb-7-1.cfg
diff --git a/rtems/config/tools/rtems-gdb-7.6-1.cfg b/rtems/config/tools/rtems-gdb-7.6-1.cfg
index 3a8d0fd..9d359e6 100644
--- a/rtems/config/tools/rtems-gdb-7.6-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.6-1.cfg
@@ -8,11 +8,6 @@
%define gdb_version 7.6
#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
-
-#
# The gdb build instructions. We use 7.xx Release 1.
#
%include %{_configdir}/gdb-7-1.cfg
diff --git a/rtems/config/tools/rtems-gdb-7.6.1-1.cfg b/rtems/config/tools/rtems-gdb-7.6.1-1.cfg
index 12ea57d..4841256 100644
--- a/rtems/config/tools/rtems-gdb-7.6.1-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.6.1-1.cfg
@@ -8,11 +8,6 @@
%define gdb_version 7.6.1
#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
-
-#
# The gdb build instructions. We use 7.xx Release 1.
#
%include %{_configdir}/gdb-7-1.cfg
diff --git a/rtems/config/tools/rtems-gdb-7.6.2-1.cfg b/rtems/config/tools/rtems-gdb-7.6.2-1.cfg
index 9d26643..523e55f 100644
--- a/rtems/config/tools/rtems-gdb-7.6.2-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.6.2-1.cfg
@@ -7,14 +7,8 @@
%define gdb_version 7.6.2
-#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
-
%if %{_build_os} == freebsd
-%define patch5 %{rtems_gdb_patches}/patch-gdb-python-python-config.py
-%define patch5_opts -p0
+ %patch add gdb -p0 %{rtems_gdb_patches}/patch-gdb-python-python-config.py
%endif
#
diff --git a/rtems/config/tools/rtems-gdb-7.7-1.cfg b/rtems/config/tools/rtems-gdb-7.7-1.cfg
index d1f59cc..3a89680 100644
--- a/rtems/config/tools/rtems-gdb-7.7-1.cfg
+++ b/rtems/config/tools/rtems-gdb-7.7-1.cfg
@@ -8,19 +8,13 @@
%define gdb_version 7.7
#
-# RTEMS Build Set patches.
-#
-%include rtems-gdb-patches.cfg
-
-#
# Clean up the sim-arange inline code so it builds.
#
-%define patch1 %{rtems_gdb_patches}/gdb-sim-arange-inline.diff
-%define patch2 %{rtems_gdb_patches}/gdb-sim-cgen-inline.diff
+%patch add gdb %{rtems_gdb_patches}/gdb-sim-arange-inline.diff
+%patch add gdb %{rtems_gdb_patches}/gdb-sim-cgen-inline.diff
%if %{_build_os} == freebsd
-%define patch5 %{rtems_gdb_patches}/patch-gdb-python-python-config.py
-%define patch5_opts -p0
+ %patch add gdb -p0 %{rtems_gdb_patches}/patch-gdb-python-python-config.py
%endif
#
diff --git a/rtems/config/tools/rtems-kernel-4-1.cfg b/rtems/config/tools/rtems-kernel-4-1.cfg
index d22f9c2..1bd0c3e 100644
--- a/rtems/config/tools/rtems-kernel-4-1.cfg
+++ b/rtems/config/tools/rtems-kernel-4-1.cfg
@@ -16,9 +16,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-%ifn %{defined Source0}
- Source0: http://ftp.rtems.org/ftp/pub/rtems/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.bz2
-%endif
+%source set rtems http://ftp.rtems.org/ftp/pub/rtems/%{rtems_kernel_version}/rtems-%{rtems_kernel_version}.tar.bz2
#
# If C++ defined for the tool set use it to control RTEMS's setting..
@@ -60,19 +58,10 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
# Prepare the source code.
#
%prep
- source_dir_0="rtems-%{rtems_kernel_version}"
- %setup -q -c -n %{name}-%{version}
- cd ${source_dir_0}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_rtems="rtems-%{rtems_kernel_version}"
+ %source setup rtems -q -c -n %{name}-%{version}
+ cd ${source_dir_rtems}
+ %patch setup rtems -p1
%if %{rtems_bootstrap}
%if %{defined _internal_autotools_path}
export PATH="%{_internal_autotools_path}/bin:${PATH}"
@@ -93,7 +82,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
mkdir -p ${build_dir}
cd ${build_dir}
- ../${source_dir_0}/configure \
+ ../${source_dir_rtems}/configure \
--build=%{_build} --host=%{_host} \
--target=%{_target} \
%{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \
diff --git a/rtems/config/tools/rtems-kernel-4.11.cfg b/rtems/config/tools/rtems-kernel-4.11.cfg
index fc5f699..f5bb610 100644
--- a/rtems/config/tools/rtems-kernel-4.11.cfg
+++ b/rtems/config/tools/rtems-kernel-4.11.cfg
@@ -38,7 +38,7 @@
# Pull the latest changes from git each build. Override if this is not what you
# want.
#
- Source0: git://git.rtems.org/rtems.git?reset=hard?pull
+ %source set rtems git://git.rtems.org/rtems.git?reset=hard?pull
#
# The code in git needs to be bootstrapped. Do each build because we have
diff --git a/rtems/config/tools/rtems-nios2-binutils-2.20-1.cfg b/rtems/config/tools/rtems-nios2-binutils-2.20-1.cfg
index c4be761..4d4a4e6 100644
--- a/rtems/config/tools/rtems-nios2-binutils-2.20-1.cfg
+++ b/rtems/config/tools/rtems-nios2-binutils-2.20-1.cfg
@@ -15,8 +15,8 @@
#
# Source
#
-Source0: http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-binutils-2.20.tar.bz2
-Patch0: %{rtems_binutils_patches}/nios2/nios2-binutils-2.20-rtems-20110703.diff
+%source set binutils http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-binutils-2.20.tar.bz2
+%patch add binutils %{rtems_binutils_patches}/nios2/nios2-binutils-2.20-rtems-20110703.diff
#
# The binutils build instructions. We use 2.xx Release 1.
diff --git a/rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg b/rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg
index cb410da..5a0c467 100644
--- a/rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg
+++ b/rtems/config/tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1.cfg
@@ -20,8 +20,8 @@
#
# The RTEMS 4.11 patches
#
-Patch0: %{rtems_gcc_patches}/nios2/nios2-gcc-4.1-rtems-20110818.diff
-Patch10: %{rtems_newlib_patches}/nios2/nios2-newlib-1.19.0-rtems-20110720.diff
+%patch add gcc %{rtems_gcc_patches}/nios2/nios2-gcc-4.1-rtems-20110818.diff
+%patch add newlib %{rtems_newlib_patches}/nios2/nios2-newlib-1.19.0-rtems-20110720.diff
Name: %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release}
Summary: GCC v%{gcc_version} and Newlib v%{newlib_version} for target %{_target} on host %{_host}
@@ -41,12 +41,12 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# GCC core and G++
#
-Source0: http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-gcc-4.1.tar.bz2
+%source set gcc http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-gcc-4.1.tar.bz2
#
# Newlib
#
-Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# The GCC library directory
@@ -57,48 +57,35 @@ Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
# Prepare the source code.
#
%prep
+ # save the build top directory and cd back to it rather than
+ # using 'cd ..' because some shells change $PWD to a symlink's
+ # target location and 'cd ..' fails.
+ build_top=$(pwd)
+
# gcc
- source_dir_0="gcc-%{gcc_version}"
- %setup -q -c -n %{name}-%{version}
- cd ${source_dir_0}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
- cd ..
+ source_dir_gcc="gcc-%{gcc_version}"
+ %source setup gcc -q -c -n %{name}-%{version}
+ cd ${source_dir_gcc}
+ %patch setup gcc -p1
+ cd ${build_top}
# newlib
- source_dir_10="newlib-%{newlib_version}"
- %setup -q -D -T -n %{name}-%{version} -a10
- cd ${source_dir_10}
- %{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
- %{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
- %{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
- %{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
- %{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
- %{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
- %{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
- %{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
- %{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
- %{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
- cd ..
+ source_dir_newlib="newlib-%{newlib_version}"
+ %source setup newlib -q -D -n %{name}-%{version}
+ cd ${source_dir_newlib}
+ %patch setup newlib -p1
+ cd ${build_top}
# Link newlib into the gcc source tree
- %{__rmfile} ${source_dir_0}/newlib
- %{__ln_s} $PWD/${source_dir_10}/newlib ${source_dir_0}/newlib
+ %{__rmfile} ${source_dir_gcc}/newlib
+ %{__ln_s} $PWD/${source_dir_newlib}/newlib ${source_dir_gcc}/newlib
echo "%{gcc_version_message}" > gcc-%{gcc_version}/gcc/DEV-PHASE
# Fix timestamps
- cd ${source_dir_0}
+ cd ${source_dir_gcc}
contrib/gcc_update --touch
- cd ..
+ cd ${build_top}
%build
%{build_directory}
@@ -113,7 +100,7 @@ Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_gcc}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
@@ -142,7 +129,7 @@ Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
# Bug in gcc-3.2.1:
# Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
mkdir -p gcc/include
- cp ../${source_dir_0}/gcc/gsyslimits.h gcc/include/syslimits.h
+ cp ../${source_dir_gcc}/gcc/gsyslimits.h gcc/include/syslimits.h
fi
# jobs > 1 is broken with this version of gcc
@@ -189,4 +176,4 @@ Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
%{__rmfile} $SB_BUILD_ROOT%{_mandir}/man3/*ffi*
# Clean the symlinks away incase the source is a repo
- %{__rmfile} ${source_dir_0}/newlib
+ %{__rmfile} ${source_dir_gcc}/newlib
diff --git a/rtems/config/tools/rtems-nios2-gdb-7.0-1.cfg b/rtems/config/tools/rtems-nios2-gdb-7.0-1.cfg
index b255ec0..e61fd71 100644
--- a/rtems/config/tools/rtems-nios2-gdb-7.0-1.cfg
+++ b/rtems/config/tools/rtems-nios2-gdb-7.0-1.cfg
@@ -11,7 +11,7 @@
%define without_python
-Source0: http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-gdb-7.0.tar.bz2
+%source set gdb http://ftp.rtems.org/ftp/pub/rtems/people/chrisj/nios/nios2-gdb-7.0.tar.bz2
#
# The gdb build instructions. We use 7.xx Release 1.
diff --git a/source-builder/config/autoconf-2-1.cfg b/source-builder/config/autoconf-2-1.cfg
index 1b01cbf..c08d062 100644
--- a/source-builder/config/autoconf-2-1.cfg
+++ b/source-builder/config/autoconf-2-1.cfg
@@ -21,8 +21,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{autoconf_version}.tar.gz
-VersionControl0: git clone git://git.sv.gnu.org/autoconf
+%source set autoconf ftp://ftp.gnu.org/gnu/autoconf/autoconf-%{autoconf_version}.tar.gz
#
# Prepare the source code.
@@ -30,8 +29,8 @@ VersionControl0: git clone git://git.sv.gnu.org/autoconf
%prep
build_top=$(pwd)
- %setup -q -n autoconf-%{autoconf_version}
- %{?patch0:%patch0 -p1}
+ %source setup autoconf -q -n autoconf-%{autoconf_version}
+ %patch setup autoconf -p1
cd ${build_top}
diff --git a/source-builder/config/automake-1-1.cfg b/source-builder/config/automake-1-1.cfg
index 3a5b4c1..d97c949 100644
--- a/source-builder/config/automake-1-1.cfg
+++ b/source-builder/config/automake-1-1.cfg
@@ -21,8 +21,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: ftp://ftp.gnu.org/gnu/automake/automake-%{automake_version}.tar.gz
-VersionControl0: git clone git://git.savannah.gnu.org/automake.git
+%source set automake ftp://ftp.gnu.org/gnu/automake/automake-%{automake_version}.tar.gz
#
# Prepare the source code.
@@ -30,8 +29,8 @@ VersionControl0: git clone git://git.savannah.gnu.org/automake.git
%prep
build_top=$(pwd)
- %setup -q -n automake-%{automake_version}
- %{?patch0:%patch0 -p1}
+ %source setup automake -q -n automake-%{automake_version}
+ %patch setup automake -p1
cd ${build_top}
diff --git a/source-builder/config/binutils-2-1.cfg b/source-builder/config/binutils-2-1.cfg
index 28238f3..42b45d7 100644
--- a/source-builder/config/binutils-2-1.cfg
+++ b/source-builder/config/binutils-2-1.cfg
@@ -29,10 +29,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2
- VersionControl0: cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
-%endif
+%source set binutils ftp://ftp.gnu.org/gnu/binutils/binutils-%{binutils_version}.tar.bz2
#
# Prepare the source code.
@@ -40,18 +37,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%prep
build_top=$(pwd)
- source_dir_0="binutils-%{binutils_version}"
- %setup -q -n binutils-%{binutils_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_binutils="binutils-%{binutils_version}"
+ %source setup binutils -q -n binutils-%{binutils_version}
+ %patch setup binutils -p1
cd ${build_top}
@@ -65,7 +53,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_binutils}/configure \
--build=%{_build} --host=%{_host} \
--target=%{_target} \
--verbose --disable-nls \
diff --git a/source-builder/config/dtc-1-1.cfg b/source-builder/config/dtc-1-1.cfg
index 14d9639..937c628 100644
--- a/source-builder/config/dtc-1-1.cfg
+++ b/source-builder/config/dtc-1-1.cfg
@@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://www.jdl.com/software/dtc-v%{dtc_version}.tgz
+%source set dtc http://www.jdl.com/software/dtc-v%{dtc_version}.tgz
#
# Prepare the source code.
@@ -26,15 +26,8 @@ Source0: http://www.jdl.com/software/dtc-v%{dtc_version}.tgz
%prep
build_top=$(pwd)
- %setup -q -n dtc-v%{dtc_version}
- %{?patch0:%patch0 -p1}
- %{?patch1:%patch1 -p1}
- %{?patch2:%patch2 -p1}
- %{?patch3:%patch3 -p1}
- %{?patch4:%patch4 -p1}
- %{?patch5:%patch5 -p1}
- %{?patch6:%patch6 -p1}
- %{?patch7:%patch7 -p1}
+ %source setup dtc -q -n dtc-v%{dtc_version}
+ %patch setup dtc -p1
cd ${build_top}
diff --git a/source-builder/config/expat-2-1.cfg b/source-builder/config/expat-2-1.cfg
index cd91012..589bc86 100644
--- a/source-builder/config/expat-2-1.cfg
+++ b/source-builder/config/expat-2-1.cfg
@@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://downloads.sourceforge.net/project/expat/expat/%{expat_version}/expat-%{expat_version}.tar.gz
+%source set expat http://downloads.sourceforge.net/project/expat/expat/%{expat_version}/expat-%{expat_version}.tar.gz
#
# Prepare the source code.
@@ -26,8 +26,8 @@ Source0: http://downloads.sourceforge.net/project/expat/expat/%{expat_version}/e
%prep
build_top=$(pwd)
- %setup -q -n expat-%{expat_version}
- %{?patch0:%patch0 -p1}
+ %source setup expat -q -n expat-%{expat_version}
+ %patch setup expat -p1
cd ${build_top}
diff --git a/source-builder/config/gcc-4.3-1.cfg b/source-builder/config/gcc-4.3-1.cfg
index fb1fb0b..d499a15 100644
--- a/source-builder/config/gcc-4.3-1.cfg
+++ b/source-builder/config/gcc-4.3-1.cfg
@@ -11,23 +11,19 @@
#
# GCC core and G++
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
- VersionContro0: git clone git://gcc.gnu.org/git/gcc.git
-%endif
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# Newlib
#
-Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-VersionControl10: cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co newlib
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.4-1.cfg b/source-builder/config/gcc-4.4-1.cfg
index 8d39f0d..077792a 100644
--- a/source-builder/config/gcc-4.4-1.cfg
+++ b/source-builder/config/gcc-4.4-1.cfg
@@ -11,25 +11,23 @@
#
# GCC core and G++
#
-Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
-VersionContro0: git clone git://gcc.gnu.org/git/gcc.git
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
%if %{enable_cxx}
-Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.gz
+ %source add gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.gz
%endif
#
# Newlib
#
-Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-VersionControl10: cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co newlib
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.5-1.cfg b/source-builder/config/gcc-4.5-1.cfg
index f688fd3..0039f68 100644
--- a/source-builder/config/gcc-4.5-1.cfg
+++ b/source-builder/config/gcc-4.5-1.cfg
@@ -11,29 +11,19 @@
#
# GCC core and G++
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
-%endif
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# Newlib
#
-%ifn %{defined Source10}
- Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-%endif
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-%ifn %{defined Source20}
- Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-%endif
-%ifn %{defined Source21}
- Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-%endif
-%ifn %{defined Source22}
- Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
-%endif
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.6-1.cfg b/source-builder/config/gcc-4.6-1.cfg
index 1d04f96..da5c0ab 100644
--- a/source-builder/config/gcc-4.6-1.cfg
+++ b/source-builder/config/gcc-4.6-1.cfg
@@ -11,25 +11,23 @@
#
# GCC core and G++
#
-Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
-VersionContro0: git clone git://gcc.gnu.org/git/gcc.git
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-core-%{gcc_version}.tar.bz2
%if %{enable_cxx}
-Source1: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.gz
+ %source add gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-g++-%{gcc_version}.tar.gz
%endif
#
# Newlib
#
-Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-VersionControl10: cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co newlib
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.7-1.cfg b/source-builder/config/gcc-4.7-1.cfg
index 2b78e01..923ef12 100644
--- a/source-builder/config/gcc-4.7-1.cfg
+++ b/source-builder/config/gcc-4.7-1.cfg
@@ -20,23 +20,19 @@
#
# GCC core and G++
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
- VersionContro0: git clone git://gcc.gnu.org/git/gcc.git
-%endif
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# Newlib
#
-Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-VersionControl10: cvs -z 9 -d :pserver:anoncvs@sources.redhat.com:/cvs/src co newlib
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.8-1.cfg b/source-builder/config/gcc-4.8-1.cfg
index 8ae6000..56074b0 100644
--- a/source-builder/config/gcc-4.8-1.cfg
+++ b/source-builder/config/gcc-4.8-1.cfg
@@ -11,29 +11,19 @@
#
# GCC core and G++
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
-%endif
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# Newlib
#
-%ifn %{defined Source10}
- Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-%endif
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-%ifn %{defined Source20}
- Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-%endif
-%ifn %{defined Source21}
- Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-%endif
-%ifn %{defined Source22}
- Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
-%endif
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-4.9-1.cfg b/source-builder/config/gcc-4.9-1.cfg
index ce2aec0..7d6a440 100644
--- a/source-builder/config/gcc-4.9-1.cfg
+++ b/source-builder/config/gcc-4.9-1.cfg
@@ -11,29 +11,19 @@
#
# GCC core and G++
#
-%ifn %{defined Source0}
- Source0: ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
-%endif
+%source set gcc ftp://ftp.gnu.org/gnu/gcc/gcc-%{gcc_version}/gcc-%{gcc_version}.tar.bz2
#
# Newlib
#
-%ifn %{defined Source10}
- Source10: ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
-%endif
+%source set newlib ftp://sourceware.org/pub/newlib/newlib-%{newlib_version}.tar.gz
#
# Packages GCC requires
#
-%ifn %{defined Source20}
- Source20: http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
-%endif
-%ifn %{defined Source21}
- Source21: http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
-%endif
-%ifn %{defined Source22}
- Source22: ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
-%endif
+%source set mpfr http://www.mpfr.org/mpfr-%{mpfr_version}/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc http://www.multiprecision.org/mpc/download/mpc-%{mpc_version}.tar.gz
+%source set gmp ftp://ftp.gnu.org/gnu/gmp/gmp-%{gmp_version}.tar.bz2
#
# GCC Common build script.
diff --git a/source-builder/config/gcc-common-1.cfg b/source-builder/config/gcc-common-1.cfg
index e8517d6..df24f69 100644
--- a/source-builder/config/gcc-common-1.cfg
+++ b/source-builder/config/gcc-common-1.cfg
@@ -12,15 +12,6 @@
%endif
#
-# Select Snapshot Macro Maps if they have been added.
-#
-%select gcc-snapshot
-%select newlib-snapshot
-%select mpfr-snapshot
-%select mpc-snapshot
-%select gmp-snapshot
-
-#
# The package description.
#
Name: %{_target}-gcc-%{gcc_version}-newlib-%{newlib_version}-%{release}
@@ -50,71 +41,52 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
build_top=$(pwd)
# gcc and optional the g++ core if separate packages
- source_dir_0="gcc-%{gcc_version}"
- %setup -q -n gcc-%{gcc_version}
- %{?source1:%setup -q -D -T -n gcc-%{gcc_version} -b1}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_gcc="gcc-%{gcc_version}"
+ %source setup gcc -q -n gcc-%{gcc_version}
+ %patch setup gcc -p1
cd ${build_top}
# newlib
- source_dir_10="newlib-%{newlib_version}"
- %setup -q -D -T -n newlib-%{newlib_version} -b10
- %{?patch10:%patch10 %{?patch10_opts:%{patch10_opts}}%{!?patch10_opts:-p1}}
- %{?patch11:%patch11 %{?patch11_opts:%{patch11_opts}}%{!?patch11_opts:-p1}}
- %{?patch12:%patch12 %{?patch12_opts:%{patch12_opts}}%{!?patch12_opts:-p1}}
- %{?patch13:%patch13 %{?patch13_opts:%{patch13_opts}}%{!?patch13_opts:-p1}}
- %{?patch14:%patch14 %{?patch14_opts:%{patch14_opts}}%{!?patch14_opts:-p1}}
- %{?patch15:%patch15 %{?patch15_opts:%{patch15_opts}}%{!?patch15_opts:-p1}}
- %{?patch16:%patch16 %{?patch16_opts:%{patch16_opts}}%{!?patch16_opts:-p1}}
- %{?patch17:%patch17 %{?patch17_opts:%{patch17_opts}}%{!?patch17_opts:-p1}}
- %{?patch18:%patch18 %{?patch18_opts:%{patch18_opts}}%{!?patch18_opts:-p1}}
- %{?patch19:%patch19 %{?patch19_opts:%{patch19_opts}}%{!?patch19_opts:-p1}}
+ source_dir_newlib="newlib-%{newlib_version}"
+ %source setup newlib -q -D -n newlib-%{newlib_version}
+ %patch setup newlib -p1
cd ${build_top}
# Link newlib into the gcc source tree
- %{__rmfile} ${source_dir_0}/newlib
- %{__ln_s} $PWD/${source_dir_10}/newlib ${source_dir_0}/newlib
+ %{__rmfile} ${source_dir_gcc}/newlib
+ %{__ln_s} $PWD/${source_dir_newlib}/newlib ${source_dir_gcc}/newlib
# MPFR
- source_dir_20="mpfr-%{mpfr_version}"
- %setup -q -D -T -n mpfr-%{mpfr_version} -b20
- %{?patch20:%patch20 -p1}
+ source_dir_mpfr="mpfr-%{mpfr_version}"
+ %source setup mpfr -q -D -n mpfr-%{mpfr_version}
+ %patch setup mpfr -p1
cd ${build_top}
# Build MPFR one-tree style
- %{__rmfile} ${source_dir_0}/mpfr
- %{__ln_s} $PWD/${source_dir_20} ${source_dir_0}/mpfr
+ %{__rmfile} ${source_dir_gcc}/mpfr
+ %{__ln_s} $PWD/${source_dir_mpfr} ${source_dir_gcc}/mpfr
# MPC
- source_dir_21="mpc-%{mpc_version}"
- %setup -q -D -T -n mpc-%{mpc_version} -b21
- %{?patch21:%patch21 -p1}
+ source_dir_mpc="mpc-%{mpc_version}"
+ %source setup mpc -q -D -n mpc-%{mpc_version}
+ %patch setup mpc -p1
cd ${build_top}
# Build MPC one-tree style
- %{__rmfile} ${source_dir_0}/mpc
- %{__ln_s} $PWD/${source_dir_21} ${source_dir_0}/mpc
+ %{__rmfile} ${source_dir_gcc}/mpc
+ %{__ln_s} $PWD/${source_dir_mpc} ${source_dir_gcc}/mpc
# GMP
- source_dir_22="gmp-%{gmp_version}"
- %setup -q -D -T -n gmp-%{gmp_version} -b22
- %{?patch22:%patch22 -p1}
+ source_dir_gmp="gmp-%{gmp_version}"
+ %source setup gmp -q -D -n gmp-%{gmp_version}
+ %patch setup gmp -p1
cd ${build_top}
# Build GMP one-tree style
- %{__rmfile} ${source_dir_0}/gmp
- %{__ln_s} $PWD/${source_dir_22} ${source_dir_0}/gmp
+ %{__rmfile} ${source_dir_gcc}/gmp
+ %{__ln_s} $PWD/${source_dir_gmp} ${source_dir_gcc}/gmp
- echo "%{gcc_version_message}" > ${source_dir_0}/gcc/DEV-PHASE
+ echo "%{gcc_version_message}" > ${source_dir_gcc}/gcc/DEV-PHASE
# Fix timestamps
- cd ${source_dir_0}
+ cd ${source_dir_gcc}
contrib/gcc_update --touch
cd ${build_top}
@@ -149,7 +121,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_gcc}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
@@ -182,7 +154,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
# Bug in gcc-3.2.1:
# Somehow, gcc doesn't get syslimits.h right for Cdn-Xs
mkdir -p gcc/include
- cp ../${source_dir_0}/gcc/gsyslimits.h gcc/include/syslimits.h
+ cp ../${source_dir_gcc}/gcc/gsyslimits.h gcc/include/syslimits.h
fi
%{__make} %{?_smp_mflags} all
@@ -212,10 +184,10 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%{__rmfile} $SB_BUILD_ROOT%{_mandir}/man3/*ffi*
# Clean the symlinks away incase the source is a repo
- %{__rmfile} ${source_dir_0}/newlib
- %{__rmfile} ${source_dir_0}/mpfr
- %{__rmfile} ${source_dir_0}/mpc
- %{__rmfile} ${source_dir_0}/gmp
+ %{__rmfile} ${source_dir_gcc}/newlib
+ %{__rmfile} ${source_dir_gcc}/mpfr
+ %{__rmfile} ${source_dir_gcc}/mpc
+ %{__rmfile} ${source_dir_gcc}/gmp
%testing
# Add testing here.
diff --git a/source-builder/config/gdb-6-1.cfg b/source-builder/config/gdb-6-1.cfg
index 678fd85..db76ca3 100644
--- a/source-builder/config/gdb-6-1.cfg
+++ b/source-builder/config/gdb-6-1.cfg
@@ -16,27 +16,15 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-%ifn %{defined Source0}
- Source0: http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
- VersionControl0 git clone git://sourceware.org/git/gdb.git
-%endif
+%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
#
# Prepare the source code.
#
%prep
- %setup -q -c -n %{name}-%{version}
+ %source setup gdb -q -c -n %{name}-%{version}
cd gdb-%{gdb_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ %patch setup gdb -p1
cd ..
%build
diff --git a/source-builder/config/gdb-7-1.cfg b/source-builder/config/gdb-7-1.cfg
index a5f9413..28f19b2 100644
--- a/source-builder/config/gdb-7-1.cfg
+++ b/source-builder/config/gdb-7-1.cfg
@@ -25,10 +25,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-%ifn %{defined Source0}
- Source0: http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
- VersionControl0 git clone git://sourceware.org/git/gdb.git
-%endif
+%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
#
# Disable Python on Cxc builds for now.
@@ -44,18 +41,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
%prep
build_top=$(pwd)
- source_dir_0="gdb-%{gdb_version}"
- %setup -q -n gdb-%{gdb_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_gdb="gdb-%{gdb_version}"
+ %source setup gdb -q -n gdb-%{gdb_version}
+ %patch setup gdb -p1
cd ${build_top}
@@ -78,7 +66,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
LIBS_STATIC=${GDB_LIBS_STATIC} \
LIBS=${GDB_LIBS} \
- ../${source_dir_0}/configure \
+ ../${source_dir_gdb}/configure \
--build=%{_build} --host=%{_host} \
--target=%{_target} \
--verbose --disable-nls \
diff --git a/source-builder/config/gettext-0-1.cfg b/source-builder/config/gettext-0-1.cfg
index 9e241cb..67d978d 100644
--- a/source-builder/config/gettext-0-1.cfg
+++ b/source-builder/config/gettext-0-1.cfg
@@ -19,7 +19,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz
+%source set gettext http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz
#
# Fix the mess iconv is on FreeBSD 10.0.
@@ -34,18 +34,9 @@ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz
%prep
build_top=$(pwd)
- source_dir_0="gettext-%{gettext_version}"
- %setup -q -n gettext-%{gettext_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_gettext="gettext-%{gettext_version}"
+ %source setup gettext -q -n gettext-%{gettext_version}
+ %patch setup gettext -p1
cd ${build_top}
@@ -59,7 +50,7 @@ Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_gettext}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
diff --git a/source-builder/config/glib-2-1.cfg b/source-builder/config/glib-2-1.cfg
index 296d24d..6c40be2 100644
--- a/source-builder/config/glib-2-1.cfg
+++ b/source-builder/config/glib-2-1.cfg
@@ -19,7 +19,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-%{glib_version}.tar.xz
+%source set glib http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-%{glib_version}.tar.xz
#
# Prepare the source code.
@@ -27,18 +27,9 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-
%prep
build_top=$(pwd)
- source_dir_0="glib-%{glib_version}"
- %setup -q -n glib-%{glib_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_glib="glib-%{glib_version}"
+ %source setup glib -q -n glib-%{glib_version}
+ %patch setup glib -p1
cd ${build_top}
@@ -57,7 +48,7 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-
PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \
PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
%{_ld_library_path}=$SYSROOT/lib \
- ../${source_dir_0}/configure \
+ ../${source_dir_glib}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
diff --git a/source-builder/config/libffi-3-1.cfg b/source-builder/config/libffi-3-1.cfg
index 7316331..d258acb 100644
--- a/source-builder/config/libffi-3-1.cfg
+++ b/source-builder/config/libffi-3-1.cfg
@@ -19,7 +19,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: ftp://sourceware.org/pub/libffi/libffi-%{libffi_version}.tar.gz
+%source set libffi ftp://sourceware.org/pub/libffi/libffi-%{libffi_version}.tar.gz
#
# Prepare the source code.
@@ -27,18 +27,9 @@ Source0: ftp://sourceware.org/pub/libffi/libffi-%{libffi_version}.tar.gz
%prep
build_top=$(pwd)
- source_dir_0="libffi-%{libffi_version}"
- %setup -q -n libffi-%{libffi_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_libffi="libffi-%{libffi_version}"
+ %source setup libffi -q -n libffi-%{libffi_version}
+ %patch setup libffi -p1
cd ${build_top}
@@ -52,7 +43,7 @@ Source0: ftp://sourceware.org/pub/libffi/libffi-%{libffi_version}.tar.gz
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_libffi}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
diff --git a/source-builder/config/libiconv-1-1.cfg b/source-builder/config/libiconv-1-1.cfg
index e8d5d3d..1ccecd4 100644
--- a/source-builder/config/libiconv-1-1.cfg
+++ b/source-builder/config/libiconv-1-1.cfg
@@ -20,7 +20,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-%{libiconv_version}.tar.gz
+%source set libiconv http://ftp.gnu.org/pub/gnu/libiconv/libiconv-%{libiconv_version}.tar.gz
#
# Prepare the source code.
@@ -28,18 +28,9 @@ Source0: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-%{libiconv_version}.tar.gz
%prep
build_top=$(pwd)
- source_dir_0="libiconv-%{libiconv_version}"
- %setup -q -n libiconv-%{libiconv_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_libiconv="libiconv-%{libiconv_version}"
+ %source setup libiconv -q -n libiconv-%{libiconv_version}
+ %patch setup libiconv -p1
cd ${build_top}
@@ -53,7 +44,7 @@ Source0: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-%{libiconv_version}.tar.gz
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_libiconv}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
diff --git a/source-builder/config/libtool-2-1.cfg b/source-builder/config/libtool-2-1.cfg
index e69493b..9b5a236 100644
--- a/source-builder/config/libtool-2-1.cfg
+++ b/source-builder/config/libtool-2-1.cfg
@@ -21,8 +21,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: ftp://ftp.gnu.org/gnu/libtool/libtool-%{libtool_version}.tar.gz
-VersionControl0: git clone git://git.sv.gnu.org/libtool
+%source set libtool ftp://ftp.gnu.org/gnu/libtool/libtool-%{libtool_version}.tar.gz
#
# Prepare the source code.
@@ -30,8 +29,8 @@ VersionControl0: git clone git://git.sv.gnu.org/libtool
%prep
build_top=$(pwd)
- %setup -q -n libtool-%{libtool_version}
- %{?patch0:%patch0 -p1}
+ %source setup libtool -q -n libtool-%{libtool_version}
+ %patch setup libtool -p1
cd ${build_top}
diff --git a/source-builder/config/libusb-1-1.cfg b/source-builder/config/libusb-1-1.cfg
index 9a3ca3c..4e961ca 100644
--- a/source-builder/config/libusb-1-1.cfg
+++ b/source-builder/config/libusb-1-1.cfg
@@ -17,17 +17,17 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-%{libusb_version}/libusb-%{libusb_version}.tar.bz2
-VersionControl0: git clone git://git.libusb.org/libusb.git
+%source set libusb http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-%{libusb_version}/libusb-%{libusb_version}.tar.bz2
#
# Prepare the source code.
#
%prep
-%setup -q -c -n %{name}-%{version}
-cd libusb-%{libusb_version}
-%{?patch0:%patch0 -p1}
-cd ..
+
+ %source setup libusb -q -c -n %{name}-%{version}
+ cd libusb-%{libusb_version}
+ %patch setup libusb -p1
+ cd ..
%build
export PATH="%{_bindir}:${PATH}"
diff --git a/source-builder/config/m4-1-1.cfg b/source-builder/config/m4-1-1.cfg
index ddd9a7b..3aae1f4 100644
--- a/source-builder/config/m4-1-1.cfg
+++ b/source-builder/config/m4-1-1.cfg
@@ -17,16 +17,16 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: ftp://ftp.gnu.org/gnu/m4/m4-%{m4_version}.tar.gz
+%source set m4 ftp://ftp.gnu.org/gnu/m4/m4-%{m4_version}.tar.gz
#
# Prepare the source code.
#
%prep
-%setup -q -c -n %{name}-%{version}
-cd m4-%{m4_version}
-%{?patch0:%patch0 -p1}
-cd ..
+ %source setup m4 -q -c -n %{name}-%{version}
+ cd m4-%{m4_version}
+ %patch setup m4 -p1
+ cd ..
%build
export PATH="%{_bindir}:${PATH}"
diff --git a/source-builder/config/pixman-0-1.cfg b/source-builder/config/pixman-0-1.cfg
index 552df25..f02c3d6 100644
--- a/source-builder/config/pixman-0-1.cfg
+++ b/source-builder/config/pixman-0-1.cfg
@@ -20,7 +20,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz
+%source set pixman http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz
#
# Prepare the source code.
@@ -28,18 +28,9 @@ Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz
%prep
build_top=$(pwd)
- source_dir_0="pixman-%{pixman_version}"
- %setup -q -n pixman-%{pixman_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_pixman="pixman-%{pixman_version}"
+ %source setup pixman -q -n pixman-%{pixman_version}
+ %patch setup pixman -p1
cd ${build_top}
@@ -53,7 +44,7 @@ Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz
%{host_build_flags}
- ../${source_dir_0}/configure \
+ ../${source_dir_pixman}/configure \
--prefix=%{_prefix} \
--bindir=%{_bindir} \
--exec_prefix=%{_exec_prefix} \
diff --git a/source-builder/config/qemu-1-1.cfg b/source-builder/config/qemu-1-1.cfg
index 43c1069..671aa77 100644
--- a/source-builder/config/qemu-1-1.cfg
+++ b/source-builder/config/qemu-1-1.cfg
@@ -18,7 +18,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
# Source
#
-Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
+%source set qemu http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
#
# Prepare the source code.
@@ -26,18 +26,9 @@ Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
%prep
build_top=$(pwd)
- source_dir_0="qemu-%{qemu_version}"
- %setup -q -n qemu-%{qemu_version}
- %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
- %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
- %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
- %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}}
- %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}}
- %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}}
- %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}}
- %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}}
- %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
- %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
+ source_dir_qemu="qemu-%{qemu_version}"
+ %source setup qemu -q -n qemu-%{qemu_version}
+ %patch setup qemu -p1
cd ${build_top}
@@ -61,7 +52,7 @@ Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
%{_ld_library_path}=$SYSROOT/lib \
LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib" \
- ../${source_dir_0}/configure \
+ ../${source_dir_qemu}/configure \
--prefix=%{_prefix} \
${CROSS_PREFIX_OPTION} \
--make=%{__make} \
diff --git a/source-builder/sb/build.py b/source-builder/sb/build.py
index eb39349..b6c6ee9 100644
--- a/source-builder/sb/build.py
+++ b/source-builder/sb/build.py
@@ -41,6 +41,7 @@ try:
import log
import options
import path
+ import sources
import version
except KeyboardInterrupt:
print 'abort: user terminated'
@@ -131,63 +132,6 @@ class build:
if not self.opts.dry_run():
path.mkdir(mkpath)
- def source(self, package, source_tag):
- #
- # Scan the sources found in the config file for the one we are
- # after. Infos or tags are lists. Merge in any macro defined
- # sources as these may be overridden by user loaded macros.
- #
- sources = package.sources()
- url = None
- for s in sources:
- tag = s[len('source'):]
- if tag.isdigit():
- if int(tag) == source_tag:
- url = sources[s][0]
- break
- if url is None:
- raise error.general('source tag not found: source%d' % (source_tag))
- source = download.parse_url(url, '_sourcedir', self.config, self.opts)
- download.get_file(source['url'], source['local'], self.opts, self.config)
- if 'symlink' in source:
- source['script'] = '%%{__ln_s} %s ${source_dir_%d}' % (source['symlink'], source_tag)
- elif 'compressed' in source:
- source['script'] = source['compressed'] + ' ' + \
- source['local'] + ' | %{__tar_extract} -'
- else:
- source['script'] = '%{__tar_extract} ' + source['local']
- return source
-
- def patch(self, package, args):
- #
- # Scan the patches found in the config file for the one we are
- # after. Infos or tags are lists.
- #
- patches = package.patches()
- url = None
- for p in patches:
- if args[0][1:].lower() == p:
- url = patches[p][0]
- break
- if url is None:
- raise error.general('patch tag not found: %s' % (args[0]))
- #
- # Parse the URL first in the source builder's patch directory.
- #
- patch = download.parse_url(url, '_patchdir', self.config, self.opts)
- #
- # If not in the source builder package check the source directory.
- #
- if not path.exists(patch['local']):
- patch = download.parse_url(url, '_patchdir', self.config, self.opts)
- download.get_file(patch['url'], patch['local'], self.opts, self.config)
- if 'compressed' in patch:
- patch['script'] = patch['compressed'] + ' ' + patch['local']
- else:
- patch['script'] = '%{__cat} ' + patch['local']
- patch['script'] += ' | %{__patch} ' + ' '.join(args[1:])
- self.script.append(self.config.expand(patch['script']))
-
def canadian_cross(self):
_host = self.config.expand('%{_host}')
_build = self.config.expand('%{_build}')
@@ -195,16 +139,54 @@ class build:
return self.config.defined('%{allow_cxc}') and \
_host != _build and _host != _target
- def setup(self, package, args):
- log.output('prep: %s: %s' % (package.name(), ' '.join(args)))
- opts, args = getopt.getopt(args[1:], 'qDcTn:b:a:')
- source_tag = 0
+ def source(self, name):
+ #
+ # Return the list of sources. Merge in any macro defined sources as
+ # these may be overridden by user loaded macros.
+ #
+ _map = 'source-%s' % (name)
+ src_keys = self.macros.map_keys(_map)
+ if len(src_keys) == 0:
+ raise error.general('no source set: %s (%s)' % (name, _map))
+ srcs = []
+ for s in src_keys:
+ sm = self.macros.get(s, globals = False, maps = _map)
+ if sm is None:
+ raise error.internal('source macro not found: %s in %s (%s)' % \
+ (s, name, _map))
+ url = self.config.expand(sm[2])
+ src = download.parse_url(url, '_sourcedir', self.config, self.opts)
+ download.get_file(src['url'], src['local'], self.opts, self.config)
+ if 'symlink' in src:
+ src['script'] = '%%{__ln_s} %s ${source_dir_%s}' % (src['symlink'], name)
+ elif 'compressed' in src:
+ #
+ # Zip files unpack as well so do not use tar.
+ #
+ src['script'] = '%s %s' % (src['compressed'], src['local'])
+ if src['compressed-type'] != 'zip':
+ src['script'] += ' | %{__tar_extract} -'
+ else:
+ src['script'] = '%{__tar_extract} %s' % (src['local'])
+ srcs += [src]
+ return srcs
+
+ def source_setup(self, package, args):
+ log.output('source setup: %s: %s' % (package.name(), ' '.join(args)))
+ setup_name = args[1]
+ args = args[1:]
+ try:
+ opts, args = getopt.getopt(args[1:], 'qDcn:b:a:')
+ except getopt.GetoptError, ge:
+ raise error.general('source setup error: %s' % str(ge))
quiet = False
- unpack_default_source = True
unpack_before_chdir = True
delete_before_unpack = True
create_dir = False
- name = None
+ deleted_dir = False
+ created_dir = False
+ changed_dir = False
+ opt_name = None
for o in opts:
if o[0] == '-q':
quiet = True
@@ -212,51 +194,83 @@ class build:
delete_before_unpack = False
elif o[0] == '-c':
create_dir = True
- elif o[0] == '-T':
- unpack_default_source = False
elif o[0] == '-n':
- name = o[1]
+ opt_name = o[1]
elif o[0] == '-b':
unpack_before_chdir = True
- if not o[1].isdigit():
- raise error.general('setup -b source tag is not a number: %s' % (o[1]))
- source_tag = int(o[1])
elif o[0] == '-a':
unpack_before_chdir = False
- if not o[1].isdigit():
- raise error.general('setup -a source tag is not a number: %s' % (o[1]))
- source_tag = int(o[1])
- source0 = None
- source = self.source(package, source_tag)
- if name is None:
- if source:
- name = source['name']
- else:
- raise error.general('setup source tag not found: %d' % (source_tag))
- name = self._name_(name)
- self.script.append(self.config.expand('cd %{_builddir}'))
- if delete_before_unpack:
- self.script.append(self.config.expand('%{__rm} -rf ' + name))
- if create_dir:
- self.script.append(self.config.expand('%{__mkdir_p} ' + name))
- #
- # If -a? then change directory before unpacking.
- #
- if not unpack_before_chdir or create_dir:
- self.script.append(self.config.expand('cd ' + name))
- #
- # Unpacking the source. Note, treated the same as -a0.
- #
- if unpack_default_source and source_tag != 0:
- source0 = self.source(package, 0)
- if source0 is None:
- raise error.general('no setup source0 tag found')
- self.script.append(self.config.expand(source0['script']))
- self.script.append(self.config.expand(source['script']))
- if unpack_before_chdir and not create_dir:
+ name = None
+ for source in self.source(setup_name):
+ if name is None:
+ if opt_name is None:
+ if source:
+ opt_name = source['name']
+ else:
+ raise error.general('setup source tag not found: %d' % (source_tag))
+ else:
+ name = opt_name
+ name = self._name_(name)
+ self.script.append(self.config.expand('cd %{_builddir}'))
+ if not deleted_dir and delete_before_unpack:
+ self.script.append(self.config.expand('%{__rm} -rf ' + name))
+ deleted_dir = True
+ if not created_dir and create_dir:
+ self.script.append(self.config.expand('%{__mkdir_p} ' + name))
+ created_dir = True
+ if not changed_dir and (not unpack_before_chdir or create_dir):
+ self.script.append(self.config.expand('cd ' + name))
+ changed_dir = True
+ self.script.append(self.config.expand(source['script']))
+ if not changed_dir and (unpack_before_chdir and not create_dir):
self.script.append(self.config.expand('cd ' + name))
+ changed_dir = True
self.script.append(self.config.expand('%{__setup_post}'))
+ def patch_setup(self, package, args):
+ name = args[1]
+ args = args[2:]
+ _map = 'patch-%s' % (name)
+ default_opts = ' '.join(args)
+ patch_keys = self.macros.map_keys(_map)
+ patches = []
+ for p in patch_keys:
+ pm = self.macros.get(p, globals = False, maps = _map)
+ if pm is None:
+ raise error.internal('patch macro not found: %s in %s (%s)' % \
+ (p, name, _map))
+ opts = []
+ url = []
+ for pp in pm[2].split():
+ if len(url) == 0 and pp[0] == '-':
+ opts += [pp]
+ else:
+ url += [pp]
+ if len(url) == 0:
+ raise error.general('patch URL not found: %s' % (' '.join(args)))
+ if len(opts) == 0:
+ opts = default_opts
+ else:
+ opts = ' '.join(opts)
+ opts = self.config.expand(opts)
+ url = self.config.expand(' '.join(url))
+ #
+ # Parse the URL first in the source builder's patch directory.
+ #
+ patch = download.parse_url(url, '_patchdir', self.config, self.opts)
+ #
+ # If not in the source builder package check the source directory.
+ #
+ if not path.exists(patch['local']):
+ patch = download.parse_url(url, '_patchdir', self.config, self.opts)
+ download.get_file(patch['url'], patch['local'], self.opts, self.config)
+ if 'compressed' in patch:
+ patch['script'] = patch['compressed'] + ' ' + patch['local']
+ else:
+ patch['script'] = '%{__cat} ' + patch['local']
+ patch['script'] += ' | %%{__patch} %s' % (opts)
+ self.script.append(self.config.expand(patch['script']))
+
def run(self, command, shell_opts = '', cwd = None):
e = execute.capture_execution(log = log.default, dump = self.opts.quiet())
cmd = self.config.expand('%{___build_shell} -ex ' + shell_opts + ' ' + command)
@@ -278,12 +292,18 @@ class build:
if _prep:
for l in _prep:
args = l.split()
- if args[0] == '%setup':
- self.setup(package, args)
- elif args[0].startswith('%patch'):
- self.patch(package, args)
- else:
- self.script.append(' '.join(args))
+ if len(args):
+ if args[0] == '%setup':
+ if len(args) == 1:
+ raise error.general('invalid %%setup directive: %s' % (' '.join(args)))
+ if args[1] == 'source':
+ self.source_setup(package, args[1:])
+ elif args[1] == 'patch':
+ self.patch_setup(package, args[1:])
+ elif args[0].startswith('%patch'):
+ self.patch(package, args)
+ else:
+ self.script.append(' '.join(args))
def build(self, package):
self.script.append('echo "==> clean %{buildroot}: ${SB_BUILD_ROOT}"')
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py
index 5a90a49..9a70155 100644
--- a/source-builder/sb/config.py
+++ b/source-builder/sb/config.py
@@ -37,6 +37,7 @@ try:
import options
import path
import pkgconfig
+ import sources
except KeyboardInterrupt:
print 'user terminated'
sys.exit(1)
@@ -580,6 +581,9 @@ class file:
log.trace('config: %s: _select: %s %s %r' % \
(self.init_name, r, ls[1], self.macros.maps()))
+ def _sources(self, ls):
+ return sources.process(ls[0][1:], ls[1:], self.macros, self._error)
+
def _define(self, config, ls):
if len(ls) <= 1:
log.warning('invalid macro definition')
@@ -796,6 +800,14 @@ class file:
elif ls[0] == '%select':
if isvalid:
self._select(config, ls)
+ elif ls[0] == '%source' or ls[0] == '%patch':
+ if isvalid:
+ d = self._sources(ls)
+ if d is not None:
+ return ('data', d)
+ elif ls[0] == '%patch':
+ if isvalid:
+ self._select(config, ls)
elif ls[0] == '%error':
if isvalid:
return ('data', ['%%error %s' % (self._name_line_msg(l[7:]))])
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 7457235..3386aea 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -40,12 +40,16 @@ def _http_parser(source, config, opts):
#
esl = source['ext'].split('.')
if esl[-1:][0] == 'gz':
+ source['compressed-type'] = 'gzip'
source['compressed'] = '%{__gzip} -dc'
elif esl[-1:][0] == 'bz2':
+ source['compressed-type'] = 'bzip2'
source['compressed'] = '%{__bzip2} -dc'
elif esl[-1:][0] == 'zip':
+ source['compressed-type'] = 'zip'
source['compressed'] = '%{__zip} -u'
elif esl[-1:][0] == 'xz':
+ source['compressed-type'] = 'xz'
source['compressed'] = '%{__xz} -dc'
def _patchworks_parser(source, config, opts):
@@ -138,6 +142,9 @@ def parse_url(url, pathkey, config, opts):
source['path'] = url[:colon + 3] + path.dirname(url[colon + 3:])
source['file'] = path.basename(url)
source['name'], source['ext'] = path.splitext(source['file'])
+ if source['name'].endswith('.tar'):
+ source['name'] = source['name'][:-4]
+ source['ext'] = '.tar' + source['ext']
#
# Get the file. Checks the local source directory first.
#
diff --git a/source-builder/sb/macros.py b/source-builder/sb/macros.py
index 194d4ed..1f37ae4 100644
--- a/source-builder/sb/macros.py
+++ b/source-builder/sb/macros.py
@@ -84,7 +84,10 @@ class macros:
text = ''
for f in self.files:
text += '> %s%s' % (f, os.linesep)
- for map in self.macros:
+ maps = sorted(self.macros)
+ maps.remove('global')
+ maps += ['global']
+ for map in maps:
text += '[%s]%s' % (map, os.linesep)
for k in sorted(self.macros[map].keys()):
d = self.macros[map][k]
@@ -162,8 +165,11 @@ class macros:
def __len__(self):
return len(self.keys())
- def keys(self):
- keys = self.macros['global'].keys()
+ def keys(self, globals = True):
+ if globals:
+ keys = self.macros['global'].keys()
+ else:
+ keys = []
for rm in self.get_read_maps():
for mk in self.macros[rm]:
if self.macros[rm][mk][1] == 'undefine':
@@ -180,9 +186,25 @@ class macros:
return False
return True
+ def create_map(self, _map):
+ if _map not in self.macros:
+ self.macros[_map] = {}
+
+ def delete_map(self, _map):
+ if _map in self.macros:
+ self.macros.pop(_map, None)
+
def maps(self):
return self.macros.keys()
+ def map_keys(self, _map):
+ if _map in self.macros:
+ return self.macros[_map].keys()
+ return []
+
+ def map_num_keys(self, _map):
+ return len(self.map_keys(_map))
+
def get_read_maps(self):
return [rm[5:] for rm in self.read_maps]
@@ -348,14 +370,21 @@ class macros:
raise error.general('opening macro file: %s' % \
(path.host(self.expand(name))))
- def get(self, key):
+ def get(self, key, globals = True, maps = None):
if type(key) is not str:
raise TypeError('bad key type: %s' % (type(key)))
key = self.key_filter(key)
- for rm in self.get_read_maps():
+ if maps is None:
+ maps = self.get_read_maps()
+ else:
+ if type(maps) is str:
+ maps = [maps]
+ if type(maps) != list:
+ raise TypeError('bad maps type: %s' % (type(map)))
+ for rm in maps:
if key in self.macros[rm]:
return self.macros[rm][key]
- if key in self.macros['global']:
+ if globals and key in self.macros['global']:
return self.macros['global'][key]
return None
@@ -408,10 +437,10 @@ class macros:
expanded = True
return _str
- def find(self, regex):
+ def find(self, regex, globals = True):
what = re.compile(regex)
keys = []
- for key in self.keys():
+ for key in self.keys(globals):
if what.match(key):
keys += [key]
return keys
@@ -440,6 +469,9 @@ class macros:
return True
return False
+ def unset_write_map(self):
+ self.write_map = 'global'
+
def lock_read_map(self):
self.read_map_locked = True
diff --git a/source-builder/sb/setbuilder.py b/source-builder/sb/setbuilder.py
index 690c37b..b772120 100644
--- a/source-builder/sb/setbuilder.py
+++ b/source-builder/sb/setbuilder.py
@@ -39,6 +39,7 @@ try:
import options
import path
import reports
+ import sources
import version
except KeyboardInterrupt:
print 'abort: user terminated'
@@ -248,9 +249,10 @@ class buildset:
self.macros.undefine(ls[1].strip())
elif ls[0] == '%include':
configs += self.parse(ls[1].strip())
- else:
- raise error.general('%s:%d: invalid directive in build set files: %s' % \
- (self.bset, lc, l))
+ elif ls[0] == '%patch' or ls[0] == '%source':
+ def err(msg):
+ raise error.general('%s:%d: %s' % (self.bset, lc, msg))
+ sources.process(ls[0][1:], ls[1:], self.macros, err)
else:
l = l.strip()
c = build.find_config(l, self.configs)
diff --git a/source-builder/sb/sources.py b/source-builder/sb/sources.py
new file mode 100644
index 0000000..7b4edfd
--- /dev/null
+++ b/source-builder/sb/sources.py
@@ -0,0 +1,74 @@
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2014 Chris Johns (chrisj@rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+#
+# Manage sources and patches
+#
+
+import log
+
+def _args(args):
+ return [i for s in [ii.split() for ii in args] for i in s]
+
+def add(label, args, macros, error):
+ args = _args(args)
+ if len(args) < 2:
+ error('%%%s requires at least 2 arguments' % (label))
+ _map = '%s-%s' % (label, args[0])
+ macros.create_map(_map)
+ macros.set_write_map(_map)
+ index = macros.map_num_keys(_map)
+ macros.define('%s%d' % (label, index), ' '.join(args[1:]))
+ macros.unset_write_map()
+ return None
+
+def set(label, args, macros, error):
+ args = _args(args)
+ if len(args) < 2:
+ error('%%%s requires at least 2 arguments' % (label))
+ _map = '%s-%s' % (label, args[0])
+ macros.create_map(_map)
+ key = '%s0' % (label)
+ if key not in macros.map_keys(_map):
+ macros.set_write_map(_map)
+ macros.define(key, ' '.join(args[1:]))
+ macros.unset_write_map()
+ return None
+
+def setup(label, args, macros, error):
+ args = _args(args)
+ if len(args) < 2:
+ error('%%%s requires at least 2 arguments: %s' % (label, ' '.join(args)))
+ _map = '%s-%s' % (label, args[0])
+ return ['%%setup %s %s' % (label, ' '.join(args))]
+
+def process(label, args, macros, error):
+ if label != 'source' and label != 'patch':
+ error('invalid source type: %s' % (label))
+ args = _args(args)
+ log.output('sources: %s' % (' '.join(args)))
+ if len(args) < 3:
+ error('%%%s requires at least 3 arguments: %s' % (label, ' '.join(args)))
+ if args[0] == 'set':
+ return set(label, args[1:], macros, error)
+ elif args[0] == 'add':
+ return add(label, args[1:], macros, error)
+ elif args[0] == 'setup':
+ return setup(label, args[1:], macros, error)
+ error('invalid %%%s command: %s' % (label, args[0]))
diff --git a/source-builder/sb/version.py b/source-builder/sb/version.py
index 89c2c36..f7ebca8 100644
--- a/source-builder/sb/version.py
+++ b/source-builder/sb/version.py
@@ -24,7 +24,7 @@
#
major = 0
-minor = 2
+minor = 3
revision = 0
def str():