From 59c3dfeab88f95cb5792b5e8155261876403fd9b Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Fri, 10 Mar 2006 06:03:39 +0000 Subject: New. --- contrib/crossrpms/gdb/base-gdb.add | 65 +++++++++++++++++++++++++++++++++++ contrib/crossrpms/gdb/build.add | 22 ++++++++++++ contrib/crossrpms/gdb/gdb.add | 24 +++++++++++++ contrib/crossrpms/gdb/install.add | 40 +++++++++++++++++++++ contrib/crossrpms/gdb/prep.add | 8 +++++ contrib/crossrpms/gdb/rpm-install.add | 32 +++++++++++++++++ contrib/crossrpms/gdb/target-gdb.add | 25 ++++++++++++++ 7 files changed, 216 insertions(+) create mode 100644 contrib/crossrpms/gdb/base-gdb.add create mode 100644 contrib/crossrpms/gdb/build.add create mode 100644 contrib/crossrpms/gdb/gdb.add create mode 100644 contrib/crossrpms/gdb/install.add create mode 100644 contrib/crossrpms/gdb/prep.add create mode 100644 contrib/crossrpms/gdb/rpm-install.add create mode 100644 contrib/crossrpms/gdb/target-gdb.add (limited to 'contrib') diff --git a/contrib/crossrpms/gdb/base-gdb.add b/contrib/crossrpms/gdb/base-gdb.add new file mode 100644 index 0000000000..dcb9e9f238 --- /dev/null +++ b/contrib/crossrpms/gdb/base-gdb.add @@ -0,0 +1,65 @@ +%if "%{_prefix}" != "/usr" +# ============================================================== +# rtems-base-gdb +# ============================================================== +%package -n @rpmprefix@rtems@osversion@-base-gdb +Summary: base package for rtems gdb +Group: Development/Tools +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info + +%description -n @rpmprefix@rtems@osversion@-base-gdb + +RTEMS is an open source operating system for embedded systems. + +This is the base for gdb regardless of target CPU. + +%post -n @rpmprefix@rtems@osversion@-base-gdb + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdb.info.gz +%if "%{gdb_version}" < "6.3" + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/mmalloc.info.gz +%endif +%if "%{gdb_version}" >= "5.0" + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/stabs.info.gz +%endif +%if "{gdb_version}" >= "6.0" + /sbin/install-info --info-dir=%{_infodir} %{_infodir}/annotate.info.gz +%endif + +%preun -n @rpmprefix@rtems@osversion@-base-gdb +if [ $1 -eq 0 ]; then + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdb.info.gz +%if "%{gdb_version}" < "6.3" + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/mmalloc.info.gz +%endif +%if "%{gdb_version}" >= "5.0" + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/gdbint.info.gz + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/stabs.info.gz +%endif +%if "{gdb_version}" >= "6.0" + /sbin/install-info --delete --info-dir=%{_infodir} %{_infodir}/annotate.info.gz +%endif +fi + +%files -n @rpmprefix@rtems@osversion@-base-gdb +%defattr(-,root,root) +%dir %{_infodir} +%ghost %{_infodir}/dir +%{_infodir}/gdb.info* + +# FIXME: When had mmalloc.info been removed? +%if "%{gdb_version}" < "6.3" +%{_infodir}/mmalloc.info* +%endif +# FIXME: When had gdbint and stabs been introduced? +%if "%{gdb_version}" >= "5.0" +%{_infodir}/gdbint.info* +%{_infodir}/stabs.info* +%endif + +%if "{gdb_version}" >= "6.0" +%{_infodir}/annotate.info* +%endif + +%endif diff --git a/contrib/crossrpms/gdb/build.add b/contrib/crossrpms/gdb/build.add new file mode 100644 index 0000000000..9452637127 --- /dev/null +++ b/contrib/crossrpms/gdb/build.add @@ -0,0 +1,22 @@ +%build + mkdir -p build + cd build + CFLAGS="$RPM_OPT_FLAGS" \ + ../gdb-%{gdb_version}/configure \ + --build=%_build --host=%_host \ + --target=@tool_target@ \ + --verbose --disable-nls \ + --without-included-gettext \ + --disable-win32-registry \ + --disable-werror \ + --with-sysroot=%{_prefix}/@tool_target@/sys-root \ + --prefix=%{_prefix} --bindir=%{_bindir} \ + --includedir=%{_includedir} --libdir=%{_libdir} \ + --mandir=%{_mandir} --infodir=%{_infodir} + + make all +#%if "%{_prefix}" != "/usr" + make info +#%endif + cd .. + diff --git a/contrib/crossrpms/gdb/gdb.add b/contrib/crossrpms/gdb/gdb.add new file mode 100644 index 0000000000..ae65a13839 --- /dev/null +++ b/contrib/crossrpms/gdb/gdb.add @@ -0,0 +1,24 @@ +%define gdb_version @GDB_VERS@ +%define gdb_rpmvers %{expand:%(echo @GDB_VERS@ | tr - _)} + +Name: @rpmprefix@@tool_target@-gdb +Summary: Gdb for target @tool_target@ +Group: Development/Tools +Version: %{gdb_rpmvers} +Release: @GDB_RPMREL@%{?dist} +License: GPL/LGPL +URL: http://sources.redhat.com/gdb +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%if "%{_prefix}" != "/usr" +# Required for building the infos +BuildRequires: /sbin/install-info +BuildRequires: texinfo >= 4.2 +%endif +BuildRequires: flex +BuildRequires: bison + +@SOURCES@ + +%description +Cross gdb for target @tool_target@ diff --git a/contrib/crossrpms/gdb/install.add b/contrib/crossrpms/gdb/install.add new file mode 100644 index 0000000000..9236903741 --- /dev/null +++ b/contrib/crossrpms/gdb/install.add @@ -0,0 +1,40 @@ +%install + rm -rf $RPM_BUILD_ROOT + + cd build + make prefix=$RPM_BUILD_ROOT%{_prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + infodir=$RPM_BUILD_ROOT%{_infodir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} \ + install + +%if "%{_prefix}" != "/usr" + make prefix=$RPM_BUILD_ROOT%{_prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + infodir=$RPM_BUILD_ROOT%{_infodir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} \ + install-info +%endif + +%if "%{_prefix}" == "/usr" +# Conflict with a native gdb's infos + rm -rf $RPM_BUILD_ROOT%{_infodir} +%else + rm -f $RPM_BUILD_ROOT%{_infodir}/dir + touch $RPM_BUILD_ROOT%{_infodir}/dir + +# These come from other packages + rm -rf $RPM_BUILD_ROOT%{_infodir}/bfd* + rm -rf $RPM_BUILD_ROOT%{_infodir}/configure* + rm -rf $RPM_BUILD_ROOT%{_infodir}/standards* +%endif + +# We don't ship host files + rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty* + + cd .. + diff --git a/contrib/crossrpms/gdb/prep.add b/contrib/crossrpms/gdb/prep.add new file mode 100644 index 0000000000..8ceb63ea4a --- /dev/null +++ b/contrib/crossrpms/gdb/prep.add @@ -0,0 +1,8 @@ +%prep +%setup -q -c -T -n %{name}-%{version} + +%setup -q -D -T -n %{name}-%{version} -a0 +cd gdb-%{gdb_version} +%{?PATCH0:%patch0 -p1} +cd .. + diff --git a/contrib/crossrpms/gdb/rpm-install.add b/contrib/crossrpms/gdb/rpm-install.add new file mode 100644 index 0000000000..07efd8fe29 --- /dev/null +++ b/contrib/crossrpms/gdb/rpm-install.add @@ -0,0 +1,32 @@ +# Extract %%__os_install_post into os_install_post~ +cat << \EOF > os_install_post~ +%__os_install_post +EOF + +# Generate customized brp-*scripts +cat os_install_post~ | while read a x y; do +case $a in +# Prevent brp-strip* from trying to handle foreign binaries +*/brp-strip*) + b=$(basename $a) + sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b + chmod a+x $b + ;; +%if "%{_prefix}" != "/usr" +# Fix up brp-compress to handle %%_prefix != /usr +*/brp-compress*) + b=$(basename $a) + sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b + chmod a+x $b + ;; +%endif +esac +done + +sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ +%if "%{_prefix}" != "/usr" + -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ +%endif +< os_install_post~ > os_install_post +%define __os_install_post . ./os_install_post + diff --git a/contrib/crossrpms/gdb/target-gdb.add b/contrib/crossrpms/gdb/target-gdb.add new file mode 100644 index 0000000000..edefd7ad5b --- /dev/null +++ b/contrib/crossrpms/gdb/target-gdb.add @@ -0,0 +1,25 @@ +# ============================================================== +# @tool_target@-gdb +# ============================================================== +# %package -n @rpmprefix@@tool_target@-gdb +# Summary: rtems gdb for @tool_target@ +# Group: Development/Tools +# Requires: @rpmprefix@rtems@osversion@-base-gdb + +%description -n @rpmprefix@@tool_target@-gdb + +GNU gdb targetting @tool_target@. + +%files -n @rpmprefix@@tool_target@-gdb +%defattr(-,root,root) +%if "%{_prefix}" != "/usr" +%dir %{_mandir} +%dir %{_mandir}/man1 +%endif +%{_mandir}/man1/@tool_target@-*.1* + +%if "%{_prefix}" != "/usr" +%dir %{_bindir} +%endif +%{_bindir}/@tool_target@-* + -- cgit v1.2.3