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 | BuildRequires: /sbin/install-info |
---|
13 | BuildRequires: texinfo >= 4.2 |
---|
14 | BuildRequires: flex |
---|
15 | |
---|
16 | Version: %{binutils_version} |
---|
17 | Source0: ftp://ftp.gnu.org/pub/gnu/binutils/binutils-%{binutils_version}@binutils_suffix@ |
---|
18 | @PATCH1@ |
---|
19 | |
---|
20 | Source98: brp-rtems-strip.in |
---|
21 | Source99: brp-rtems-compress.in |
---|
22 | |
---|
23 | %define __os_install_post ./brp-rtems-compress && ./brp-rtems-strip |
---|
24 | |
---|
25 | # |
---|
26 | # The original sources are not included in the source RPM. |
---|
27 | # If we included them, then the source RPMs for each target |
---|
28 | # would duplicate MBs of source unnecessarily. This is |
---|
29 | # a duplication of over 30 MBs of source for each of |
---|
30 | # the more than 10 targets it is possible to build. |
---|
31 | # |
---|
32 | # You can get them yourself from the Internet and copy them to |
---|
33 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
34 | # Or you can try the ftp options of rpm :-) |
---|
35 | # |
---|
36 | %{?!_with_sources:NoSource: 0} |
---|
37 | |
---|
38 | # %description |
---|
39 | # |
---|
40 | # RTEMS is an open source operating system for embedded systems. |
---|
41 | # |
---|
42 | # This is binutils sources with patches for RTEMS. |
---|
43 | |
---|
44 | %prep |
---|
45 | %setup -c -T -n %{name}-%{version} -a0 |
---|
46 | |
---|
47 | sed 's,@BRPSTRIPPATH@,.%_bindir .%_prefix/%binutils_target/bin,' \ |
---|
48 | %SOURCE98 > brp-rtems-strip |
---|
49 | chmod +x brp-rtems-strip |
---|
50 | |
---|
51 | sed 's,@BRPCOMPRESSPATH@,.%_mandir/man* .%_infodir,' \ |
---|
52 | %SOURCE99 > brp-rtems-compress |
---|
53 | chmod +x brp-rtems-compress |
---|
54 | |
---|
55 | cd binutils-%{version} |
---|
56 | %{?PATCH0:%patch0 -p1} |
---|
57 | cd .. |
---|
58 | |
---|
59 | mkdir -p build |
---|
60 | |
---|
61 | %build |
---|
62 | cd build |
---|
63 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
64 | ../binutils-%{binutils_version}/configure \ |
---|
65 | --build=%_build --host=%_host \ |
---|
66 | --target=%{binutils_target} \ |
---|
67 | --verbose --disable-nls \ |
---|
68 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
69 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
70 | --mandir=%{_mandir} --infodir=%{_infodir} \ |
---|
71 | |
---|
72 | make all |
---|
73 | make info |
---|
74 | |
---|
75 | |
---|
76 | %install |
---|
77 | rm -rf $RPM_BUILD_ROOT |
---|
78 | |
---|
79 | cd build |
---|
80 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
81 | bindir=$RPM_BUILD_ROOT%{_bindir} \ |
---|
82 | includedir=$RPM_BUILD_ROOT%{_includedir} \ |
---|
83 | libdir=$RPM_BUILD_ROOT%{_libdir} \ |
---|
84 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
85 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
86 | install |
---|
87 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
88 | bindir=$RPM_BUILD_ROOT%{_bindir} \ |
---|
89 | includedir=$RPM_BUILD_ROOT%{_includedir} \ |
---|
90 | libdir=$RPM_BUILD_ROOT%{_libdir} \ |
---|
91 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
92 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
93 | install-info |
---|
94 | |
---|
95 | # A bug in binutils: binutils does not install share/locale |
---|
96 | # however it uses it |
---|
97 | mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale |
---|
98 | |
---|
99 | %if "%{_prefix}" != "/usr" |
---|
100 | %if "%{binutils_version}" < "2.9.5" |
---|
101 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info* |
---|
102 | %endif |
---|
103 | |
---|
104 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
105 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
106 | %endif |
---|
107 | |
---|
108 | %if "%{_prefix}" == "/usr" |
---|
109 | # Conflict with a native binutils' infos |
---|
110 | rm -rf $RPM_BUILD_ROOT%{_infodir} |
---|
111 | %endif |
---|
112 | |
---|
113 | # We don't ship host files |
---|
114 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
115 | |
---|
116 | cd .. |
---|