name = glibc
version = 2.37
-release = 4
+release = 5
maintainer = Michael Tremer <michael.tremer@ipfire.org>
groups = System/Base
libcap-devel
libstdc++-static
make >= 4.0
+ patchelf
python3 >= 3.4
texinfo
end
# Strip any object files
strip --strip-debug %{BUILDROOT}%{libdir}/*.o
+
+ # Some gconv libraries requires other libraries and contain $ORIGIN
+ # as RUNPATH because they are all located in the same directory.
+ # We do not support $ORIGIN as RUNPATH so change this to the directory
+ # where the modules are located.
+ find %{BUILDROOT}%{libdir}/gconv -type f -name "*.so" -exec sh -c '
+ for file do
+ # Obtain the RUNPATH of the module in case it has one set.
+ runpath=$(patchelf --print-rpath ${file} | tr -d '\n')
+
+ # Check if the RUNPATH is $ORIGIN
+ if [ "${runpath}" == "\$ORIGIN" ]; then
+ # Use patchelf to change the RUNPATH
+ patchelf --set-rpath %{libdir}/gconv ${file}
+ fi
+ done ' sh {} +
end
end