1 | # |
---|
2 | # spec file for package 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 |
---|
12 | Summary: gcc and newlib C Library for @target_alias@. |
---|
13 | Group: unsorted |
---|
14 | Release: @Release@ |
---|
15 | Copyright: 1999 OARCorp |
---|
16 | |
---|
17 | Provides: @target_alias@-gcc-newlib |
---|
18 | Requires: @target_alias@-binutils |
---|
19 | |
---|
20 | Autoreqprov: on |
---|
21 | Packager: corsepiu@faw.uni-ulm.de and joel@OARcorp.com |
---|
22 | |
---|
23 | Version: @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 | |
---|
29 | # |
---|
30 | # The original sources are not included in the source RPM. |
---|
31 | # If we included them, then the source RPMs for each target |
---|
32 | # would duplicate MBs of source unnecessarily. This is |
---|
33 | # a duplication of over 30 MBs of source for each of |
---|
34 | # the more than 10 targets it is possible to build. |
---|
35 | # |
---|
36 | # You can get them yourself from the Internet and copy them to |
---|
37 | # your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
38 | # Or you can try the ftp options of rpm :-) |
---|
39 | # |
---|
40 | NoSource: 0, 1 |
---|
41 | |
---|
42 | Buildroot: @rpm_build_root@ |
---|
43 | |
---|
44 | %description |
---|
45 | RTEMS is an open source operating system for embedded systems. |
---|
46 | |
---|
47 | This is gcc and newlib C Library for @target_alias@. |
---|
48 | |
---|
49 | Authors: |
---|
50 | -------- |
---|
51 | Joel Sherrill (joel@oarcorp.com) |
---|
52 | ... |
---|
53 | |
---|
54 | %package -n @target_alias@-gcc-newlib |
---|
55 | Summary: rtems gcc and newlib C Library for target @target_alias@ |
---|
56 | Group: unsorted |
---|
57 | |
---|
58 | %description -n @target_alias@-gcc-newlib |
---|
59 | RTEMS is an open source operating system for embedded systems. |
---|
60 | |
---|
61 | This is gcc and newlib C Library for @target_alias@. |
---|
62 | |
---|
63 | Authors: |
---|
64 | -------- |
---|
65 | Joel Sherrill (joel@oarcorp.com) |
---|
66 | ... |
---|
67 | |
---|
68 | %prep |
---|
69 | # untar the sources inside @target_alias@-gcc-newlib |
---|
70 | %setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 |
---|
71 | |
---|
72 | %patch0 -p0 |
---|
73 | %patch1 -p0 |
---|
74 | |
---|
75 | # Copy the C library into gcc's source tree |
---|
76 | ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@ |
---|
77 | test -d build || mkdir build |
---|
78 | |
---|
79 | %build |
---|
80 | cd build |
---|
81 | ../gcc-@gcc_version@/configure --target=@target_alias@ \ |
---|
82 | --with-gnu-as --with-gnu-ld --with-newlib --verbose \ |
---|
83 | --prefix=/opt/rtems |
---|
84 | |
---|
85 | # for now we are building all the languages |
---|
86 | # '--enable-languages=c c++' |
---|
87 | |
---|
88 | make all |
---|
89 | make info |
---|
90 | |
---|
91 | # Since gcc now finds the RTEMS limits.h, this should not be needed |
---|
92 | # cd gcc |
---|
93 | # rm -f stmp-multilib |
---|
94 | # find . -name "*.a" -print | xargs -e rm -f |
---|
95 | # |
---|
96 | # make all |
---|
97 | # cd .. |
---|
98 | |
---|
99 | %install |
---|
100 | cd build |
---|
101 | # Bug in gcc-2.95.1: It doesn't build this installation directory |
---|
102 | # If it doesn't find it, gcc doesn't install @target_alias@/bin/gcc |
---|
103 | ../gcc-@gcc_version@/mkinstalldirs \ |
---|
104 | $RPM_BUILD_ROOT/opt/rtems/@target_alias@/bin |
---|
105 | |
---|
106 | make prefix=$RPM_BUILD_ROOT/opt/rtems install |
---|
107 | cd @target_alias@/newlib |
---|
108 | make prefix=$RPM_BUILD_ROOT/opt/rtems install-info |
---|
109 | |
---|
110 | # cd back to build/ |
---|
111 | cd ../.. |
---|
112 | |
---|
113 | # gzip info files |
---|
114 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info 2>/dev/null |
---|
115 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-? 2>/dev/null |
---|
116 | gzip -f $RPM_BUILD_ROOT/opt/rtems/info/*.info-?? 2>/dev/null |
---|
117 | |
---|
118 | %post |
---|
119 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
120 | then |
---|
121 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
122 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
123 | test -n "$f" && for i in $f; do |
---|
124 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
125 | done |
---|
126 | fi |
---|
127 | |
---|
128 | %postun |
---|
129 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
130 | then |
---|
131 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
132 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
133 | test -n "$f" && for i in $f; do |
---|
134 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
135 | done |
---|
136 | fi |
---|
137 | |
---|
138 | %files -n @target_alias@-gcc-newlib |
---|
139 | %dir /opt/rtems/info |
---|
140 | %doc /opt/rtems/info/dir |
---|
141 | %doc /opt/rtems/info/chill.info* |
---|
142 | %doc /opt/rtems/info/cpp.info* |
---|
143 | %doc /opt/rtems/info/gcc.info* |
---|
144 | %doc /opt/rtems/info/g77.info* |
---|
145 | %doc /opt/rtems/info/libc.info* |
---|
146 | %doc /opt/rtems/info/libm.info* |
---|
147 | |
---|
148 | %dir /opt/rtems/man |
---|
149 | %dir /opt/rtems/man/man1 |
---|
150 | %doc /opt/rtems/man/man1/cccp.1 |
---|
151 | %doc /opt/rtems/man/man1/@target_alias@-gcc.1 |
---|
152 | %doc /opt/rtems/man/man1/@target_alias@-g++.1 |
---|
153 | %doc /opt/rtems/man/man1/@target_alias@-g77.1 |
---|
154 | |
---|
155 | %dir /opt/rtems/bin |
---|
156 | /opt/rtems/bin/cpp |
---|
157 | /opt/rtems/bin/jv-scan |
---|
158 | /opt/rtems/bin/gcov |
---|
159 | /opt/rtems/bin/jcf-dump |
---|
160 | /opt/rtems/bin/gcjh |
---|
161 | /opt/rtems/bin/@target_alias@-c++ |
---|
162 | /opt/rtems/bin/@target_alias@-g++ |
---|
163 | /opt/rtems/bin/@target_alias@-gcc |
---|
164 | /opt/rtems/bin/@target_alias@-gcj |
---|
165 | /opt/rtems/bin/@target_alias@-chill |
---|
166 | /opt/rtems/bin/@target_alias@-g77 |
---|
167 | /opt/rtems/bin/@target_alias@-protoize |
---|
168 | /opt/rtems/bin/@target_alias@-unprotoize |
---|
169 | |
---|
170 | %dir /opt/rtems/lib |
---|
171 | # We use libiberty from binutils |
---|
172 | # /opt/rtems/lib/libiberty* |
---|
173 | %dir /opt/rtems/include |
---|
174 | /opt/rtems/include/g++-3 |
---|
175 | |
---|
176 | %dir /opt/rtems/lib/gcc-lib |
---|
177 | /opt/rtems/lib/gcc-lib/@target_alias@ |
---|
178 | |
---|
179 | /opt/rtems/@target_alias@ |
---|