[b3a8c23b] | 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 | |
---|
[70aecfc] | 12 | %if %build_newlib |
---|
| 13 | cd build/@tool_target@/newlib |
---|
| 14 | make DESTDIR=$RPM_BUILD_ROOT install-info |
---|
| 15 | cd ../../.. |
---|
| 16 | %endif |
---|
| 17 | |
---|
[44b241c] | 18 | %if "%{gcc_version}" <= "4.1.2" |
---|
[b3a8c23b] | 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 |
---|
[36c8e140] | 27 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty.a |
---|
[b3a8c23b] | 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 |
---|
[323f178] | 33 | # Seemingly a VAX tool. Not meaningful, here. |
---|
[b3a8c23b] | 34 | rm -f $RPM_BUILD_ROOT%{_bindir}/vxaddr2line%{_exeext} |
---|
| 35 | %endif |
---|
| 36 | |
---|
[e8a6236] | 37 | %if %build_infos |
---|
[b3a8c23b] | 38 | # We don't ship info/dir |
---|
| 39 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 40 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
[4557d3c] | 41 | %else |
---|
[b3a8c23b] | 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 | |
---|
[246717f] | 49 | %if %build_fortran |
---|
[b3a8c23b] | 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 | |
---|
[0539334d] | 66 | # Bug in gcc > 4.1.0: Installs an unused, empty directory |
---|
| 67 | if test -d ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits; then |
---|
| 68 | rmdir ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits |
---|
| 69 | fi |
---|
| 70 | |
---|
[b3a8c23b] | 71 | # Collect multilib subdirectories |
---|
[d257306] | 72 | f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'` |
---|
[b3a8c23b] | 73 | |
---|
[e8b0467] | 74 | %if %build_newlib |
---|
[d70a677] | 75 | echo "%defattr(-,root,root,-)" > build/files.newlib |
---|
[58255f77] | 76 | TGTDIR="%{_exec_prefix}/@tool_target@/lib" |
---|
[b3a8c23b] | 77 | for i in $f; do |
---|
| 78 | case $i in |
---|
[d70a677] | 79 | \.) echo "%dir ${TGTDIR}" >> build/files.newlib |
---|
[b3a8c23b] | 80 | ;; |
---|
[d70a677] | 81 | *) echo "%dir ${TGTDIR}/$i" >> build/files.newlib |
---|
[b3a8c23b] | 82 | ;; |
---|
| 83 | esac |
---|
| 84 | done |
---|
[e8b0467] | 85 | %endif |
---|
[b3a8c23b] | 86 | |
---|
| 87 | rm -f dirs ; |
---|
| 88 | echo "%defattr(-,root,root,-)" >> dirs |
---|
| 89 | %if "%{_prefix}" != "/usr" |
---|
| 90 | echo "%dir %{_prefix}" >> dirs |
---|
| 91 | echo "%dir %{_libdir}" >> dirs |
---|
| 92 | %if "%{gcc_version}" >= "3.4" |
---|
| 93 | echo "%dir %{_libexecdir}" >> dirs |
---|
| 94 | %endif |
---|
| 95 | %endif |
---|
| 96 | echo "%dir %{gcclib}" >> dirs |
---|
| 97 | echo "%dir %{gcclib}/@tool_target@" >> dirs |
---|
| 98 | |
---|
| 99 | TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}" |
---|
| 100 | for i in $f; do |
---|
| 101 | case $i in |
---|
| 102 | \.) echo "%dir ${TGTDIR}" >> dirs |
---|
| 103 | ;; |
---|
| 104 | *) echo "%dir ${TGTDIR}/$i" >> dirs |
---|
| 105 | ;; |
---|
| 106 | esac |
---|
| 107 | done |
---|
| 108 | |
---|
| 109 | # Collect files to go into different packages |
---|
| 110 | cp dirs build/files.gcc |
---|
| 111 | cp dirs build/files.gfortran |
---|
| 112 | cp dirs build/files.objc |
---|
| 113 | cp dirs build/files.gcj |
---|
| 114 | cp dirs build/files.g++ |
---|
| 115 | |
---|
| 116 | TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}" |
---|
| 117 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 118 | for i in $f; do |
---|
| 119 | case $i in |
---|
| 120 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs |
---|
| 121 | *f771) ;; |
---|
| 122 | *f951) ;; |
---|
| 123 | *cc1) ;; |
---|
| 124 | *cc1obj) ;; |
---|
| 125 | *cc1plus) ;; # ignore: explicitly put into rpm elsewhere |
---|
| 126 | *collect2) ;; |
---|
| 127 | *libobjc*) echo "$i" >> build/files.objc ;; |
---|
| 128 | *include/objc*) ;; |
---|
| 129 | *include/g++*);; |
---|
| 130 | *include/c++*);; |
---|
[bbdde8b] | 131 | *finclude/*);; |
---|
[b3a8c23b] | 132 | *adainclude*);; |
---|
| 133 | *adalib*);; |
---|
| 134 | *gnat1);; |
---|
| 135 | *jc1) ;; |
---|
| 136 | *jvgenmain) ;; |
---|
[61b0cc6] | 137 | */libgfortran*.*) echo "$i" >> build/files.gfortran ;; |
---|
[b3a8c23b] | 138 | */libstdc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 139 | */libsupc++.*) echo "$i" >> build/files.g++ ;; |
---|
| 140 | *) echo "$i" >> build/files.gcc ;; |
---|
| 141 | esac |
---|
| 142 | done |
---|
| 143 | |
---|
[58255f77] | 144 | TGTDIR="%{_exec_prefix}/@tool_target@/lib" |
---|
[b3a8c23b] | 145 | f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 146 | for i in $f; do |
---|
| 147 | case $i in |
---|
| 148 | *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs |
---|
| 149 | *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed |
---|
[d70a677] | 150 | # all other files belong to newlib |
---|
| 151 | *) echo "$i" >> build/files.newlib ;; |
---|
[b3a8c23b] | 152 | esac |
---|
| 153 | done |
---|