elfutils/elfutils.spec

224 lines
7.2 KiB
RPMSpec

%define libname libelf
%define _program_prefix eu-
Name: elfutils
Version: 0.159
Release: 1mamba
Summary: A collection of utilities and DSOs to handle compiled objects
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: htpps://fedorahosted.org/elfutils/
Source: https://fedorahosted.org/releases/e/l/elfutils/%{version}/elfutils-%{version}.tar.bz2
# NOTE: manual intervetion needed for updates, upstream files don't have version in name
Patch1: https://fedorahosted.org/releases/e/l/elfutils/%{version}/elfutils-0.158-robustify.patch
Patch2: https://fedorahosted.org/releases/e/l/elfutils/%{version}/elfutils-%{version}-portability.patch
Patch3: %{name}-0.131-strip-copy-symtab.patch
Patch4: %{name}-0.131-gcc43.patch
Patch5: %{name}-0.131-off64_t.patch
License: Open Software License
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
BuildRequires: gettext-devel
BuildRequires: gcc >= 3.4
BuildRequires: bison >= 1.875
BuildRequires: flex >= 2.5.4a
BuildRequires: bzip2
Requires: %{libname} = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Elfutils is a collection of utilities, including:
* nm (for listing symbols from object files)
* size (for listing the section sizes of an object or archive file)
* strip (for discarding symbols)
* readelf (to see the raw ELF file structures)
* elflint (to check for well-formed ELF files)
Also included are numerous helper libraries which implement DWARF, ELF, and machine-specific ELF handling.
%package devel
Summary: Devel package for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains the libraries to create applications for handling compiled objects.
* libebl provides some higher-level ELF access functionality
* libdw provides access to the DWARF debugging information
* libasm provides a programmable assembler interface
%package -n %{libname}
Summary: Library to read and write ELF files
Group: System/Libraries
Provides: elfutils-libelf
Obsoletes: elfutils-libelf
%description -n %{libname}
The %{libname} package provides a DSO which allows reading and writing ELF files on a high level.
Third party programs depend on this package to read internals of ELF files.
The programs of the %{name} package use it also to generate new ELF files.
%package -n %{libname}-devel
Summary: Development support for libelf
Group: Development/Libraries
Requires: %{libname} = %{version}-%{release}
Provides: elfutils-libelf-devel
Obsoletes: elfutils-libelf-devel
%description -n %{libname}-devel
The %{libname}-devel package contains the libraries to create applications for handling compiled objects.
Libelf allows you to access the internals of the ELF object file format, so you can see the different sections of an ELF file.
%prep
%setup -q
#%patch3 -p1
%patch2 -p1
#%patch1 -p1
#%patch5 -p1
#sed -i "s|-Werror||" src/Makefile.in tests/Makefile.in libelf/Makefile.in
%build
RPM_OPT_FLAGS="${RPM_OPT_FLAGS/-Wall/}"
%configure \
--program-prefix=%{_program_prefix} \
CFLAGS="$RPM_OPT_FLAGS -fexceptions -D__NO_INLINE__"
%if "%{_host}" == "%{_build}"
%make %{?_smp_mflags}
%ifnarch arm
%make check
%endif
%else
make CC=%{_build}-gcc -C lib libeu.a
make CC=%{_build}-gcc -C libcpu i386_gendis
mv libcpu/i386_gendis libcpu/i386_gendis.build
sed -i "s|\./i386_gendis|./i386_gendis.build|" libcpu/Makefile
make -C libcpu clean
make -C lib clean
%make || %make
%endif
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
chmod +x %{buildroot}%{_libdir}/lib*.so*
chmod +x %{buildroot}%{_libdir}/%{name}/lib*.so*
# Remove unpackaged files
rm -f %{buildroot}%{_bindir}/%{_program_prefix}{ld,objdump}
rm -f %{buildroot}%{_includedir}/%{name}/libasm.h
rm -f %{buildroot}%{_libdir}/libasm-%{version}.so
rm -f %{buildroot}%{_libdir}/libasm.{a,so,so.*}
%find_lang %{name}
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/%{_program_prefix}ar
%{_bindir}/%{_program_prefix}make-debug-archive
%{_bindir}/%{_program_prefix}elflint
%{_bindir}/%{_program_prefix}nm
%{_bindir}/%{_program_prefix}readelf
%{_bindir}/%{_program_prefix}size
%{_bindir}/%{_program_prefix}stack
%{_bindir}/%{_program_prefix}strip
%{_bindir}/%{_program_prefix}unstrip
%{_bindir}/%{_program_prefix}findtextrel
%{_bindir}/%{_program_prefix}addr2line
%{_bindir}/%{_program_prefix}elfcmp
%{_bindir}/%{_program_prefix}ranlib
%{_bindir}/%{_program_prefix}strings
%{_libdir}/libdw-%{version}.so
%{_libdir}/libdw.so.*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/lib*.so
%doc AUTHORS COPYING ChangeLog NEWS README THANKS TODO
%files devel
%defattr(-,root,root)
%{_includedir}/dwarf.h
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/elf-knowledge.h
%{_includedir}/%{name}/libebl.h
%{_includedir}/%{name}/libdw.h
%{_includedir}/%{name}/libdwelf.h
%{_includedir}/%{name}/libdwfl.h
%{_includedir}/%{name}/version.h
%{_libdir}/libebl.a
%{_libdir}/libdw.a
%{_libdir}/libdw.so
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libelf-%{version}.so
%{_libdir}/libelf.so.*
%files -n %{libname}-devel
%defattr(-,root,root)
%{_includedir}/libelf.h
%{_includedir}/gelf.h
%{_includedir}/nlist.h
%{_libdir}/libelf.a
%{_libdir}/libelf.so
%changelog
* Mon Jul 14 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.159-1mamba
- update to 0.159
* Sat Feb 22 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 0.158-1mamba
- update to 0.158
* Sat Nov 09 2013 Automatic Build System <autodist@mambasoft.it> 0.157-1mamba
- automatic version update by autodist
* Mon Sep 23 2013 Automatic Build System <autodist@mambasoft.it> 0.156-1mamba
- automatic version update by autodist
* Sat Dec 01 2012 Automatic Build System <autodist@mambasoft.it> 0.155-1mamba
- update to 0.155
* Wed Jan 12 2011 Automatic Build System <autodist@mambasoft.it> 0.148-2mamba
- automatic update by autodist
* Sun Nov 21 2010 Automatic Build System <autodist@mambasoft.it> 0.148-1mamba
- automatic update by autodist
* Wed Jun 16 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 0.147-1mamba
- update to 0.147
* Mon Apr 12 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 0.145-1mamba
- update to 0.145
* Wed Jul 01 2009 Automatic Build System <autodist@mambasoft.it> 0.141-1mamba
- update to 0.141
* Tue Feb 17 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 0.131-2mamba
- add off64_t patch
* Sun May 18 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 0.131-1mamba
- update to 0.131
- rename elfutils-libelf to libelf and obsolete old package names
* Tue Feb 28 2006 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 0.119-2qilnx
- added portability patch
* Mon Feb 27 2006 Stefano Cotta Ramusino <stefano.cotta@qilinux.it> 0.119-1qilnx
- update to version 0.119 by autospec
- fixed source URL
- fixed license
* Tue Jan 03 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.118-1qilnx
- package created by autospec