Skip to content

Instantly share code, notes, and snippets.

@fumiyas
Created June 11, 2012 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fumiyas/2908368 to your computer and use it in GitHub Desktop.
Save fumiyas/2908368 to your computer and use it in GitHub Desktop.
RPM SPEC: Exclude %{_docdir} from find-requires target
## Put the following snippet into %prep, %build or %install in your *.spec
cat <<'EOF' >%{name}-req
#!/bin/sh
while read -r f; do
[[ -z "${f##%{buildroot}%{_docdir}/*}" ]] && continue
echo "$f"
done \
|%{__find_requires} "$@"
EOF
chmod +x %{name}-req
%define __find_requires %{_builddir}/%{name}-%{version}/%{name}-req
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment