[e639b998] | 1 | # |
---|
[42ec72d] | 2 | # spec file for building gcc (C Only) for rtems |
---|
[e639b998] | 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 | |
---|
[42ec72d] | 17 | Provides: rtems-base-gcc @target_alias@-gcc |
---|
[e639b998] | 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 | # |
---|
[8812023] | 41 | NoSource: 0 |
---|
| 42 | NoSource: 1 |
---|
[e639b998] | 43 | |
---|
| 44 | %description |
---|
| 45 | RTEMS is an open source operating system for embedded systems. |
---|
| 46 | |
---|
| 47 | This is gcc's and newlib C Library's sources with patches for RTEMS. |
---|
| 48 | |
---|
| 49 | The original sources are not included in the source RPM. |
---|
| 50 | If we included them, then the source RPMs for each target |
---|
| 51 | would duplicate MBs of source unnecessarily. This is |
---|
| 52 | a duplication of over 30 MBs of source for each of |
---|
| 53 | the more than 10 targets it is possible to build. |
---|
| 54 | |
---|
| 55 | You can get them yourself from the Internet and copy them to |
---|
| 56 | your /usr/src/redhat/SOURCES directory ($RPM_SOURCE_DIR). |
---|
| 57 | Or you can try the ftp options of rpm :-) |
---|
| 58 | |
---|
[42ec72d] | 59 | %package -n rtems-base-gcc |
---|
| 60 | Summary: base package for rtems gcc and newlib C Library |
---|
| 61 | Group: rtems |
---|
| 62 | |
---|
| 63 | %description -n rtems-base-gcc |
---|
| 64 | |
---|
| 65 | RTEMS is an open source operating system for embedded systems. |
---|
| 66 | |
---|
| 67 | This is the files for gcc and newlib that are shared by all targets. |
---|
| 68 | |
---|
| 69 | %package -n @target_alias@-gcc |
---|
| 70 | Summary: rtems gcc and newlib C Library for @target_alias@ |
---|
| 71 | Group: rtems |
---|
| 72 | Requires: @target_alias@-binutils rtems-base-gcc |
---|
| 73 | |
---|
| 74 | %description -n @target_alias@-gcc |
---|
| 75 | RTEMS is an open source operating system for embedded systems. |
---|
| 76 | |
---|
| 77 | This is gcc and newlib C Library for @target_alias@. |
---|
| 78 | |
---|
[e639b998] | 79 | %prep |
---|
| 80 | # untar the sources inside @target_alias@-gcc-newlib |
---|
| 81 | %setup -c -n @target_alias@-gcc-newlib -a 0 -a 1 |
---|
| 82 | |
---|
| 83 | %patch0 -p0 |
---|
| 84 | %patch1 -p0 |
---|
| 85 | |
---|
| 86 | # Copy the C library into gcc's source tree |
---|
| 87 | ln -s ../newlib-@newlib_version@/newlib gcc-@gcc_version@ |
---|
| 88 | test -d build || mkdir build |
---|
| 89 | |
---|
| 90 | %build |
---|
| 91 | cd build |
---|
| 92 | ../gcc-@gcc_version@/configure --target=@target_alias@ \ |
---|
| 93 | --with-gnu-as --with-gnu-ld --with-newlib --verbose \ |
---|
| 94 | --prefix=/opt/rtems '--enable-languages=c,c++' |
---|
| 95 | |
---|
| 96 | make all |
---|
| 97 | make info |
---|
| 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 | rm -f dirs ; |
---|
| 119 | echo "%dir /opt/rtems/lib" >> dirs ; |
---|
| 120 | echo "%dir /opt/rtems/lib/gcc-lib" >> dirs ; |
---|
| 121 | echo "%dir /opt/rtems/lib/gcc-lib/@target_alias@" >> dirs ; |
---|
| 122 | |
---|
| 123 | # Collect multilib subdirectories |
---|
| 124 | TGTDIR="$RPM_BUILD_ROOT/opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@" |
---|
| 125 | find $TGTDIR \ |
---|
| 126 | \( -type d -a ! -path "$TGTDIR/include*" \) -print | \ |
---|
| 127 | sed -e "s,^$RPM_BUILD_ROOT,%dir ,g" >> dirs |
---|
| 128 | |
---|
| 129 | # Collect files to go into different packages |
---|
| 130 | cp dirs files.gcc |
---|
| 131 | |
---|
| 132 | f=`find $TGTDIR ! -type d -print | sed -e "s,^$RPM_BUILD_ROOT,,g"`; |
---|
| 133 | for i in $f; do |
---|
| 134 | case $i in |
---|
| 135 | # *chill*) echo "$i" >> files.chill ;; |
---|
| 136 | # *f771) ;; |
---|
| 137 | # *cc1obj) ;; |
---|
| 138 | # *libobjc*) echo "$i" >> files.objc ;; |
---|
| 139 | # *include/objc*) ;; |
---|
| 140 | # *jc1) ;; |
---|
| 141 | # *jvgenmain) ;; |
---|
| 142 | *) echo "$i" >> files.gcc ;; |
---|
| 143 | esac |
---|
| 144 | done |
---|
| 145 | |
---|
[42ec72d] | 146 | |
---|
| 147 | |
---|
| 148 | %files -n rtems-base-gcc |
---|
[e639b998] | 149 | %dir /opt/rtems/info |
---|
[42ec72d] | 150 | # %doc /opt/rtems/info/dir |
---|
[e639b998] | 151 | %doc /opt/rtems/info/cpp.info* |
---|
| 152 | %doc /opt/rtems/info/gcc.info* |
---|
| 153 | %doc /opt/rtems/info/libc.info* |
---|
| 154 | %doc /opt/rtems/info/libm.info* |
---|
| 155 | |
---|
[42ec72d] | 156 | %dir /opt/rtems/bin |
---|
| 157 | /opt/rtems/bin/cpp@exe_ext@ |
---|
| 158 | /opt/rtems/bin/gcov@exe_ext@ |
---|
| 159 | |
---|
[e639b998] | 160 | %dir /opt/rtems/man |
---|
| 161 | %dir /opt/rtems/man/man1 |
---|
| 162 | %doc /opt/rtems/man/man1/cccp.1 |
---|
[42ec72d] | 163 | |
---|
| 164 | %dir /opt/rtems/include |
---|
| 165 | /opt/rtems/include/g++-3 |
---|
| 166 | |
---|
| 167 | %files -n @target_alias@-gcc -f build/files.gcc |
---|
| 168 | |
---|
[e639b998] | 169 | %doc /opt/rtems/man/man1/@target_alias@-gcc.1 |
---|
| 170 | %doc /opt/rtems/man/man1/@target_alias@-g++.1 |
---|
| 171 | |
---|
[0c602f0] | 172 | /opt/rtems/bin/@target_alias@-c++@exe_ext@ |
---|
| 173 | /opt/rtems/bin/@target_alias@-g++@exe_ext@ |
---|
| 174 | /opt/rtems/bin/@target_alias@-gcc@exe_ext@ |
---|
| 175 | /opt/rtems/bin/@target_alias@-protoize@exe_ext@ |
---|
| 176 | /opt/rtems/bin/@target_alias@-unprotoize@exe_ext@ |
---|
[e639b998] | 177 | |
---|
| 178 | %dir /opt/rtems/lib/gcc-lib/@target_alias@/@gcc_version@/include |
---|
| 179 | |
---|
| 180 | /opt/rtems/@target_alias@ |
---|
| 181 | |
---|
[ea72a6c] | 182 | %post |
---|
[e639b998] | 183 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
| 184 | then |
---|
| 185 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
| 186 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
| 187 | test -n "$f" && for i in $f; do |
---|
| 188 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
| 189 | done |
---|
| 190 | fi |
---|
| 191 | |
---|
[ea72a6c] | 192 | %postun |
---|
[e639b998] | 193 | if test -d $RPM_INSTALL_PREFIX/rtems/info; |
---|
| 194 | then |
---|
| 195 | rm -f $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
| 196 | f=`find $RPM_INSTALL_PREFIX/rtems/info -name '*.info.gz'` |
---|
| 197 | test -n "$f" && for i in $f; do |
---|
| 198 | install-info $i $RPM_INSTALL_PREFIX/rtems/info/dir |
---|
| 199 | done |
---|
| 200 | fi |
---|
| 201 | |
---|
| 202 | |
---|