1 | %install |
---|
2 | %if "%{_prefix}" != "/usr" |
---|
3 | export PATH="%{_bindir}:${PATH}" |
---|
4 | %endif |
---|
5 | rm -rf $RPM_BUILD_ROOT |
---|
6 | |
---|
7 | cd build |
---|
8 | |
---|
9 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
10 | # cd back to build/ |
---|
11 | cd .. |
---|
12 | |
---|
13 | %if "%{gcc_version}" < "4.0.3" |
---|
14 | # Misplaced header file |
---|
15 | if test -f $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h; then |
---|
16 | mv $RPM_BUILD_ROOT%{_includedir}/mf-runtime.h \ |
---|
17 | $RPM_BUILD_ROOT%{gcclib}/@tool_target@/%{gcc_version}/include/ |
---|
18 | fi |
---|
19 | %endif |
---|
20 | |
---|
21 | # host library |
---|
22 | rm -f ${RPM_BUILD_ROOT}%{_prefix}/lib/libiberty.a |
---|
23 | |
---|
24 | # We use the version from binutils |
---|
25 | rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-c++filt%{_exeext} |
---|
26 | |
---|
27 | %if %build_gnat |
---|
28 | # Seemingly a VAX tool. Not meaningful for RTEMS |
---|
29 | rm -f $RPM_BUILD_ROOT%{_bindir}/vxaddr2line%{_exeext} |
---|
30 | %endif |
---|
31 | |
---|
32 | %if "%{_prefix}" != "/usr" |
---|
33 | # We don't ship info/dir |
---|
34 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
35 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
36 | %endif |
---|
37 | |
---|
38 | %if "%{_prefix}" == "/usr" |
---|
39 | # Conflict with a native GCC's infos |
---|
40 | rm -rf $RPM_BUILD_ROOT%{_infodir} |
---|
41 | |
---|
42 | # Conflict with a native GCC's man pages |
---|
43 | rm -rf $RPM_BUILD_ROOT%{_mandir}/man7 |
---|
44 | %endif |
---|
45 | |
---|
46 | %if %build_f95 |
---|
47 | # # Bug in gcc-4.0.0pre |
---|
48 | # mv $RPM_BUILD_ROOT%{_bindir}/gfortran $RPM_BUILD_ROOT%{_bindir}/@tool_target@-gfortran |
---|
49 | %endif |
---|
50 | |
---|
51 | %if "%{gcc_version}" >= "3.4" |
---|
52 | # Bug in gcc-3.4.0pre |
---|
53 | rm -f $RPM_BUILD_ROOT%{_bindir}/@tool_target@-@tool_target@-gcjh%{_exeext} |
---|
54 | %endif |
---|
55 | |
---|
56 | %if "%{gcc_version}" >= "3.3" |
---|
57 | # Bug in gcc-3.3.x/gcc-3.4.x: Despite we don't need fixincludes, it installs |
---|
58 | # the fixinclude-install-tools |
---|
59 | rm -rf ${RPM_BUILD_ROOT}%{gcclib}/@tool_target@/%{gcc_version}/install-tools |
---|
60 | rm -rf ${RPM_BUILD_ROOT}%{gccexec}/@tool_target@/%{gcc_version}/install-tools |
---|
61 | %endif |
---|
62 | |
---|
63 | # Collect multilib subdirectories |
---|
64 | f=`gcc/xgcc -Bgcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
65 | |
---|
66 | echo "%defattr(-,root,root,-)" > build/files.newlib |
---|
67 | TGTDIR="%{_prefix}/@tool_target@/lib" |
---|
68 | for i in $f; do |
---|
69 | case $i in |
---|
70 | \.) echo "%dir ${TGTDIR}" >> build/files.newlib |
---|
71 | ;; |
---|
72 | *) echo "%dir ${TGTDIR}/$i" >> build/files.newlib |
---|
73 | ;; |
---|
74 | esac |
---|
75 | done |
---|
76 | |
---|
77 | rm -f dirs ; |
---|
78 | echo "%defattr(-,root,root,-)" >> dirs |
---|
79 | %if "%{_prefix}" != "/usr" |
---|
80 | echo "%dir %{_prefix}" >> dirs |
---|
81 | echo "%dir %{_libdir}" >> dirs |
---|
82 | %if "%{gcc_version}" >= "3.4" |
---|
83 | echo "%dir %{_libexecdir}" >> dirs |
---|
84 | %endif |
---|
85 | %endif |
---|
86 | echo "%dir %{gcclib}" >> dirs |
---|
87 | echo "%dir %{gcclib}/@tool_target@" >> dirs |
---|
88 | |
---|
89 | TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}" |
---|
90 | for i in $f; do |
---|
91 | case $i in |
---|
92 | \.) echo "%dir ${TGTDIR}" >> dirs |
---|
93 | ;; |
---|
94 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
95 | ;; |
---|
96 | esac |
---|
97 | done |
---|
98 | |
---|
99 | # Collect files to go into different packages |
---|
100 | cp dirs build/files.gcc |
---|
101 | cp dirs build/files.g77 |
---|
102 | cp dirs build/files.gfortran |
---|
103 | cp dirs build/files.objc |
---|
104 | cp dirs build/files.gcj |
---|
105 | cp dirs build/files.g++ |
---|
106 | |
---|
107 | TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}" |
---|
108 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
109 | for i in $f; do |
---|
110 | case $i in |
---|
111 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
112 | *f771) ;; |
---|
113 | *f951) ;; |
---|
114 | *cc1) ;; |
---|
115 | *cc1obj) ;; |
---|
116 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
117 | *collect2) ;; |
---|
118 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
119 | *include/objc*) ;; |
---|
120 | *include/g++*);; |
---|
121 | *include/c++*);; |
---|
122 | *adainclude*);; |
---|
123 | *adalib*);; |
---|
124 | *gnat1);; |
---|
125 | *jc1) ;; |
---|
126 | *jvgenmain) ;; |
---|
127 | *libgfortran*.a) echo "$i" >> build/files.gfortran ;; |
---|
128 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
129 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
130 | *) echo "$i" >> build/files.gcc ;; |
---|
131 | esac |
---|
132 | done |
---|
133 | |
---|
134 | TGTDIR="%{_prefix}/@tool_target@/lib" |
---|
135 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
136 | for i in $f; do |
---|
137 | case $i in |
---|
138 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
139 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
140 | # all other files belong to newlib |
---|
141 | *) echo "$i" >> build/files.newlib ;; |
---|
142 | esac |
---|
143 | done |
---|