[2d9201a] | 1 | # |
---|
| 2 | # Please send bugfixes or comments to |
---|
| 3 | # http://www.rtems.org/bugzilla |
---|
| 4 | # |
---|
| 5 | |
---|
| 6 | %define _prefix /opt/rtems-4.9 |
---|
| 7 | %define _infodir %{_prefix}/info |
---|
| 8 | %define _mandir %{_prefix}/man |
---|
| 9 | |
---|
| 10 | %ifos cygwin cygwin32 mingw mingw32 |
---|
| 11 | %define _exeext .exe |
---|
| 12 | %else |
---|
| 13 | %define _exeext %{nil} |
---|
| 14 | %endif |
---|
| 15 | |
---|
| 16 | %define binutils_pkgvers 2.18 |
---|
| 17 | %define binutils_version 2.18 |
---|
| 18 | %define binutils_rpmvers %{expand:%(echo "2.18" | tr - _ )} |
---|
| 19 | |
---|
| 20 | Name: rtems-4.9-powerpc-rtems4.9-binutils |
---|
| 21 | Summary: Binutils for target powerpc-rtems4.9 |
---|
| 22 | Group: Development/Tools |
---|
| 23 | Version: %{binutils_rpmvers} |
---|
[6d77c8f5] | 24 | Release: 2%{?dist} |
---|
[2d9201a] | 25 | License: GPL/LGPL |
---|
| 26 | URL: http://sources.redhat.com/binutils |
---|
| 27 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 28 | |
---|
| 29 | # Required for building the infos |
---|
| 30 | BuildRequires: /sbin/install-info |
---|
| 31 | BuildRequires: texinfo >= 4.2 |
---|
| 32 | BuildRequires: flex |
---|
| 33 | BuildRequires: bison |
---|
| 34 | |
---|
| 35 | Requires: rtems-4.9-binutils-common |
---|
| 36 | |
---|
| 37 | Source0: ftp://ftp.gnu.org/pub/gnu/binutils/binutils-%{binutils_pkgvers}.tar.bz2 |
---|
| 38 | %{?_without_sources:NoSource: 0} |
---|
| 39 | %if "%{binutils_version}" == "2.17.90" |
---|
[6d77c8f5] | 40 | Patch0: binutils-2.18-rtems4.9-20071104.diff |
---|
[2d9201a] | 41 | %endif |
---|
| 42 | |
---|
| 43 | %description |
---|
| 44 | Cross binutils for target powerpc-rtems4.9 |
---|
| 45 | %prep |
---|
| 46 | %setup -q -c -T -n %{name}-%{version} |
---|
| 47 | |
---|
| 48 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
| 49 | cd binutils-%{binutils_pkgvers} |
---|
| 50 | %{?PATCH0:%patch0 -p1} |
---|
| 51 | cd .. |
---|
| 52 | |
---|
| 53 | %build |
---|
| 54 | %if "powerpc-rtems4.9" == "i686-pc-cygwin" |
---|
| 55 | # The cygwin sources are leaking memory |
---|
| 56 | RPM_OPT_FLAGS="$(echo "$RPM_OPT_FLAGS"|sed -e 's; -Wp,-D_FORTIFY_SOURCE=2;;')" |
---|
| 57 | %endif |
---|
| 58 | mkdir -p build |
---|
| 59 | cd build |
---|
| 60 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
| 61 | ../binutils-%{binutils_pkgvers}/configure \ |
---|
| 62 | --build=%_build --host=%_host \ |
---|
| 63 | --target=powerpc-rtems4.9 \ |
---|
| 64 | --verbose --disable-nls \ |
---|
| 65 | --without-included-gettext \ |
---|
| 66 | --disable-win32-registry \ |
---|
| 67 | --disable-werror \ |
---|
| 68 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 69 | --exec-prefix=%{_exec_prefix} \ |
---|
| 70 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 71 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 72 | |
---|
| 73 | make all |
---|
| 74 | make info |
---|
| 75 | cd .. |
---|
| 76 | |
---|
| 77 | %install |
---|
| 78 | rm -rf $RPM_BUILD_ROOT |
---|
| 79 | |
---|
| 80 | cd build |
---|
| 81 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
| 82 | bindir=$RPM_BUILD_ROOT%{_bindir} \ |
---|
| 83 | includedir=$RPM_BUILD_ROOT%{_includedir} \ |
---|
| 84 | libdir=$RPM_BUILD_ROOT%{_libdir} \ |
---|
| 85 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
| 86 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
| 87 | exec_prefix=$RPM_BUILD_ROOT%{_exec_prefix} \ |
---|
| 88 | install |
---|
| 89 | |
---|
| 90 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ |
---|
| 91 | bindir=$RPM_BUILD_ROOT%{_bindir} \ |
---|
| 92 | includedir=$RPM_BUILD_ROOT%{_includedir} \ |
---|
| 93 | libdir=$RPM_BUILD_ROOT%{_libdir} \ |
---|
| 94 | infodir=$RPM_BUILD_ROOT%{_infodir} \ |
---|
| 95 | mandir=$RPM_BUILD_ROOT%{_mandir} \ |
---|
| 96 | exec_prefix=$RPM_BUILD_ROOT%{_exec_prefix} \ |
---|
| 97 | install-info |
---|
| 98 | |
---|
| 99 | # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. |
---|
| 100 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure.info* |
---|
| 101 | |
---|
| 102 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 103 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 104 | |
---|
| 105 | # binutils does not install share/locale, however it uses it |
---|
| 106 | mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/locale |
---|
| 107 | |
---|
| 108 | # We don't ship host files |
---|
| 109 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
| 110 | |
---|
| 111 | # manpages without corresponding tools |
---|
| 112 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/powerpc-rtems4.9-dlltool%{_exeext}; then |
---|
| 113 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.9-dlltool* |
---|
| 114 | fi |
---|
| 115 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/powerpc-rtems4.9-nlmconv%{_exeext}; then |
---|
| 116 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.9-nlmconv* |
---|
| 117 | fi |
---|
| 118 | if test ! -f ${RPM_BUILD_ROOT}%{_bindir}/powerpc-rtems4.9-windres%{_exeext}; then |
---|
| 119 | rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/powerpc-rtems4.9-windres* |
---|
| 120 | fi |
---|
| 121 | |
---|
| 122 | cd .. |
---|
| 123 | |
---|
| 124 | # Extract %%__os_install_post into os_install_post~ |
---|
| 125 | cat << \EOF > os_install_post~ |
---|
| 126 | %__os_install_post |
---|
| 127 | EOF |
---|
| 128 | |
---|
| 129 | # Generate customized brp-*scripts |
---|
| 130 | cat os_install_post~ | while read a x y; do |
---|
| 131 | case $a in |
---|
| 132 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 133 | */brp-strip*) |
---|
| 134 | b=$(basename $a) |
---|
| 135 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 136 | chmod a+x $b |
---|
| 137 | ;; |
---|
| 138 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 139 | */brp-compress*) |
---|
| 140 | b=$(basename $a) |
---|
| 141 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 142 | chmod a+x $b |
---|
| 143 | ;; |
---|
| 144 | esac |
---|
| 145 | done |
---|
| 146 | |
---|
| 147 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 148 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 149 | < os_install_post~ > os_install_post |
---|
| 150 | %define __os_install_post . ./os_install_post |
---|
| 151 | |
---|
| 152 | %clean |
---|
| 153 | rm -rf $RPM_BUILD_ROOT |
---|
| 154 | |
---|
| 155 | # ============================================================== |
---|
| 156 | # powerpc-rtems4.9-binutils |
---|
| 157 | # ============================================================== |
---|
| 158 | # %package -n rtems-4.9-powerpc-rtems4.9-binutils |
---|
| 159 | # Summary: rtems binutils for powerpc-rtems4.9 |
---|
| 160 | # Group: Development/Tools |
---|
| 161 | # %if %build_infos |
---|
| 162 | # Requires: rtems-4.9-binutils-common |
---|
| 163 | # %endif |
---|
| 164 | |
---|
| 165 | %description -n rtems-4.9-powerpc-rtems4.9-binutils |
---|
| 166 | |
---|
| 167 | GNU binutils targetting powerpc-rtems4.9. |
---|
| 168 | |
---|
| 169 | %files -n rtems-4.9-powerpc-rtems4.9-binutils |
---|
| 170 | %defattr(-,root,root) |
---|
| 171 | %dir %{_mandir} |
---|
| 172 | %dir %{_mandir}/man1 |
---|
| 173 | %{_mandir}/man1/powerpc-rtems4.9-*.1* |
---|
| 174 | |
---|
| 175 | %dir %{_bindir} |
---|
| 176 | %{_bindir}/powerpc-rtems4.9-* |
---|
| 177 | |
---|
| 178 | %dir %{_exec_prefix}/powerpc-rtems4.9 |
---|
| 179 | %dir %{_exec_prefix}/powerpc-rtems4.9/bin |
---|
| 180 | %{_exec_prefix}/powerpc-rtems4.9/bin/* |
---|
| 181 | |
---|
| 182 | %dir %{_exec_prefix}/powerpc-rtems4.9/lib |
---|
| 183 | %{_exec_prefix}/powerpc-rtems4.9/lib/ldscripts |
---|
| 184 | # ============================================================== |
---|
| 185 | # rtems-4.9-binutils-common |
---|
| 186 | # ============================================================== |
---|
| 187 | %package -n rtems-4.9-binutils-common |
---|
| 188 | Summary: Base package for RTEMS binutils |
---|
| 189 | Group: Development/Tools |
---|
| 190 | Requires(post): /sbin/install-info |
---|
| 191 | Requires(preun): /sbin/install-info |
---|
| 192 | |
---|
| 193 | %description -n rtems-4.9-binutils-common |
---|
| 194 | |
---|
| 195 | RTEMS is an open source operating system for embedded systems. |
---|
| 196 | |
---|
| 197 | This is the base for binutils regardless of target CPU. |
---|
| 198 | |
---|
| 199 | %post -n rtems-4.9-binutils-common |
---|
| 200 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/as.info.gz || : |
---|
| 201 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || : |
---|
| 202 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || : |
---|
| 203 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/ld.info.gz || : |
---|
| 204 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/standards.info.gz || : |
---|
| 205 | %if "%{binutils_version}" > "2.17" |
---|
| 206 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || : |
---|
| 207 | %endif |
---|
| 208 | |
---|
| 209 | %preun -n rtems-4.9-binutils-common |
---|
| 210 | if [ $1 -eq 0 ]; then |
---|
| 211 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/as.info.gz || : |
---|
| 212 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/bfd.info.gz || : |
---|
| 213 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/binutils.info.gz || : |
---|
| 214 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/ld.info.gz || : |
---|
| 215 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/standards.info.gz || : |
---|
| 216 | %if "%{binutils_version}" > "2.17" |
---|
| 217 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gprof.info.gz || : |
---|
| 218 | %endif |
---|
| 219 | fi |
---|
| 220 | |
---|
| 221 | %files -n rtems-4.9-binutils-common |
---|
| 222 | %defattr(-,root,root) |
---|
| 223 | %dir %{_infodir} |
---|
| 224 | %ghost %{_infodir}/dir |
---|
| 225 | %{_infodir}/as.info* |
---|
| 226 | %{_infodir}/bfd.info* |
---|
| 227 | %{_infodir}/binutils.info* |
---|
| 228 | %{_infodir}/ld.info* |
---|
| 229 | %{_infodir}/standards.info* |
---|
| 230 | %if "%{binutils_version}" > "2.17" |
---|
| 231 | %{_infodir}/gprof.info* |
---|
| 232 | %endif |
---|
| 233 | |
---|
| 234 | %dir %{_prefix}/share |
---|
| 235 | %dir %{_prefix}/share/locale |
---|
| 236 | |
---|