File libdwarf.spec of Package libdwarf
#
# spec file for package libdwarf (Version 20120410
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: libdwarf
Version: 20150115
Release: 0
Url: http://prevanders.net/dwarf.html
Summary: Access DWARF debugging information
License: LGPL-2.1+ and GPL-2.0+
Group: Development/Libraries/C and C++
#Git-Clone: git://git.code.sf.net/p/libdwarf/code
Source: http://prevanders.net/%name-%version.tar.gz
# PATCH-FIX-OPENSUSE libdwarf-fix-parallel-build.diff
Patch0: libdwarf-fix-parallel-build.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: binutils-devel libelf-devel
%description
Library of functions to provide creation of DWARF debugging information
records, DWARF line number information, DWARF address range and
pubnames information, weak names information, and DWARF frame
description information.
Authors:
--------
David Anderson <davea42@earthlink.net>
%package devel
Summary: Static libraries of libdwarf
Group: Development/Libraries/C and C++
License: LGPL-2.1+
PreReq: %install_info_prereq
Requires: %{name} = %{version}
%description devel
Contains the static libraries and header files of libdwarf.
Libdwarf is a library of functions to provide creation of DWARF
debugging information records, DWARF line number information, DWARF
address range and pubnames information, weak names information, and
DWARF frame description information.
Authors:
--------
David Anderson <davea42@earthlink.net>
%package tools
Summary: DWARF-related tools
Group: System/Libraries
License: GPL-2.0+
# Debian name for the package; provide it for cross-discoverability.
Provides: dwarfutils = %version-%release
PreReq: %install_info_prereq
%description tools
Contains dwarfdump, a tool to access DWARF debug information.
Authors:
--------
David Anderson <davea42@earthlink.net>
%package doc
Summary: Documentation for libdwarf
License: GPL-2.0+
Group: Documentation/Other
PreReq: %install_info_prereq
%description doc
Documentation for libdwarf.
Authors:
--------
David Anderson <davea42@earthlink.net>
%prep
%setup -q -n dwarf-%{version}
%patch0 -p0
%build
export CFLAGS="$RPM_OPT_FLAGS"
## libdwarf
cd libdwarf
CFLAGS="$CFLAGS -fPIC" %configure --enable-shared
make %{?_smp_mflags}
cd -
## dwarfdump
cd dwarfdump
%configure
# LD_LIBRARY_PATH required since libdwarf.so and libdwarf.a
# are available - and tag_tree_build get linked against
# shared library. This workaround avoids patching of dwarfdump
# Makefile
# - dgollub (20081001)
LD_LIBRARY_PATH="../libdwarf" make %{?_smp_mflags}
cd -
%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_includedir}/libdwarf
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 libdwarf/libdwarf.a %{buildroot}%{_libdir}
install -m 0644 libdwarf/libdwarf.so* %{buildroot}%{_libdir}
install -m 0755 dwarfdump/dwarfdump %{buildroot}%{_bindir}
install -m 0644 dwarfdump/dwarfdump.1 %{buildroot}%{_mandir}/man1/dwarfdump.1
install -m 0644 libdwarf/libdwarf.h %{buildroot}%{_includedir}/libdwarf
install -m 0644 libdwarf/dwarf.h %{buildroot}%{_includedir}/libdwarf
%post -n libdwarf -p /sbin/ldconfig
%postun -n libdwarf -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc libdwarf/LIBDWARFCOPYRIGHT libdwarf/COPYING libdwarf/LGPL.txt
%{_libdir}/libdwarf.*so
%files devel
%defattr(-,root,root)
%{_libdir}/libdwarf.a
%{_includedir}/libdwarf
%files tools
%defattr(-,root,root)
%{_bindir}/dwarfdump
%{_mandir}/man1/dwarfdump*
%doc dwarfdump/README libdwarf/COPYING dwarfdump/GPL.txt
%files doc
%defattr(-,root,root)
%doc libdwarf/*.pdf
%doc libdwarf/README
%changelog