1 | # |
---|
2 | # spec file for building gcc for rtems |
---|
3 | # |
---|
4 | # Copyright (c) 1999 OARCorp, Huntsville, AL |
---|
5 | # |
---|
6 | # please send bugfixes or comments to joel@OARcorp.com |
---|
7 | # |
---|
8 | |
---|
9 | Vendor: OAR Corporation |
---|
10 | Distribution: Linux |
---|
11 | Name: @target_alias@-gcc-newlib |
---|
12 | Summary: gcc and newlib C Library for @target_alias@. |
---|
13 | Group: rtems |
---|
14 | Release: @Release@ |
---|
15 | Copyright: 1999 OARCorp |
---|
16 | |
---|
17 | Provides: @target_alias@-gcc |
---|
18 | Requires: @target_alias@-binutils |
---|
19 | |
---|
20 | Autoreqprov: on |
---|
21 | Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com |
---|
22 | |
---|
23 | Version: gcc@gcc_version@newlib@newlib_version@ |
---|
24 | Source0: ftp://ftp.gnu.org/pub/gnu/gcc/gcc-@gcc_version@.tar.gz |
---|
25 | Source1: ftp://sourceware.cygnus/com/pub/newlib/newlib-@newlib_version@.tar.gz |
---|
26 | Patch0: gcc-@gcc_version@-rtems-@gcc_patch_version@.diff |
---|
27 | Patch1: newlib-@newlib_version@-rtems-@newlib_patch_version@.diff |
---|
28 | Buildroot: /tmp |
---|
29 | |
---|
30 | # |
---|
31 | # The original sources are not included in the source RPM. |
---|
32 | # If we included them, then the source RPMs for each target |
---|
33 | # would duplicate MBs of source unnecessarily. This is |
---|
34 | # a duplication of over 30 MBs of source for each of |
---|
35 | # the more than 10 targets it is possible to build. |
---|
36 | # |
---|
37 | # You can get them yourself from the Internet and copy them to |
---|
38 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
39 | # Or you can try the ftp options of rpm :-) |
---|
40 | # |
---|
41 | NoSource: 0, 1 |
---|
42 | |
---|
43 | %description |
---|
44 | RTEMS is an open source operating system for embedded systems. |
---|
45 | |
---|
46 | This is gcc's and newlib C Library's sources with patches for RTEMS. |
---|
47 | |
---|
48 | The original sources are not included in the source RPM. |
---|
49 | If we included them, then the source RPMs for each target |
---|
50 | would duplicate MBs of source unnecessarily. This is |
---|
51 | a duplication of over 30 MBs of source for each of |
---|
52 | the more than 10 targets it is possible to build. |
---|
53 | |
---|
54 | You can get them yourself from the Internet and copy them to |
---|
55 | your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
56 | Or you can try the ftp options of rpm :-) |
---|
57 | |
---|
58 | %prep |
---|
59 | # untar the sources inside @target_alias@-gcc-newlib |
---|
60 | %setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 |
---|
61 | |
---|
62 | %patch0 -p0 |
---|
63 | %patch1 -p0 |
---|
64 | |
---|
65 | # Copy the C library into gcc's source tree |
---|
66 | ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@ |
---|
67 | test -d build || mkdir build |
---|
68 | |
---|
69 | %build |
---|
70 | cd build |
---|
71 | ../gcc-@gcc_version@/configure --target=@target_alias@ \ |
---|
72 | --with-gnu-as --with-gnu-ld --with-newlib --verbose \ |
---|
73 | --prefix=/opt/rtems '--enable-languages=c,c++' |
---|
74 | |
---|
75 | make all |
---|
76 | make info |
---|
77 | |
---|
78 | %install |
---|
79 | cd build |
---|
80 | # Bug in gcc-2.95.1: It doesn't build this installation directory |
---|
81 | # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc |
---|
82 | ../gcc-@gcc_version@/mkinstalldirs \ |
---|
83 | $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin |
---|
84 | |
---|
85 | make prefix=$RPM_BUILD_ROOT/opt/rtems install |
---|
86 | cd @target_alias@/newlib |
---|
87 | make prefix=$RPM_BUILD_ROOT/opt/rtems install-info |
---|
88 | |
---|
89 | # cd back to build/ |
---|
90 | cd ../.. |
---|
91 | |
---|
92 | # gzip info files |
---|
93 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null |
---|
94 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null |
---|
95 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null |
---|
96 | |
---|
97 | rm -f dirs ; |
---|
98 | echo "%dir /opt/rtems/lib" >> dirs ; |
---|
99 | echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ; |
---|
100 | echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ; |
---|
101 | |
---|
102 | # Collect multilib subdirectories |
---|
103 | TGTDIR="$RPM_BUILD_ROOT/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@" |
---|
104 | find $TGTDIR \ |
---|
105 | \( -type d -a ! -path "$TGTDIR/include*" \) -print | \ |
---|
106 | sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs |
---|
107 | |
---|
108 | # Collect files to go into different packages |
---|
109 | cp dirs files.gcc |
---|
110 | |
---|
111 | f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
112 | for i in $f; do |
---|
113 | case $i in |
---|
114 | # *chill*) echo "$i" >> files.chill ;; |
---|
115 | # *f771) ;; |
---|
116 | # *cc1obj) ;; |
---|
117 | # *libobjc*) echo "$i" >> files.objc ;; |
---|
118 | # *include/objc*) ;; |
---|
119 | # *jc1) ;; |
---|
120 | # *jvgenmain) ;; |
---|
121 | *) echo "$i" >> files.gcc ;; |
---|
122 | esac |
---|
123 | done |
---|
124 | |
---|
125 | %files -f build/files.gcc |
---|
126 | %dir /opt/rtems/info |
---|
127 | %doc /opt/rtems/info/dir |
---|
128 | %doc /opt/rtems/info/cpp.info* |
---|
129 | %doc /opt/rtems/info/gcc.info* |
---|
130 | %doc /opt/rtems/info/libc.info* |
---|
131 | %doc /opt/rtems/info/libm.info* |
---|
132 | |
---|
133 | %dir /opt/rtems/man |
---|
134 | %dir /opt/rtems/man/man1 |
---|
135 | %doc /opt/rtems/man/man1/cccp.1 |
---|
136 | %doc /opt/rtems/man/man1/@target_alias@-gcc.1 |
---|
137 | %doc /opt/rtems/man/man1/@target_alias@-g++.1 |
---|
138 | |
---|
139 | %dir /opt/rtems/bin |
---|
140 | /opt/rtems/bin/cpp@exe_ext@ |
---|
141 | /opt/rtems/bin/gcov@exe_ext@ |
---|
142 | /opt/rtems/bin/@target_alias@-c++@exe_ext@ |
---|
143 | /opt/rtems/bin/@target_alias@-g++@exe_ext@ |
---|
144 | /opt/rtems/bin/@target_alias@-gcc@exe_ext@ |
---|
145 | /opt/rtems/bin/@target_alias@-protoize@exe_ext@ |
---|
146 | /opt/rtems/bin/@target_alias@-unprotoize@exe_ext@ |
---|
147 | |
---|
148 | %dir /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include |
---|
149 | |
---|
150 | %dir /opt/rtems/include |
---|
151 | /opt/rtems/include/g++-3 |
---|
152 | /opt/rtems/@target_alias@ |
---|
153 | |
---|
154 | %post |
---|
155 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
156 | then |
---|
157 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
158 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
159 | test -n "$f" && for i in $f; do |
---|
160 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
161 | done |
---|
162 | fi |
---|
163 | |
---|
164 | %postun |
---|
165 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
166 | then |
---|
167 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
168 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
169 | test -n "$f" && for i in $f; do |
---|
170 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
171 | done |
---|
172 | fi |
---|
173 | |
---|
174 | |
---|