source: rtems/contrib/crossrpms/gcc/install.add @ 0539334d

4.104.115
Last change on this file since 0539334d was 0539334d, checked in by Ralf Corsepius <ralf.corsepius@…>, on Mar 29, 2009 at 3:26:22 AM

rmdir ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits

  • Property mode set to 100644
File size: 4.2 KB
Line 
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.2"
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}%{_libdir}/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%if %build_cxx
67  # Bug in gcc > 4.1.0: Installs an unused, empty directory
68  if test -d ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits; then
69    rmdir ${RPM_BUILD_ROOT}%{_prefix}/@tool_target@/include/bits
70  fi
71%endif
72
73  # Collect multilib subdirectories
74  f=`build/gcc/xgcc -Bbuild/gcc/ --print-multi-lib | sed -e 's,;.*$,,'`
75
76%if %build_newlib
77  echo "%defattr(-,root,root,-)" > build/files.newlib
78  TGTDIR="%{_exec_prefix}/@tool_target@/lib"
79  for i in $f; do
80    case $i in
81    \.) echo "%dir ${TGTDIR}" >> build/files.newlib
82      ;;
83    *)  echo "%dir ${TGTDIR}/$i" >> build/files.newlib
84      ;;
85    esac
86  done
87%endif
88
89  rm -f dirs ;
90  echo "%defattr(-,root,root,-)" >> dirs
91%if "%{_prefix}" != "/usr"
92  echo "%dir %{_prefix}" >> dirs
93  echo "%dir %{_libdir}" >> dirs
94%if "%{gcc_version}" >= "3.4"
95  echo "%dir %{_libexecdir}" >> dirs
96%endif
97%endif
98  echo "%dir %{gcclib}" >> dirs
99  echo "%dir %{gcclib}/@tool_target@" >> dirs
100
101  TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
102  for i in $f; do
103    case $i in
104    \.) echo "%dir ${TGTDIR}" >> dirs
105      ;;
106    *)  echo "%dir ${TGTDIR}/$i" >> dirs
107      ;;
108    esac
109  done
110
111  # Collect files to go into different packages
112  cp dirs build/files.gcc
113  cp dirs build/files.g77
114  cp dirs build/files.gfortran
115  cp dirs build/files.objc
116  cp dirs build/files.gcj
117  cp dirs build/files.g++
118
119  TGTDIR="%{gcclib}/@tool_target@/%{gcc_version}"
120  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
121  for i in $f; do
122    case $i in
123    *lib*.la) rm ${RPM_BUILD_ROOT}/$i ;; # ignore: gcc produces bogus libtool libs
124    *f771) ;;
125    *f951) ;;
126    *cc1) ;;
127    *cc1obj) ;;
128    *cc1plus) ;; # ignore: explicitly put into rpm elsewhere
129    *collect2) ;;
130    *libobjc*) echo "$i" >> build/files.objc ;;
131    *include/objc*) ;;
132    *include/g++*);;
133    *include/c++*);;
134    *adainclude*);;
135    *adalib*);;
136    *gnat1);;
137    *jc1) ;;
138    *jvgenmain) ;;
139    */libgfortran*.*) echo "$i" >> build/files.gfortran ;;
140    */libstdc++.*) echo "$i" >> build/files.g++ ;;
141    */libsupc++.*) echo "$i" >> build/files.g++ ;;
142    *) echo "$i" >> build/files.gcc ;;
143    esac
144  done
145
146  TGTDIR="%{_exec_prefix}/@tool_target@/lib"
147  f=`find ${RPM_BUILD_ROOT}${TGTDIR} ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`;
148  for i in $f; do
149    case $i in
150    *lib*.la) rm ${RPM_BUILD_ROOT}/$i;; # ignore - gcc produces bogus libtool libs
151    *libiberty.a) rm ${RPM_BUILD_ROOT}/$i ;; # ignore - GPL'ed
152# all other files belong to newlib
153    *) echo "$i" >> build/files.newlib ;;
154    esac
155  done
Note: See TracBrowser for help on using the repository browser.