[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} |
---|
[ea7a607] | 35 | Release: 2%{?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 | |
---|
| 56 | %if "%{gdb_version}" < "6.6" |
---|
| 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 |
---|
[51aac0e] | 67 | %if "powerpc-rtems4.9" == "sparc-rtems4.9" |
---|
[25eda206] | 68 | BuildConflicts: libtermcap-devel termcap-devel |
---|
[2d9201a] | 69 | %endif |
---|
[ea7a607] | 70 | |
---|
[2d9201a] | 71 | |
---|
| 72 | Requires: rtems-4.9-gdb-common |
---|
| 73 | |
---|
| 74 | Source0: ftp://ftp.gnu.org/pub/gnu/gdb/gdb-%{gdb_version}.tar.bz2 |
---|
| 75 | %{?_without_sources:NoSource: 0} |
---|
[ea7a607] | 76 | %if "%{gdb_version}" == "6.8" |
---|
| 77 | Patch0: gdb-6.8-rtems4.9-20080428.diff |
---|
[25eda206] | 78 | %endif |
---|
[2d9201a] | 79 | |
---|
| 80 | %description |
---|
| 81 | GDB for target powerpc-rtems4.9 |
---|
| 82 | %prep |
---|
| 83 | %setup -q -c -T -n %{name}-%{version} |
---|
| 84 | |
---|
| 85 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
| 86 | cd gdb-%{gdb_version} |
---|
| 87 | %{?PATCH0:%patch0 -p1} |
---|
[1f129d87] | 88 | %{?PATCH1:%patch1 -p1} |
---|
[2d9201a] | 89 | cd .. |
---|
| 90 | |
---|
[ea7a607] | 91 | %if "%{gdb_version}" >= "6.8" |
---|
| 92 | # Force using a system-provided libreadline |
---|
| 93 | rm -f gdb-%{gdb_version}/readline/configure |
---|
| 94 | %endif |
---|
[2d9201a] | 95 | %build |
---|
[1f129d87] | 96 | export PATH="%{_bindir}:${PATH}" |
---|
[2d9201a] | 97 | mkdir -p build |
---|
| 98 | cd build |
---|
[ea7a607] | 99 | %if "%{_build}" != "%{_host}" |
---|
| 100 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
| 101 | %endif |
---|
[2d9201a] | 102 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
| 103 | ../gdb-%{gdb_version}/configure \ |
---|
| 104 | --build=%_build --host=%_host \ |
---|
| 105 | --target=powerpc-rtems4.9 \ |
---|
| 106 | --verbose --disable-nls \ |
---|
| 107 | --without-included-gettext \ |
---|
| 108 | --disable-win32-registry \ |
---|
| 109 | --disable-werror \ |
---|
| 110 | --enable-sim \ |
---|
[25eda206] | 111 | %if "%{gdb_version}" >= "6.6" |
---|
| 112 | --with-system-readline \ |
---|
| 113 | --with-expat \ |
---|
| 114 | %endif |
---|
[2d9201a] | 115 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 116 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 117 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 118 | |
---|
[fbce31e] | 119 | make %{?_smp_mflags} all |
---|
[2d9201a] | 120 | make info |
---|
| 121 | cd .. |
---|
| 122 | |
---|
| 123 | %install |
---|
[1f129d87] | 124 | export PATH="%{_bindir}:${PATH}" |
---|
[2d9201a] | 125 | rm -rf $RPM_BUILD_ROOT |
---|
| 126 | |
---|
| 127 | cd build |
---|
| 128 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
| 129 | |
---|
| 130 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 131 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 132 | |
---|
| 133 | # These come from other packages |
---|
| 134 | rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd* |
---|
| 135 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure* |
---|
| 136 | rm -rf $RPM_BUILD_ROOT%{_infodir}/standards* |
---|
| 137 | |
---|
| 138 | # We don't ship host files |
---|
| 139 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
| 140 | |
---|
| 141 | # host library, installed to a bogus directory |
---|
| 142 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libpowerpc-rtems4.9-sim.a |
---|
| 143 | |
---|
| 144 | cd .. |
---|
| 145 | |
---|
| 146 | # Extract %%__os_install_post into os_install_post~ |
---|
| 147 | cat << \EOF > os_install_post~ |
---|
| 148 | %__os_install_post |
---|
| 149 | EOF |
---|
| 150 | |
---|
| 151 | # Generate customized brp-*scripts |
---|
| 152 | cat os_install_post~ | while read a x y; do |
---|
| 153 | case $a in |
---|
| 154 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 155 | */brp-strip*) |
---|
| 156 | b=$(basename $a) |
---|
| 157 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 158 | chmod a+x $b |
---|
| 159 | ;; |
---|
| 160 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 161 | */brp-compress*) |
---|
| 162 | b=$(basename $a) |
---|
| 163 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 164 | chmod a+x $b |
---|
| 165 | ;; |
---|
| 166 | esac |
---|
| 167 | done |
---|
| 168 | |
---|
| 169 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 170 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 171 | < os_install_post~ > os_install_post |
---|
| 172 | %define __os_install_post . ./os_install_post |
---|
| 173 | |
---|
| 174 | %clean |
---|
| 175 | rm -rf $RPM_BUILD_ROOT |
---|
| 176 | |
---|
| 177 | # ============================================================== |
---|
| 178 | # powerpc-rtems4.9-gdb |
---|
| 179 | # ============================================================== |
---|
| 180 | # %package -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 181 | # Summary: rtems gdb for powerpc-rtems4.9 |
---|
| 182 | # Group: Development/Tools |
---|
| 183 | # %if %build_infos |
---|
| 184 | # Requires: rtems-4.9-gdb-common |
---|
| 185 | # %endif |
---|
| 186 | |
---|
| 187 | %description -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 188 | GNU gdb targetting powerpc-rtems4.9. |
---|
| 189 | |
---|
| 190 | %files -n rtems-4.9-powerpc-rtems4.9-gdb |
---|
| 191 | %defattr(-,root,root) |
---|
| 192 | %dir %{_mandir} |
---|
| 193 | %dir %{_mandir}/man1 |
---|
| 194 | %{_mandir}/man1/powerpc-rtems4.9-*.1* |
---|
| 195 | |
---|
| 196 | %dir %{_bindir} |
---|
| 197 | %{_bindir}/powerpc-rtems4.9-* |
---|
| 198 | |
---|
| 199 | # ============================================================== |
---|
| 200 | # rtems-4.9-gdb-common |
---|
| 201 | # ============================================================== |
---|
| 202 | %package -n rtems-4.9-gdb-common |
---|
| 203 | Summary: Base package for RTEMS gdbs |
---|
| 204 | Group: Development/Tools |
---|
| 205 | Requires(post): /sbin/install-info |
---|
| 206 | Requires(preun): /sbin/install-info |
---|
| 207 | |
---|
| 208 | %description -n rtems-4.9-gdb-common |
---|
| 209 | |
---|
| 210 | GDB files shared by all targets. |
---|
| 211 | |
---|
| 212 | %post -n rtems-4.9-gdb-common |
---|
| 213 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 214 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 215 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 216 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 217 | |
---|
| 218 | %preun -n rtems-4.9-gdb-common |
---|
| 219 | if [ $1 -eq 0 ]; then |
---|
| 220 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 221 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 222 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 223 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 224 | fi |
---|
| 225 | |
---|
| 226 | %files -n rtems-4.9-gdb-common |
---|
| 227 | %defattr(-,root,root) |
---|
| 228 | %dir %{_infodir} |
---|
| 229 | %ghost %{_infodir}/dir |
---|
| 230 | %{_infodir}/gdb.info* |
---|
| 231 | |
---|
| 232 | %{_infodir}/gdbint.info* |
---|
| 233 | %{_infodir}/stabs.info* |
---|
| 234 | %{_infodir}/annotate.info* |
---|
| 235 | |
---|