Author Topic: Best way to update GDB to 7.1 in PCLinuxOS 2010  (Read 3510 times)

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12519
Re: Best way to update GDB to 7.1 in PCLinuxOS 2010
« Reply #15 on: June 06, 2010, 02:50:58 AM »
Texstar,
I see you already updated gdb to version 7.1.   8) 8) 8)

Did you get rid of all the Red Hat patches?

Just for the heck of it I created a spec file without the patches that works for me. I did add gstack and the man page from the patches though.

Code: [Select]
%define name    gdb
%define version 7.1
%define release %mkrel 1

Summary:        A GNU source-level debugger for C, C++ and Fortran
Name:           %{name}
Version:        %{version}
Release:        %{release}
License:        GPL
Group:          Development/Other
URL:            http://www.gnu.org/software/gdb/
Source:         gdb-%{version}.tar.bz2
Source1:        gdb-gstack.sh
Source2:        gdb-gstack.man

Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
PreReq:         /sbin/install-info
BuildRequires:  ncurses-devel readline-devel texinfo flex bison libpython-devel
Requires:       libexpat1 libncurses5 libreadline5 libz libpython2.5
Obsoletes:      %name < %version

%description
Gdb is a full featured, command driven debugger. Gdb allows you to
trace the execution of programs and examine their internal state at
any time.  Gdb works for C and C++ compiled with the GNU C compiler
gcc.

If you are going to develop C and/or C++ programs and use the GNU gcc
compiler, you may want to install gdb to help you debug your programs.

%prep
%setup -q

cat > gdb/version.in << EOF
%{version}-%{release} (%{product_distribution} release %{product_release})
EOF

%build
./configure                                                     \
        --prefix=%{_prefix}                                     \
        --libdir=%{_libdir}                                     \
        --sysconfdir=%{_sysconfdir}                             \
        --mandir=%{_mandir}                                     \
        --infodir=%{_infodir}                                   \
        --enable-gdb-build-warnings=,-Wno-unused                \
        --disable-werror                                        \
        --disable-sim                                           \
        --disable-rpath                                         \
        --with-system-readline                                  \
        --with-expat                                            \
        --enable-gdbtk                                          \
        --with-python                                           

%make
make info

%install
rm -rf $RPM_BUILD_ROOT
%make install DESTDIR=$RPM_BUILD_ROOT

# Fix up the info directory and files
mkdir -p $RPM_BUILD_ROOT/%{_infodir}
cp `find . -name "*.info*"` $RPM_BUILD_ROOT/%{_infodir}
rm -f $RPM_BUILD_ROOT%{_infodir}/dir $RPM_BUILD_ROOT%{_infodir}/dir.info*
rm -f $RPM_BUILD_ROOT%{_bindir}/{texindex,texi2dvi,makeinfo,install-info,info}

# These are part of binutils
rm -f $RPM_BUILD_ROOT%{_infodir}/{bfd,standard,readline,history,info,texinfo}*
rm -fr $RPM_BUILD_ROOT%{_includedir}
rm -fr $RPM_BUILD_ROOT%{_libdir}/lib{bfd*,opcodes*,iberty*}

# Remove even more unpackaged files
rm -f $RPM_BUILD_ROOT%{_libdir}/libmmalloc.a
rm -f $RPM_BUILD_ROOT%{_infodir}/{configure,libiberty,rluserman}.info*
rm -rf $RPM_BUILD_ROOT%{_datadir}/locale/
rm -f $RPM_BUILD_ROOT%{_infodir}/annotate.info*

# Copy the gstack wrapper script and man page
cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/gstack
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1/gstack.1


mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
cat > $RPM_BUILD_ROOT%{_datadir}/applications/pclinuxos-%{name}.desktop << EOF
[Desktop Entry]
Name=Gdb
Comment=The GNU debugger
Exec=%{_bindir}/gdbtui
Icon=development_tools_section.png
Terminal=true
Type=Application
Categories=X-MandrivaLinux-MoreApplications-Development-Tools;Development;Debugger;
EOF

%clean
rm -fr $RPM_BUILD_ROOT

%post
%{update_menus}
%{_install_info gdb.info}
%{_install_info gdbint.info}
%{_install_info stabs.info}

%preun
if [ $1 = 0 ]; then
%{_remove_install_info gdb.info}
%{_remove_install_info gdbint.info}
%{_remove_install_info stabs.info}
fi

%postun
%clean_menus

%files
%defattr(-,root,root)
%doc COPYING COPYING.LIB README gdb/NEWS
%{_bindir}/gdb
%{_bindir}/gdbserver
%{_bindir}/gdbtui
%attr(755, root, root)%{_bindir}/gstack
%{_mandir}/man1/gdb.1*
%{_mandir}/man1/gdbtui.1*
%{_mandir}/man1/gdbserver.1*
%{_mandir}/man1/gstack.1*
%{_infodir}/gdb.info*
%{_infodir}/gdbint.info*
%{_infodir}/stabs.info*
%{_datadir}/gdb/*
%{_datadir}/applications/pclinuxos-%{name}.desktop

%changelog
* Sat May 29 2010 Andy Herkey <aherkey@gmail.com> 7.1-1pclos2010
- Clean build from scratch
- Don't need no stinkin Red Hat patches. ;^P

* Fri Nov 03 2006 Texstar <texstar@houston.rr.com> 6.3-9pclos2007
- Build for PCLinuxOS 2007


- Andy


I just stripped out the patches. If you have a better package send it up bro.  ;)

Thanks to everyone who donates. You keep the servers running.