| 1 | #disable lxlite strip | 
|---|
| 2 | %define __os_install_post       %{nil} | 
|---|
| 3 |  | 
|---|
| 4 | # rpmbuild parameters: | 
|---|
| 5 | # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils. | 
|---|
| 6 | # --with debug: Build without optimizations and without splitting the debuginfo. | 
|---|
| 7 | # --without testsuite: Do not run the testsuite.  Default is to run it. | 
|---|
| 8 | # --with testsuite: Run the testsuite.  Default --with debug is not to run it. | 
|---|
| 9 |  | 
|---|
| 10 | %bcond_with testsuite | 
|---|
| 11 |  | 
|---|
| 12 | %if 0%{!?binutils_target:1} | 
|---|
| 13 | %define binutils_target %{_target_platform} | 
|---|
| 14 | %define isnative 1 | 
|---|
| 15 | %define enable_shared 1 | 
|---|
| 16 | %else | 
|---|
| 17 | %define cross %{binutils_target}- | 
|---|
| 18 | %define isnative 0 | 
|---|
| 19 | %define enable_shared 0 | 
|---|
| 20 | %endif | 
|---|
| 21 |  | 
|---|
| 22 | Summary: A GNU collection of binary utilities | 
|---|
| 23 | Name: %{?cross}binutils%{?_with_debug:-debug} | 
|---|
| 24 | Version: 2.21 | 
|---|
| 25 | Release: 1%{?dist} | 
|---|
| 26 | License: GPLv3+ | 
|---|
| 27 | Group: Development/Tools | 
|---|
| 28 | URL: http://sources.redhat.com/binutils | 
|---|
| 29 | Source: binutils-2.21-os2-20101212.zip | 
|---|
| 30 |  | 
|---|
| 31 | %define gold_arches %ix86 x86_64 | 
|---|
| 32 |  | 
|---|
| 33 | %ifarch %gold_arches | 
|---|
| 34 | %define build_gold      both | 
|---|
| 35 | %else | 
|---|
| 36 | %define build_gold      no | 
|---|
| 37 | %endif | 
|---|
| 38 |  | 
|---|
| 39 | %if 0%{?_with_debug:1} | 
|---|
| 40 | # Define this if you want to skip the strip step and preserve debug info. | 
|---|
| 41 | # Useful for testing. | 
|---|
| 42 | %define __debug_install_post : > %{_builddir}/%{?buildsubdir}/debugfiles.list | 
|---|
| 43 | %define debug_package %{nil} | 
|---|
| 44 | %define run_testsuite 0%{?_with_testsuite:1} | 
|---|
| 45 | %else | 
|---|
| 46 | %define run_testsuite 0%{!?_without_testsuite:1} | 
|---|
| 47 | %endif | 
|---|
| 48 |  | 
|---|
| 49 | #Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) | 
|---|
| 50 | #BuildRequires: texinfo >= 4.0, gettext, flex, bison, zlib-devel | 
|---|
| 51 |  | 
|---|
| 52 | # Required for: ld-bootstrap/bootstrap.exp bootstrap with --static | 
|---|
| 53 | # It should not be required for: ld-elf/elf.exp static {preinit,init,fini} array | 
|---|
| 54 | %if %{run_testsuite} | 
|---|
| 55 | #BuildRequires: dejagnu, zlib-static, glibc-static, sharutils | 
|---|
| 56 | %endif | 
|---|
| 57 |  | 
|---|
| 58 | Conflicts: gcc-c++ < 4.0.0 | 
|---|
| 59 | #Requires(post): /sbin/install-info | 
|---|
| 60 | #Requires(preun): /sbin/install-info | 
|---|
| 61 | %ifarch ia64 | 
|---|
| 62 | Obsoletes: gnupro <= 1117-1 | 
|---|
| 63 | %endif | 
|---|
| 64 |  | 
|---|
| 65 | # The higher of these two numbers determines the default ld. | 
|---|
| 66 | %{!?ld_bfd_priority: %define ld_bfd_priority    50} | 
|---|
| 67 | %{!?ld_gold_priority:%define ld_gold_priority   30} | 
|---|
| 68 |  | 
|---|
| 69 | %if "%{build_gold}" == "both" | 
|---|
| 70 | #Requires(post): coreutils | 
|---|
| 71 | #Requires(post): %{_sbindir}/alternatives | 
|---|
| 72 | #Requires(preun): %{_sbindir}/alternatives | 
|---|
| 73 | %endif | 
|---|
| 74 |  | 
|---|
| 75 | # On ARM EABI systems, we do want -gnueabi to be part of the | 
|---|
| 76 | # target triple. | 
|---|
| 77 | %ifnarch %{arm} | 
|---|
| 78 | %define _gnu %{nil} | 
|---|
| 79 | %endif | 
|---|
| 80 |  | 
|---|
| 81 | %description | 
|---|
| 82 | Binutils is a collection of binary utilities, including ar (for | 
|---|
| 83 | creating, modifying and extracting from archives), as (a family of GNU | 
|---|
| 84 | assemblers), gprof (for displaying call graph profile data), ld (the | 
|---|
| 85 | GNU linker), nm (for listing symbols from object files), objcopy (for | 
|---|
| 86 | copying and translating object files), objdump (for displaying | 
|---|
| 87 | information from object files), ranlib (for generating an index for | 
|---|
| 88 | the contents of an archive), readelf (for displaying detailed | 
|---|
| 89 | information about binary files), size (for listing the section sizes | 
|---|
| 90 | of an object or archive file), strings (for listing printable strings | 
|---|
| 91 | from files), strip (for discarding symbols), and addr2line (for | 
|---|
| 92 | converting addresses to file and line). | 
|---|
| 93 |  | 
|---|
| 94 | %package devel | 
|---|
| 95 | Summary: BFD and opcodes dynamic libraries and header files | 
|---|
| 96 | Group: System Environment/Libraries | 
|---|
| 97 | #Conflicts: binutils < 2.17.50.0.3-4 | 
|---|
| 98 | #Requires(post): /sbin/install-info | 
|---|
| 99 | #Requires(preun): /sbin/install-info | 
|---|
| 100 | Requires: zlib-devel | 
|---|
| 101 |  | 
|---|
| 102 | %description devel | 
|---|
| 103 | This package contains the generic BFD and opcodes dynamic libraries and | 
|---|
| 104 | associated header files.  Developers starting new projects are encouraged | 
|---|
| 105 | to consider using libelf instead of BFD. | 
|---|
| 106 |  | 
|---|
| 107 | %package static | 
|---|
| 108 | Summary: BFD and opcodes static libraries | 
|---|
| 109 | Group: System Environment/Libraries | 
|---|
| 110 | #Requires(post): /sbin/install-info | 
|---|
| 111 | #Requires(preun): /sbin/install-info | 
|---|
| 112 |  | 
|---|
| 113 | %description static | 
|---|
| 114 | This package contains BFD and opcodes static libraries.  Developers | 
|---|
| 115 | starting new projects are strongly encouraged to consider using | 
|---|
| 116 | libelf instead of BFD. | 
|---|
| 117 |  | 
|---|
| 118 | %prep | 
|---|
| 119 | %setup -q -c | 
|---|
| 120 |  | 
|---|
| 121 | %build | 
|---|
| 122 |  | 
|---|
| 123 | %install | 
|---|
| 124 | rm -rf %{buildroot} | 
|---|
| 125 | mkdir -p %{buildroot}%{_usr} | 
|---|
| 126 | cp -p -r "binutils/*" %{buildroot}%{_usr} | 
|---|
| 127 |  | 
|---|
| 128 | rm  %{buildroot}%{_libdir}/*.la | 
|---|
| 129 | rm  %{buildroot}%{_usr}/readme.os2 | 
|---|
| 130 | rm  %{buildroot}%{_infodir}/dir | 
|---|
| 131 |  | 
|---|
| 132 | %clean | 
|---|
| 133 | rm -rf %{buildroot} | 
|---|
| 134 |  | 
|---|
| 135 | %post | 
|---|
| 136 |  | 
|---|
| 137 | %preun | 
|---|
| 138 |  | 
|---|
| 139 | %files | 
|---|
| 140 | %defattr(-,root,root,-) | 
|---|
| 141 | %doc binutils/readme.os2 | 
|---|
| 142 | %{_bindir}/* | 
|---|
| 143 | %{_usr}/i386-pc-os2-emx/* | 
|---|
| 144 | %{_mandir}/man1/* | 
|---|
| 145 | %{_infodir}/[^b]*info* | 
|---|
| 146 | %{_infodir}/binutils*info* | 
|---|
| 147 |  | 
|---|
| 148 | %files devel | 
|---|
| 149 | %defattr(-,root,root,-) | 
|---|
| 150 | %{_includedir}/* | 
|---|
| 151 | %{_infodir}/bfd*info* | 
|---|
| 152 |  | 
|---|
| 153 | %files static | 
|---|
| 154 | %defattr(-,root,root,-) | 
|---|
| 155 | %{_libdir}/*.a | 
|---|
| 156 |  | 
|---|
| 157 | %changelog | 
|---|