File patchelf.spec of Package patchelf

#
# spec file for package patchelf
#
# 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 http://bugs.opensuse.org/
#


%define hash 1fa4d36fead44333528cbee4b5c04c207ce77ca4
%define shorthash %(echo %{hash} | head -c 7)
Name:           patchelf
Version:        0
Release:        <RELEASE>.g%{shorthash}
Summary:        Utility to modify properties of ELF executables and libraries
License:        GPL-3.0-or-later
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Tools/Other
URL:            https://github.com/NixOS/patchelf
Source:         https://github.com/NixOS/patchelf/archive/%{hash}.tar.gz
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc-c++

%description
PatchELF is a simple utility for modifying existing ELF executables and
libraries.  In particular, it can do the following:

* Change the dynamic loader ("ELF interpreter") of executables:

  $ patchelf --set-interpreter /lib/my-ld-linux.so.2 my-program

* Change the RPATH of executables and libraries:

  $ patchelf --set-rpath /opt/my-libs/lib:/other-libs my-program

* Shrink the RPATH of executables and libraries:

  $ patchelf --shrink-rpath my-program

  $ patchelf --shrink-rpath --allowed-rpath-prefixes %{_prefix}/lib:/foo/lib my-program

* Remove declared dependencies on dynamic libraries (DT_NEEDED
  entries):

  $ patchelf --remove-needed libfoo.so.1 my-program

  This option can be given multiple times.

* Add a declared dependency on a dynamic library (DT_NEEDED):

  $ patchelf --add-needed libfoo.so.1 my-program

  This option can be give multiple times.

* Replace a declared dependency on a dynamic library with another one
  (DT_NEEDED):

  $ patchelf --replace-needed liboriginal.so.1 libreplacement.so.1 my-program

  This option can be give multiple times.

* Change SONAME of a dynamic library:

  $ patchelf --set-soname libnewname.so.3.4.5 path/to/libmylibrary.so.1.2.3

%prep
%setup -q -n %{name}-%{hash}

%build
sh bootstrap.sh
%configure --docdir=%{_datadir}/doc/packages/%{name}
make %{?_smp_mflags}

%install
%make_install

%files
%license COPYING
%doc BUGS README
%{_bindir}/%{name}
%{_datadir}/doc/packages/%{name}
%{_mandir}/man1/%{name}.1%{?ext_man}

%changelog
openSUSE Build Service is sponsored by