[bf862710] | 1 | # |
---|
| 2 | # Please send bugfixes or comments to |
---|
| 3 | # http://www.rtems.org/bugzilla |
---|
| 4 | # |
---|
| 5 | |
---|
| 6 | %define _prefix /opt/rtems-4.11 |
---|
| 7 | %define _exec_prefix %{_prefix} |
---|
| 8 | %define _bindir %{_exec_prefix}/bin |
---|
| 9 | %define _sbindir %{_exec_prefix}/sbin |
---|
| 10 | %define _libexecdir %{_exec_prefix}/libexec |
---|
| 11 | %define _datarootdir %{_prefix}/share |
---|
| 12 | %define _datadir %{_datarootdir} |
---|
| 13 | %define _sysconfdir %{_prefix}/etc |
---|
| 14 | %define _sharedstatedir %{_prefix}/com |
---|
| 15 | %define _localstatedir %{_prefix}/var |
---|
| 16 | %define _includedir %{_prefix}/include |
---|
| 17 | %define _libdir %{_exec_prefix}/%{_lib} |
---|
| 18 | %define _mandir %{_datarootdir}/man |
---|
| 19 | %define _infodir %{_datarootdir}/info |
---|
| 20 | %define _localedir %{_datarootdir}/locale |
---|
| 21 | |
---|
| 22 | %ifos cygwin cygwin32 mingw mingw32 |
---|
| 23 | %define _exeext .exe |
---|
| 24 | %define debug_package %{nil} |
---|
| 25 | %define _libdir %{_exec_prefix}/lib |
---|
| 26 | %else |
---|
| 27 | %define _exeext %{nil} |
---|
| 28 | %endif |
---|
| 29 | |
---|
| 30 | %ifos cygwin cygwin32 |
---|
| 31 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
| 32 | %endif |
---|
| 33 | |
---|
| 34 | %ifos mingw mingw32 |
---|
| 35 | %if %{defined _mingw32_cflags} |
---|
| 36 | %define optflags %{_mingw32_cflags} |
---|
| 37 | %else |
---|
| 38 | %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields |
---|
| 39 | %endif |
---|
| 40 | %endif |
---|
| 41 | |
---|
| 42 | %if "%{_build}" != "%{_host}" |
---|
| 43 | %define _host_rpmprefix %{_host}- |
---|
| 44 | %else |
---|
| 45 | %define _host_rpmprefix %{nil} |
---|
| 46 | %endif |
---|
| 47 | |
---|
[ac620ef] | 48 | %define gdb_version 7.3 |
---|
| 49 | %define gdb_rpmvers %{expand:%(echo 7.3 | tr - _)} |
---|
[bf862710] | 50 | |
---|
| 51 | Name: rtems-4.11-sparc-rtems4.11-gdb |
---|
| 52 | Summary: Gdb for target sparc-rtems4.11 |
---|
| 53 | Group: Development/Tools |
---|
| 54 | Version: %{gdb_rpmvers} |
---|
[0423216] | 55 | Release: 2%{?dist} |
---|
[bf862710] | 56 | License: GPL/LGPL |
---|
| 57 | URL: http://sources.redhat.com/gdb |
---|
| 58 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 59 | |
---|
| 60 | BuildRequires: %{_host_rpmprefix}gcc |
---|
| 61 | |
---|
[ac620ef] | 62 | %global build_sim --enable-sim |
---|
[bf862710] | 63 | |
---|
[09e920b] | 64 | # Whether to build against system readline |
---|
| 65 | # Default: yes |
---|
| 66 | %bcond_without system_readline |
---|
| 67 | |
---|
| 68 | # Whether to build python support |
---|
| 69 | %if "%{_build}" != "%{_host}" |
---|
| 70 | # Can't build python Cdn-X |
---|
| 71 | %bcond_with python |
---|
| 72 | %else |
---|
| 73 | %bcond_without python |
---|
| 74 | %endif |
---|
| 75 | %{?with_python:BuildRequires: %{_host_rpmprefix}python-devel} |
---|
| 76 | |
---|
[530d5014] | 77 | %ifos mingw mingw32 |
---|
[64c228c4] | 78 | # Mingw lacks functions required by the sparc simulator |
---|
[bf862710] | 79 | %define build_sim --disable-sim |
---|
[530d5014] | 80 | %endif |
---|
[bf862710] | 81 | |
---|
| 82 | # suse |
---|
| 83 | %if "%{?suse}" >= "10.3" |
---|
| 84 | BuildRequires: libexpat-devel |
---|
| 85 | %else |
---|
| 86 | # Fedora/CentOS/Cygwin/MinGW |
---|
| 87 | BuildRequires: %{_host_rpmprefix}expat-devel |
---|
| 88 | %endif |
---|
| 89 | |
---|
| 90 | %{?with_system_readline:BuildRequires: %{_host_rpmprefix}readline-devel} |
---|
| 91 | BuildRequires: %{_host_rpmprefix}ncurses-devel |
---|
| 92 | |
---|
| 93 | # Required for building the infos |
---|
| 94 | BuildRequires: /sbin/install-info |
---|
| 95 | BuildRequires: texinfo >= 4.2 |
---|
| 96 | Requires: rtems-4.11-gdb-common |
---|
| 97 | |
---|
[ac620ef] | 98 | %if "%{gdb_version}" == "7.3" |
---|
| 99 | Source0: ftp://ftp.gnu.org/gnu/gdb/gdb-7.3a.tar.bz2 |
---|
| 100 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gdb-7.3-rtems4.11-20110831.diff |
---|
| 101 | %endif |
---|
[18c4308] | 102 | %if "%{gdb_version}" == "7.2" |
---|
| 103 | Source0: ftp://ftp.gnu.org/gnu/gdb/gdb-7.2.tar.bz2 |
---|
[09e920b] | 104 | Patch0: ftp://ftp.rtems.org/pub/rtems/SOURCES/4.11/gdb-7.2-rtems4.11-20100907.diff |
---|
[18c4308] | 105 | %endif |
---|
[bf862710] | 106 | |
---|
| 107 | %description |
---|
| 108 | GDB for target sparc-rtems4.11 |
---|
| 109 | %prep |
---|
| 110 | %setup -q -c -T -n %{name}-%{version} |
---|
| 111 | |
---|
| 112 | %setup -q -D -T -n %{name}-%{version} -a0 |
---|
| 113 | cd gdb-%{gdb_version} |
---|
| 114 | %{?PATCH0:%patch0 -p1} |
---|
| 115 | cd .. |
---|
| 116 | |
---|
| 117 | # Force using a system-provided libreadline |
---|
| 118 | %{?with_system_readline:rm -f gdb-%{gdb_version}/readline/configure} |
---|
| 119 | %build |
---|
| 120 | export PATH="%{_bindir}:${PATH}" |
---|
| 121 | mkdir -p build |
---|
| 122 | cd build |
---|
| 123 | %if "%{_build}" != "%{_host}" |
---|
| 124 | CFLAGS_FOR_BUILD="-g -O2 -Wall" \ |
---|
| 125 | %endif |
---|
| 126 | CFLAGS="$RPM_OPT_FLAGS" \ |
---|
| 127 | ../gdb-%{gdb_version}/configure \ |
---|
| 128 | --build=%_build --host=%_host \ |
---|
| 129 | --target=sparc-rtems4.11 \ |
---|
| 130 | --verbose --disable-nls \ |
---|
| 131 | --without-included-gettext \ |
---|
| 132 | --disable-win32-registry \ |
---|
| 133 | --disable-werror \ |
---|
| 134 | %{build_sim} \ |
---|
| 135 | %{?with_system_readline:--with-system-readline} \ |
---|
| 136 | --with-expat \ |
---|
[09e920b] | 137 | %{?with_python:--with-python}%{!?with_python:--without-python} \ |
---|
[ac620ef] | 138 | --with-gdb-datadir=%{_datadir}/sparc-rtems4.11-gdb \ |
---|
[bf862710] | 139 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 140 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 141 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 142 | |
---|
| 143 | make %{?_smp_mflags} all |
---|
| 144 | make info |
---|
| 145 | cd .. |
---|
| 146 | |
---|
| 147 | %install |
---|
| 148 | export PATH="%{_bindir}:${PATH}" |
---|
| 149 | rm -rf $RPM_BUILD_ROOT |
---|
| 150 | |
---|
| 151 | cd build |
---|
| 152 | make DESTDIR=$RPM_BUILD_ROOT install |
---|
| 153 | |
---|
| 154 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 155 | touch $RPM_BUILD_ROOT%{_infodir}/dir |
---|
| 156 | |
---|
| 157 | # These come from other packages |
---|
| 158 | rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd* |
---|
| 159 | rm -rf $RPM_BUILD_ROOT%{_infodir}/configure* |
---|
| 160 | rm -rf $RPM_BUILD_ROOT%{_infodir}/standards* |
---|
| 161 | |
---|
| 162 | # We don't ship host files |
---|
| 163 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* |
---|
| 164 | |
---|
| 165 | # host library, installed to a bogus directory |
---|
| 166 | rm -f ${RPM_BUILD_ROOT}%{_libdir}/libsparc-rtems4.11-sim.a |
---|
| 167 | |
---|
| 168 | # Bug in gdb-7.0, bogusly installs linux-only files |
---|
| 169 | somethinguseful=0 |
---|
[ac620ef] | 170 | for f in ${RPM_BUILD_ROOT}%{_datadir}/sparc-rtems4.11-gdb/syscalls/*.xml; do |
---|
[bf862710] | 171 | case $f in |
---|
| 172 | *linux.xml) rm -f $f;; |
---|
| 173 | *.xml) somethinguseful=1;; |
---|
| 174 | esac |
---|
| 175 | done |
---|
| 176 | if test $somethinguseful -eq 0; then |
---|
[ac620ef] | 177 | rm -rf "${RPM_BUILD_ROOT}%{_datadir}/sparc-rtems4.11-gdb/syscalls" |
---|
[bf862710] | 178 | fi |
---|
| 179 | |
---|
[ac620ef] | 180 | %if "{gdb_version}" >= "7.3" |
---|
| 181 | %if ! %{with python} |
---|
| 182 | # gdb-7.3 doesn't honor --without-python correctly |
---|
| 183 | rm -rf ${RPM_BUILD_ROOT}%{_datadir}/sparc-rtems4.11-gdb/python |
---|
| 184 | %endif |
---|
| 185 | %endif |
---|
[bf862710] | 186 | cd .. |
---|
| 187 | |
---|
| 188 | # Extract %%__os_install_post into os_install_post~ |
---|
| 189 | cat << \EOF > os_install_post~ |
---|
| 190 | %__os_install_post |
---|
| 191 | EOF |
---|
| 192 | |
---|
| 193 | # Generate customized brp-*scripts |
---|
| 194 | cat os_install_post~ | while read a x y; do |
---|
| 195 | case $a in |
---|
| 196 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 197 | */brp-strip*) |
---|
| 198 | b=$(basename $a) |
---|
| 199 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 200 | chmod a+x $b |
---|
| 201 | ;; |
---|
| 202 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 203 | */brp-compress*) |
---|
| 204 | b=$(basename $a) |
---|
| 205 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
| 206 | chmod a+x $b |
---|
| 207 | ;; |
---|
| 208 | esac |
---|
| 209 | done |
---|
| 210 | |
---|
| 211 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 212 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 213 | < os_install_post~ > os_install_post |
---|
| 214 | %define __os_install_post . ./os_install_post |
---|
| 215 | |
---|
| 216 | %clean |
---|
| 217 | rm -rf $RPM_BUILD_ROOT |
---|
| 218 | |
---|
| 219 | # ============================================================== |
---|
| 220 | # sparc-rtems4.11-gdb |
---|
| 221 | # ============================================================== |
---|
| 222 | # %package -n rtems-4.11-sparc-rtems4.11-gdb |
---|
| 223 | # Summary: rtems gdb for sparc-rtems4.11 |
---|
| 224 | # Group: Development/Tools |
---|
| 225 | # %if %build_infos |
---|
| 226 | # Requires: rtems-4.11-gdb-common |
---|
| 227 | # %endif |
---|
| 228 | |
---|
| 229 | %description -n rtems-4.11-sparc-rtems4.11-gdb |
---|
| 230 | GNU gdb targetting sparc-rtems4.11. |
---|
| 231 | |
---|
| 232 | %files -n rtems-4.11-sparc-rtems4.11-gdb |
---|
| 233 | %defattr(-,root,root) |
---|
| 234 | %dir %{_prefix} |
---|
| 235 | %dir %{_prefix}/share |
---|
[ac620ef] | 236 | %{?with_python:%{_datadir}/sparc-rtems4.11-gdb} |
---|
[bf862710] | 237 | |
---|
| 238 | %dir %{_mandir} |
---|
| 239 | %dir %{_mandir}/man1 |
---|
| 240 | %{_mandir}/man1/sparc-rtems4.11-*.1* |
---|
| 241 | |
---|
| 242 | %dir %{_bindir} |
---|
| 243 | %{_bindir}/sparc-rtems4.11-* |
---|
| 244 | |
---|
| 245 | # ============================================================== |
---|
| 246 | # rtems-4.11-gdb-common |
---|
| 247 | # ============================================================== |
---|
| 248 | %package -n rtems-4.11-gdb-common |
---|
| 249 | Summary: Base package for RTEMS gdbs |
---|
| 250 | Group: Development/Tools |
---|
| 251 | Requires(post): /sbin/install-info |
---|
| 252 | Requires(preun): /sbin/install-info |
---|
| 253 | %{?_with_noarch_subpackages:BuildArch: noarch} |
---|
| 254 | |
---|
| 255 | %description -n rtems-4.11-gdb-common |
---|
| 256 | |
---|
| 257 | GDB files shared by all targets. |
---|
| 258 | |
---|
| 259 | %post -n rtems-4.11-gdb-common |
---|
| 260 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 261 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 262 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 263 | /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 264 | |
---|
| 265 | %preun -n rtems-4.11-gdb-common |
---|
| 266 | if [ $1 -eq 0 ]; then |
---|
| 267 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz || : |
---|
| 268 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz || : |
---|
| 269 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz || : |
---|
| 270 | /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz || : |
---|
| 271 | fi |
---|
| 272 | |
---|
| 273 | %files -n rtems-4.11-gdb-common |
---|
| 274 | %defattr(-,root,root) |
---|
| 275 | %dir %{_prefix} |
---|
| 276 | %dir %{_prefix}/share |
---|
| 277 | |
---|
| 278 | %dir %{_infodir} |
---|
| 279 | %ghost %{_infodir}/dir |
---|
| 280 | %{_infodir}/gdb.info* |
---|
| 281 | |
---|
| 282 | %{_infodir}/gdbint.info* |
---|
| 283 | %{_infodir}/stabs.info* |
---|
| 284 | %{_infodir}/annotate.info* |
---|
| 285 | |
---|