1 | |
---|
2 | %define binutils_version @binutils_version@ |
---|
3 | %define binutils_target @target_alias@ |
---|
4 | |
---|
5 | Name: %{rpmprefix}%{binutils_target}-binutils |
---|
6 | Summary: binutils for target %{binutils_target} |
---|
7 | Group: %{rpmgroup} |
---|
8 | Release: @Release@ |
---|
9 | License: GPL/LGPL |
---|
10 | |
---|
11 | Packager: ralf.corsepius@rtems.org and joel@OARcorp.com |
---|
12 | Prefix: %{_prefix} |
---|
13 | BuildPreReq: /sbin/install-info |
---|
14 | BuildPreReq: texinfo >= 4.2 |
---|
15 | BuildPreReq: flex |
---|
16 | |
---|
17 | Version: %{binutils_version} |
---|
18 | Source0: ftp://ftp.gnu.org/pub/gnu/binutils/binutils-%{binutils_version}@binutils_suffix@ |
---|
19 | @PATCH1@ |
---|
20 | |
---|
21 | # |
---|
22 | # The original sources are not included in the source RPM. |
---|
23 | # If we included them, then the source RPMs for each target |
---|
24 | # would duplicate MBs of source unnecessarily. This is |
---|
25 | # a duplication of over 30 MBs of source for each of |
---|
26 | # the more than 10 targets it is possible to build. |
---|
27 | # |
---|
28 | # You can get them yourself from the Internet and copy them to |
---|
29 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
30 | # Or you can try the ftp options of rpm :-) |
---|
31 | # |
---|
32 | %{?!_with_sources:NoSource: 0} |
---|
33 | |
---|
34 | # %description |
---|
35 | # |
---|
36 | # RTEMS is an open source operating system for embedded systems. |
---|
37 | # |
---|
38 | # This is binutils sources with patches for RTEMS. |
---|
39 | |
---|
40 | %prep |
---|
41 | %setup -c -n %{name}-%{version} |
---|
42 | |
---|
43 | cd binutils-%{version} |
---|
44 | %{?PATCH0:%patch0 -p1} |
---|
45 | cd .. |
---|
46 | |
---|
47 | test -d build || mkdir build |
---|
48 | |
---|
49 | %build |
---|
50 | cd build |
---|
51 | ../binutils-%{binutils_version}/configure \ |
---|
52 | --build=%_build --host=%_host \ |
---|
53 | --target=%{binutils_target} \ |
---|
54 | --verbose --disable-nls \ |
---|
55 | --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} |
---|
56 | |
---|
57 | make all |
---|
58 | make info |
---|
59 | |
---|
60 | |
---|
61 | %install |
---|
62 | cd build |
---|
63 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
64 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
65 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
66 | install |
---|
67 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
68 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
69 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
70 | install-info |
---|
71 | # A bug in binutils: binutils does not install share/locale |
---|
72 | # however it uses it |
---|
73 | ../binutils-%{binutils_version}/mkinstalldirs \ |
---|
74 | $RPM_BUILD_ROOT%{_prefix}/share/locale |
---|
75 | |
---|
76 | # gzip info files |
---|
77 | # gzip info files |
---|
78 | ls $RPM_BUILD_ROOT%{_infodir}/*.info \ |
---|
79 | $RPM_BUILD_ROOT%{_infodir}/*.info-? \ |
---|
80 | $RPM_BUILD_ROOT%{_infodir}/*.info-?? 2>/dev/null \ |
---|
81 | | while read a; do \ |
---|
82 | gzip -9qf $a 2>/dev/null; \ |
---|
83 | done |
---|
84 | |
---|
85 | # We assume that info/dir exists when building the RPMs |
---|
86 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
87 | f=`find $RPM_BUILD_ROOT%{_prefix}/info -name '*.info.gz'` |
---|
88 | test x"$f" != x"" && for i in $f; do |
---|
89 | /sbin/install-info $i $RPM_BUILD_ROOT%{_infodir}/dir |
---|
90 | done |
---|
91 | |
---|
92 | # gzip man pages |
---|
93 | gzip -9qf $RPM_BUILD_ROOT%{_mandir}/man?/*.? 2>/dev/null |
---|
94 | |
---|
95 | # We don't ship host files |
---|
96 | rm -f ${RPM_BUILD_ROOT}%{_prefix}/lib/libiberty* |
---|