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