#!/bin/sh

# If using normal root, avoid changing anything.
if [ -z "$RPM_BUILD_ROOT" ] || [ "$RPM_BUILD_ROOT" = "/" ]; then
  exit 0
fi

find "$RPM_BUILD_ROOT" -type f -name '*.la' 2>/dev/null -print0 |
  xargs -0 grep --fixed-strings '.la - a libtool library file' --files-with-matches --null |
  xargs -0 rm --force
