When building a srpm with mock and then rebuilding it to create the rpm mock automatically generates some dependencies. This is perfectly fine in most cases but since what I am trying to build already brings everything it needs with it I don't want this behaviour. The automatic requirement I cannot solve is libffmpeg.so()(64bit) - but as I said it is included as a file.

I already tried (in the spec file)

  • %define __requires_exclude libffmpeg.so
  • AutoReq: no|0
  • AutoReqProv: no|0

everything of the above with and without specifying a requirement manually (e.g. coreutils).

Commands used:

mock -r epel-7-x86_64 --buildsrpm --no-clean --no-cleanup-after --spec="${RPM_NAME}.spec" --source="${WORKING_DIR}" --resultdir="${WORKING_DIR}" -v
mock -r epel-7-x86_64 --rebuild --no-clean --no-cleanup-after "${WORKING_DIR}"/${RPM_NAME}*.src.rpm --resultdir="${WORKING_DIR}" -v

This is not strictly releated to Mock. Mock use internally rpmbuild and this automatic dependency are calculated by rpmbuild.

If you put libffmpeg.so in system path then you can just (which should be done automatically btw):

Provides: libffmpeg.so()(64bit)

But if it is not in system path you should just filter the Require. Here is the comprehensive guide: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering

I want to point two things where you may do mistake:

1) It is not cumulative. Only last macro is used and it replace previous one.

2) It is regular expression which needs to match whole string. I.e. libffmpeg.so will not match "libffmpeg.so()(64bit)". So you must:

%global __requires_exclude ^libffmpeg\\.so.*$

Additionally you should add:

Provides: bundled(<libname>) = <version>
| improve this answer | |
  • Thank you for all the information! By using Provides: bundled(<libname>) = <version> it is working now. – derdeagle Sep 20 '16 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.