--- /dev/null
+###############################################################################
+# IPFire.org - An Open Source Firewall Solution #
+# Copyright (C) - IPFire Development Team <info@ipfire.org> #
+###############################################################################
+
+name = patchelf
+version = 0.17.2
+release = 1
+
+groups = Development/Tools
+url = http://nixos.org/patchelf.html
+license = GPLv3+
+summary = A utility for patching ELF binaries
+
+description
+ PatchELF is a simple utility for modifying an existing ELF executable
+ or library. It can change the dynamic loader ("ELF interpreter")
+ of an executable and change the RPATH of an executable or library.
+end
+
+source_dl = https://github.com/NixOS/%{name}/archive/%{version}/
+sources = %{thisapp}.tar.gz
+
+build
+ requires
+ autoconf
+ automake
+ end
+
+ prepare_cmds
+ # Remove shipped elf header file and
+ # use the one from glibc instead.
+ rm -rvf src/elf.h
+
+ # Disable test which requires DT_JMPREL.
+ # Our default compiler configuration does not allow to
+ # compile such an elf file.
+ sed -i '/phdr-corruption.sh/d' tests/Makefile.am
+
+ ./bootstrap.sh
+ end
+
+ test
+ make check
+ end
+end
+
+packages
+ package %{name}
+
+ package %{name}-debuginfo
+ template DEBUGINFO
+ end
+end