[cross-binutils/f19] Macroise name prefix

David Howells dhowells at fedoraproject.org
Fri Aug 9 08:35:37 UTC 2013


commit 6739dc5ffc1b52a658cfad7f430813cdc53fcaf7
Author: David Howells <dhowells at redhat.com>
Date:   Tue Jun 4 20:22:21 2013 +0100

    Macroise name prefix
    
    Macroise the RPM and program name prefixes to make it more similar to the RHEL
    cross-compiler specfile.

 cross-binutils.spec |   80 ++++++++++++++++++++++++++------------------------
 1 files changed, 42 insertions(+), 38 deletions(-)
---
diff --git a/cross-binutils.spec b/cross-binutils.spec
index d4ce67e..3152461 100644
--- a/cross-binutils.spec
+++ b/cross-binutils.spec
@@ -1,4 +1,7 @@
 
+%define cross cross
+%define rpmprefix %{nil}
+
 %define build_all		1
 %define build_alpha		%{build_all}
 %define build_arm		%{build_all}
@@ -41,7 +44,7 @@
 %define build_unicore32		0
 
 Summary: A GNU collection of cross-compilation binary utilities
-Name: cross-binutils
+Name: %{cross}-binutils
 Version: 2.23.51.0.3
 Release: 2%{?dist}
 License: GPLv3+
@@ -92,21 +95,21 @@ of an object or archive file), strings (for listing printable strings
 from files), strip (for discarding symbols), and addr2line (for
 converting addresses to file and line).
 
-%package -n cross-binutils-common
+%package -n %{cross}-binutils-common
 Summary: Cross-build binary utility documentation and translation files
 Group: Development/Tools
 BuildArch: noarch
-%description -n cross-binutils-common
+%description -n %{cross}-binutils-common
 Documentation, manual pages and translation files for cross-build binary image
 generation, manipulation and query tools.
 
 %define do_package() \
 %if %2 \
-%package -n binutils-%1 \
+%package -n %{rpmprefix}binutils-%1 \
 Summary: Cross-build binary utilities for %1 \
 Group: Development/Tools \
-Requires: cross-binutils-common == %{version}-%{release} \
-%description -n binutils-%1 \
+Requires: %{cross}-binutils-common == %{version}-%{release} \
+%description -n %{rpmprefix}binutils-%1 \
 Cross-build binary image generation, manipulation and query tools. \
 %endif
 
@@ -191,7 +194,7 @@ sed -i -e 's/^libbfd_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' bfd/Makefile.{am
 sed -i -e 's/^libopcodes_la_LDFLAGS = /&-Wl,-Bsymbolic-functions /' opcodes/Makefile.{am,in}
 fi
 # $PACKAGE is used for the gettext catalog name.
-sed -i -e 's/^ PACKAGE=/ PACKAGE=cross-/' */configure
+sed -i -e 's/^ PACKAGE=/ PACKAGE=%{cross}-/' */configure
 # Undo the name change to run the testsuite.
 for tool in binutils gas ld
 do
@@ -374,8 +377,8 @@ do
 done
 
 # for documentation purposes only
-mkdir cross-binutils
-cd cross-binutils
+mkdir %{cross}-binutils
+cd %{cross}-binutils
 ../%{srcdir}/configure \
     --disable-dependency-tracking \
     --disable-silent-rules \
@@ -392,7 +395,7 @@ cd cross-binutils
     --sharedstatedir=%{_sharedstatedir} \
     --mandir=%{_mandir} \
     --infodir=%{_infodir} \
-    --program-prefix=cross- \
+    --program-prefix=%{cross}- \
     --disable-shared \
     --with-bugurl=http://bugzilla.redhat.com/bugzilla/
 make %{_smp_mflags} tooldir=%{_prefix} all
@@ -423,18 +426,18 @@ do
 done
 
 echo "=== INSTALL man targets ==="
-make install-man1 -C cross-binutils/binutils/doc DESTDIR=%{buildroot}
-make install-man1 -C cross-binutils/gas/doc DESTDIR=%{buildroot}
-make install-man1 -C cross-binutils/ld DESTDIR=%{buildroot}
-make install-man1 -C cross-binutils/gprof DESTDIR=%{buildroot}
+make install-man1 -C %{cross}-binutils/binutils/doc DESTDIR=%{buildroot}
+make install-man1 -C %{cross}-binutils/gas/doc DESTDIR=%{buildroot}
+make install-man1 -C %{cross}-binutils/ld DESTDIR=%{buildroot}
+make install-man1 -C %{cross}-binutils/gprof DESTDIR=%{buildroot}
 
 echo "=== INSTALL po targets ==="
-make install -C cross-binutils/binutils/po DESTDIR=%{buildroot}
-make install -C cross-binutils/gas/po DESTDIR=%{buildroot}
-make install -C cross-binutils/ld/po DESTDIR=%{buildroot}
-make install -C cross-binutils/gprof/po DESTDIR=%{buildroot}
-make install -C cross-binutils/bfd/po DESTDIR=%{buildroot}
-make install -C cross-binutils/opcodes/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/binutils/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/gas/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/ld/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/gprof/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/bfd/po DESTDIR=%{buildroot}
+make install -C %{cross}-binutils/opcodes/po DESTDIR=%{buildroot}
 
 # For cross-binutils we drop the documentation.
 echo "=== REMOVE documentation ==="
@@ -481,9 +484,9 @@ done
 # same, so symlink them to the core package
 echo "=== CROSSLINK man pages ==="
 cd %{buildroot}%{_mandir}/man1
-for i in cross-*.1*
+for i in %{cross}-*.1*
 do
-    j=${i#cross-}
+    j=${i#%{cross}-}
 
     for k in *-$j
     do
@@ -496,7 +499,7 @@ done
 
 
 # Add ld.bfd manual pages
-find * -name "*ld.1*" -a ! -name "cross-ld.1*" -print |
+find * -name "*ld.1*" -a ! -name "%{cross}-ld.1*" -print |
 while read x
 do
     y=`echo $x | sed -e s/ld[.]1/ld.bfd.1/`
@@ -507,18 +510,18 @@ cd -
 
 # Find the language files which only exist in the common package
 (
-    %find_lang cross-binutils
-    %find_lang cross-opcodes
-    %find_lang cross-bfd
-    %find_lang cross-gas
-    %find_lang cross-ld
-    %find_lang cross-gprof
-    cat cross-binutils.lang
-    cat cross-opcodes.lang
-    cat cross-bfd.lang
-    cat cross-gas.lang
-    cat cross-ld.lang
-    cat cross-gprof.lang
+    %find_lang %{cross}-binutils
+    %find_lang %{cross}-opcodes
+    %find_lang %{cross}-bfd
+    %find_lang %{cross}-gas
+    %find_lang %{cross}-ld
+    %find_lang %{cross}-gprof
+    cat %{cross}-binutils.lang
+    cat %{cross}-opcodes.lang
+    cat %{cross}-bfd.lang
+    cat %{cross}-gas.lang
+    cat %{cross}-ld.lang
+    cat %{cross}-gprof.lang
 ) >files.cross
 
 
@@ -536,14 +539,14 @@ rm -rf %{buildroot}
 # Filesets
 #
 ###############################################################################
-%files -n cross-binutils-common -f files.cross
+%files -n %{cross}-binutils-common -f files.cross
 %doc %{srcdir}/README
 %doc %{srcdir}/COPYING*
-%{_mandir}/man1/cross-*
+%{_mandir}/man1/%{cross}-*
 
 %define do_files() \
 %if %2 \
-%files -n binutils-%1 -f files.%1 \
+%files -n %{rpmprefix}binutils-%1 -f files.%1 \
 %endif
 
 %do_files alpha-linux-gnu	%{build_alpha}
@@ -585,6 +588,7 @@ rm -rf %{buildroot}
 %changelog
 * Tue Jun 4 2013 David Howells <dhowells at redhat.com> - 2.23.51.0.3-2
 - Backport cleanups from the RHEL-6.4 cross-compiler.
+- Backport some macroisation from the RHEL-6.4 cross-compiler.
 
 * Wed Feb 13 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.23.51.0.3-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild


More information about the scm-commits mailing list