elfutils/elfutils.spec

248 lines
7.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package elfutils
#
# Copyright (c) 2018 SUSE LINUX 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 https://bugs.opensuse.org/
#
Name: elfutils
Version: 0.175
Release: 0
Summary: Higher-level library to access ELF files
License: SUSE-GPL-2.0-with-OSI-exception
Group: Development/Tools/Building
Url: http://fedorahosted.org/elfutils/
#Git-Clone: git://sourceware.org/git/elfutils
Source: https://fedorahosted.org/releases/e/l/%{name}/%{version}/%{name}-%{version}.tar.bz2
Source4: https://fedorahosted.org/releases/e/l/%{name}/%{version}/%{name}-%{version}.tar.bz2.sig
Source1: README-BEFORE-ADDING-PATCHES
Source2: baselibs.conf
Source3: %{name}.changes
Patch1: disable-tests-with-ptrace.patch
Patch2: cfi-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: libbz2-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
%description
elfutils is a collection of utilities and libraries to read, create
and modify ELF binary files, find and handle DWARF debug data,
symbols, thread state and stacktraces for processes and core files.
%package -n libasm1
Summary: A collection of utilities and DSOs to handle compiled objects
Group: System/Libraries
%description -n libasm1
libasm contains the "asm" and "disasm" functions to assemble and
disassamble instructions. (There is only partial support for i686 and
BPF instructions.) This is part of the elfutils package.
%package -n libasm-devel
Summary: A collection of utilities and DSOs to handle compiled objects
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libasm1 = %{version}
%description -n libasm-devel
This package contains the headers and libraries needed to build
applications that require libasm.
%package -n libebl-plugins
Summary: Architecture backends for libebl
Group: System/Libraries
Provides: libebl = %{version}-%{release}
Obsoletes: libebl < %{version}-%{release}
Provides: libebl1 = %{version}-%{release}
Obsoletes: libebl1 < %{version}-%{release}
%description -n libebl-plugins
This subpackage contains the plugins to read architecture-specific
debug info. This is part of the elfutils package.
%package -n libebl-devel
Summary: Development files for libebl and for EBL plugins
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libdw-devel = %{version}
%description -n libebl-devel
This package contains the headers and libraries needed to build
applications that require libebl, or to build additional EBL
architecutre backend plugins.
%package -n libelf1
Summary: Library to read and write ELF files
Group: System/Libraries
Requires: libebl-plugins = %{version}
%description -n libelf1
This package provides a high-level library to read and write ELF files.
This is part of the elfutils package.
%package -n libelf-devel
Summary: Development files for libelf
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libelf1 = %{version}
Conflicts: libelf0-devel
%description -n libelf-devel
This package contains the headers and libraries needed to build
applications that require libelf.
%package -n libdw1
Summary: Library to access DWARF debugging information
Group: System/Libraries
%description -n libdw1
This package provides a high-level library to access the DWARF debugging
information. This is part of the elfutils package.
%package -n libdw-devel
Summary: Development files for libdw
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libdw1 = %{version}
Requires: libelf-devel = %{version}
%description -n libdw-devel
This package contains the headers and libraries needed to build
applications that require libdw.
%lang_package
%prep
%setup -q
%if 0%{?qemu_user_space_build}
# qemu does not support ptrace
%patch1 -p1
%endif
%patch2 -p1
%build
# Change DATE/TIME macros to use last change time of elfutils.changes
# See http://lists.opensuse.org/opensuse-factory/2011-05/msg00304.html
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
find . -type f -regex ".*\.c\|.*\.cpp\|.*\.h" -exec sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" {} +
# Set modversion used to verify dynamically loaded ebl backend matches to
# similarly predictable value [upstream default is hostname + date]
MODVERSION="suse-build `eval echo ${DATE} ${TIME}`"
sed --in-place "s/^MODVERSION=.*\$/MODVERSION=\"${MODVERSION}\"/" configure.ac
export CFLAGS="%optflags"
CFLAGS+=" -g" # make tests pass when user does not want debuginfo (boo#1031556)
%ifarch %sparc
# Small PIC model not sufficient
CFLAGS+=" -fPIC"
%endif
autoreconf -fi
%configure --program-prefix=eu-
Accepting request 613899 from home:marxin:branches:openSUSE:Factory - Update to version 0.171 DWARF5 and split dwarf, including GNU DebugFission, are supported now. Data can be read from the new DWARF sections .debug_addr, .debug_line_str, .debug_loclists, .debug_str_offsets and .debug_rnglists. Plus the new DWARF5 and GNU DebugFission encodings of the existing .debug sections. Also in split DWARF .dwo (DWARF object) files. This support is mostly handled by existing functions (dwarf_getlocation*, dwarf_getsrclines, dwarf_ranges, dwarf_form*, etc.) now returning the data from the new sections and data formats. But some new functions have been added to more easily get information about skeleton and split compile units (dwarf_get_units and dwarf_cu_info), handle new attribute data (dwarf_getabbrevattr_data) and to keep references to Dwarf_Dies that might come from different sections or files (dwarf_die_addr_die). Not yet supported are .dwp (Dwarf Package) and .sup (Dwarf Supplementary) files, the .debug_names index, the .debug_cu_index and .debug_tu_index sections. Only a single .debug_info (and .debug_types) section are currently handled. readelf: Handle all new DWARF5 sections. --debug-dump=info+ will show split unit DIEs when found. --dwarf-skeleton can be used when inspecting a .dwo file. Recognizes GNU locviews with --debug-dump=loc. libdw: New functions dwarf_die_addr_die, dwarf_get_units, dwarf_getabbrevattr_data and dwarf_cu_info. libdw will now try to resolve the alt file on first use of an alt attribute FORM when not set yet with dwarf_set_alt. dwarf_aggregate_size() now works with multi-dimensional arrays. libdwfl: Use process_vm_readv when available instead of ptrace. backends: Add a RISC-V backend. There were various improvements to build on Windows. The sha1 and md5 implementations have been removed, they weren't used. - Remove patches: elfutils-0.170-Wpackednotaligned.patch, elfutils-0.170-stripnothing.patch, gcc8-disable-test.patch - make package with V=1 to print verbose command line OBS-URL: https://build.opensuse.org/request/show/613899 OBS-URL: https://build.opensuse.org/package/show/Base:System/elfutils?expand=0&rev=109
2018-06-05 12:45:12 +02:00
make %{?_smp_mflags} V=1
%install
make DESTDIR=$RPM_BUILD_ROOT install
# remove unneeded files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
ls -lR $RPM_BUILD_ROOT%{_libdir}/libelf*
%find_lang %{name}
%post -n libasm1 -p /sbin/ldconfig
%post -n libelf1 -p /sbin/ldconfig
%post -n libdw1 -p /sbin/ldconfig
%postun -n libasm1 -p /sbin/ldconfig
%postun -n libelf1 -p /sbin/ldconfig
%postun -n libdw1 -p /sbin/ldconfig
%check
make check %{?_smp_mflags} V=1
%files
%defattr(-,root,root)
%license COPYING
%doc AUTHORS ChangeLog NEWS NOTES README THANKS TODO
%{_bindir}/*
%files -n libasm1
%defattr(-,root,root)
%{_libdir}/libasm.so.*
%{_libdir}/libasm-%{version}.so
%files -n libasm-devel
%defattr(-,root,root)
%{_libdir}/libasm.so
%{_libdir}/libasm.a
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/libasm.h
%files -n libebl-plugins
%defattr(-,root,root)
%{_libdir}/elfutils
%files -n libebl-devel
%defattr(-,root,root)
%{_libdir}/libebl.a
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/libebl.h
%files -n libelf1
%defattr(-,root,root)
%{_libdir}/libelf.so.*
%{_libdir}/libelf-%{version}.so
%files -n libelf-devel
%defattr(-,root,root)
%{_libdir}/libelf.so
%{_libdir}/libelf.a
%{_includedir}/libelf.h
%{_includedir}/gelf.h
%{_includedir}/nlist.h
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/elf-knowledge.h
%{_includedir}/elfutils/version.h
%{_libdir}/pkgconfig/libelf.pc
%files -n libdw1
%defattr(-,root,root)
%{_libdir}/libdw.so.*
%{_libdir}/libdw-%{version}.so
%files -n libdw-devel
%defattr(-,root,root)
%{_libdir}/libdw.a
%{_libdir}/libdw.so
%{_includedir}/dwarf.h
%dir %{_includedir}/elfutils
%{_includedir}/elfutils/libdw.h
%{_includedir}/elfutils/libdwelf.h
%{_includedir}/elfutils/libdwfl.h
%{_includedir}/elfutils/known-dwarf.h
%{_libdir}/pkgconfig/libdw.pc
%files lang -f %{name}.lang
%changelog