[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 | |
---|
[1f129d87] | 16 | %ifos cygwin cygwin32 |
---|
| 17 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
| 18 | %define _libdir %{_exec_prefix}/lib |
---|
| 19 | %define debug_package %{nil} |
---|
| 20 | %endif |
---|
| 21 | |
---|
[ea7a607] | 22 | %if "%{_build}" != "%{_host}" |
---|
| 23 | %define _host_rpmprefix rtems-4.9-%{_host}- |
---|
| 24 | %else |
---|
| 25 | %define _host_rpmprefix %{nil} |
---|
| 26 | %endif |
---|
| 27 | |
---|
| 28 | %define gdb_version 6.8 |
---|
| 29 | %define gdb_rpmvers %{expand:%(echo 6.8 | tr - _)} |
---|
[2d9201a] | 30 | |
---|
| 31 | Name: rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 32 | Summary: Gdb for target powerpc-rtems4.9 |
---|
| 33 | Group: Development/Tools |
---|
| 34 | Version: %{gdb_rpmvers} |
---|
[c07a9c00] | 35 | Release: 4%{?dist} |
---|
[2d9201a] | 36 | License: GPL/LGPL |
---|
| 37 | URL: http://sources.redhat.com/gdb |
---|
| 38 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 39 | |
---|
[ea7a607] | 40 | BuildRequires: %{_host_rpmprefix}gcc |
---|
[1f129d87] | 41 | |
---|
[2d9201a] | 42 | %if "%{gdb_version}" >= "6.6" |
---|
[25eda206] | 43 | # suse |
---|
[2d9201a] | 44 | %if "%{?suse}" |
---|
[25eda206] | 45 | %if "%{?suse}" >= "10.3" |
---|
| 46 | BuildRequires: libexpat-devel |
---|
| 47 | %else |
---|
| 48 | BuildRequires: expat |
---|
| 49 | %endif |
---|
| 50 | %else |
---|
[ea7a607] | 51 | # fedora/redhat/cygwin |
---|
| 52 | BuildRequires: %{_host_rpmprefix}expat-devel |
---|
| 53 | %endif |
---|
| 54 | %endif |
---|
| 55 | |
---|
[5633d25f] | 56 | %if "%{gdb_version}" < "6.7" |
---|
[ea7a607] | 57 | %if "%{_build}" != "%{_host}" |
---|
| 58 | BuildRequires: %{_host_rpmprefix}termcap-devel |
---|
[2d9201a] | 59 | %endif |
---|
| 60 | %endif |
---|
[ea7a607] | 61 | BuildRequires: %{_host_rpmprefix}readline-devel |
---|
| 62 | BuildRequires: %{_host_rpmprefix}ncurses-devel |
---|
| 63 | |
---|
[2d9201a] | 64 | # Required for building the infos |
---|
| 65 | BuildRequires: /sbin/install-info |
---|
| 66 | BuildRequires: texinfo >= 4.2 |
---|
[ea7a607] | 67 | |
---|
[2d9201a] | 68 | |
---|
| 69 | Requires: rtems-4.9-gdb-common |
---|
| 70 | |
---|
| 71 | Source0: ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2 |
---|
| 72 | %{?_without_sources:NoSource: 0} |
---|
[ea7a607] | 73 | %if "%{gdb_version}" == "6.8" |
---|
[c07a9c00] | 74 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.9/gdb-6.8-rtems4.9-20080917.diff |
---|
[25eda206] | 75 | %endif |
---|
[2d9201a] | 76 | |
---|
| 77 | %description |
---|
| 78 | GDB for target powerpc-rtems4.9 |
---|
| 79 | %prep |
---|
| 80 | %setup -q -c -T -n %{name}-%{version} |
---|
| 81 | |
---|
| 82 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
| 83 | cd gdb-%{gdb_version} |
---|
| 84 | %{?PATCH0:%patch0 -p1} |
---|
| 85 | cd .. |
---|
| 86 | |
---|
[5633d25f] | 87 | %if "%{gdb_version}" >= "6.7" |
---|
[ea7a607] | 88 | # Force using a system-provided libreadline |
---|
| 89 | rm -f gdb-%{gdb_version}/readline/configure |
---|
| 90 | %endif |
---|
[2d9201a] | 91 | %build |
---|
[1f129d87] | 92 | export PATH="%{_bindir}:${PATH}" |
---|
[2d9201a] | 93 | mkdir -p build |
---|
| 94 | cd build |
---|
[ea7a607] | 95 | %if "%{_build}" != "%{_host}" |
---|
| 96 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
| 97 | %endif |
---|
[2d9201a] | 98 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
| 99 | ../gdb-%{gdb_version}/configure \ |
---|
| 100 | --build=%_build --host=%_host \ |
---|
| 101 | --target=powerpc-rtems4.9 \ |
---|
| 102 | --verbose --disable-nls \ |
---|
| 103 | --without-included-gettext \ |
---|
| 104 | --disable-win32-registry \ |
---|
| 105 | --disable-werror \ |
---|
| 106 | --enable-sim \ |
---|
[9589c665] | 107 | %if "%{gdb_version}" >= "6.7" |
---|
[25eda206] | 108 | --with-system-readline \ |
---|
[9589c665] | 109 | %endif |
---|
| 110 | %if "%{gdb_version}" >= "6.6" |
---|
[25eda206] | 111 | --with-expat \ |
---|
| 112 | %endif |
---|
[2d9201a] | 113 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 114 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 115 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 116 | |
---|
[fbce31e] | 117 | make %{?_smp_mflags} all |
---|
[2d9201a] | 118 | make info |
---|
| 119 | cd .. |
---|
| 120 | |
---|
| 121 | %install |
---|
[1f129d87] | 122 | export PATH="%{_bindir}:${PATH}" |
---|
[2d9201a] | 123 | rm -rf $RPM_BUILD_ROOT |
---|
| 124 | |
---|
| 125 | cd build |
---|
| 126 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
| 127 | |
---|
| 128 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 129 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 130 | |
---|
| 131 | # These come from other packages |
---|
| 132 | rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd* |
---|
| 133 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure* |
---|
| 134 | rm -rf $RPM_BUILD_ROOT%{_infodir}/standards* |
---|
| 135 | |
---|
| 136 | # We don't ship host files |
---|
| 137 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
| 138 | |
---|
| 139 | # host library, installed to a bogus directory |
---|
| 140 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libpowerpc-rtems4.9-sim.a |
---|
| 141 | |
---|
| 142 | cd .. |
---|
| 143 | |
---|
| 144 | # Extract %%__os_install_post into os_install_post~ |
---|
| 145 | cat << \EOF > os_install_post~ |
---|
| 146 | %__os_install_post |
---|
| 147 | EOF |
---|
| 148 | |
---|
| 149 | # Generate customized brp-*scripts |
---|
| 150 | cat os_install_post~ | while read a x y; do |
---|
| 151 | case $a in |
---|
| 152 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 153 | */brp-strip*) |
---|
| 154 | b=$(basename $a) |
---|
| 155 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 156 | chmod a+x $b |
---|
| 157 | ;; |
---|
| 158 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 159 | */brp-compress*) |
---|
| 160 | b=$(basename $a) |
---|
| 161 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 162 | chmod a+x $b |
---|
| 163 | ;; |
---|
| 164 | esac |
---|
| 165 | done |
---|
| 166 | |
---|
| 167 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 168 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 169 | < os_install_post~ > os_install_post |
---|
| 170 | %define __os_install_post . ./os_install_post |
---|
| 171 | |
---|
| 172 | %clean |
---|
| 173 | rm -rf $RPM_BUILD_ROOT |
---|
| 174 | |
---|
| 175 | # ============================================================== |
---|
| 176 | # powerpc-rtems4.9-gdb |
---|
| 177 | # ============================================================== |
---|
| 178 | # %package -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 179 | # Summary: rtems gdb for powerpc-rtems4.9 |
---|
| 180 | # Group: Development/Tools |
---|
| 181 | # %if %build_infos |
---|
| 182 | # Requires: rtems-4.9-gdb-common |
---|
| 183 | # %endif |
---|
| 184 | |
---|
| 185 | %description -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 186 | GNU gdb targetting powerpc-rtems4.9. |
---|
| 187 | |
---|
| 188 | %files -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 189 | %defattr(-,root,root) |
---|
| 190 | %dir %{_mandir} |
---|
| 191 | %dir %{_mandir}/man1 |
---|
| 192 | %{_mandir}/man1/powerpc-rtems4.9-*.1* |
---|
| 193 | |
---|
| 194 | %dir %{_bindir} |
---|
| 195 | %{_bindir}/powerpc-rtems4.9-* |
---|
| 196 | |
---|
| 197 | # ============================================================== |
---|
| 198 | # rtems-4.9-gdb-common |
---|
| 199 | # ============================================================== |
---|
| 200 | %package -n rtems-4.9-gdb-common |
---|
| 201 | Summary: Base package for RTEMS gdbs |
---|
| 202 | Group: Development/Tools |
---|
| 203 | Requires(post): /sbin/install-info |
---|
| 204 | Requires(preun): /sbin/install-info |
---|
| 205 | |
---|
| 206 | %description -n rtems-4.9-gdb-common |
---|
| 207 | |
---|
| 208 | GDB files shared by all targets. |
---|
| 209 | |
---|
| 210 | %post -n rtems-4.9-gdb-common |
---|
| 211 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 212 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 213 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 214 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 215 | |
---|
| 216 | %preun -n rtems-4.9-gdb-common |
---|
| 217 | if [ $1 -eq 0 ]; then |
---|
| 218 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 219 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 220 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 221 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 222 | fi |
---|
| 223 | |
---|
| 224 | %files -n rtems-4.9-gdb-common |
---|
| 225 | %defattr(-,root,root) |
---|
| 226 | %dir %{_infodir} |
---|
| 227 | %ghost %{_infodir}/dir |
---|
| 228 | %{_infodir}/gdb.info* |
---|
| 229 | |
---|
| 230 | %{_infodir}/gdbint.info* |
---|
| 231 | %{_infodir}/stabs.info* |
---|
| 232 | %{_infodir}/annotate.info* |
---|
| 233 | |
---|