CPack: exclude particular RPM dependency

Viewed 359

So, here is my C++ library, which is properly built via CMake on CentOS 7 and there I'm trying to create an RPM package from it. Well, CPack makes it quite easy, but in this particular case therte is a caveat that spoils all the fun.

My library depends indirectly on some third-party stuff in the following way: my_lib <- stuff <- fubar and that "fubar" is a couple of libs that are being deployed via run-packages, not regular RPMs, yum knows nothing about them and that cannot be fixed.

Here I check the RPM dependencies:

rpm -qp ./build-centos/my-awesome-lib-2.0.2.0-264-ga003c47+264.ga003c47-Linux.rpm --requires

/bin/sh
/bin/sh
/bin/sh
/bin/sh
config(my-awesome-lib) = 2.0.2.0_264_ga003c47+264.ga003c47-1
ld-linux-aarch64.so.1()(64bit)
ld-linux-aarch64.so.1(GLIBC_2.17)(64bit)
fubar.so()(64bit)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.17)(64bit)
libcrypto.so.10()(64bit)
libcrypto.so.10(libcrypto.so.10)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.17)(64bit)
libgcc_s.so.1()(64bit)
libgcc_s.so.1(GCC_3.0)(64bit)
libgcc_s.so.1(GCC_4.2.0)(64bit)
...

If you take note on the fubar.so()(64bit) line you'll get my trouble -- the library has neat built-in checks, telling the user to install "fubar", configure env properly, etc, but with that direct RPM dependency he will not be able to install the package at all!

And yes, I do want to "exclude" that nasty dependency.

So, the first option is to use something like...

set(CPACK_RPM_PACKAGE_AUTOREQ " no")
set(CPACK_RPM_PACKAGE_REQUIRES <dependencies here>)
include(CPack)

but I'd have to list all of them, except fubar and that's pretty long a list, not mentioning the need to review that list before every release.

Another option could be something like...

set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION, "/usr/local/FuBar /usr/local/FuBar/lib64 /usr/local/FuBar/lib64/stub")
include(CPack)

but, alas, it never works, not even with other similar variables like CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIS.

I've also tried the following:

    set(SOMEEXCLUDE
         /usr/local/FuBar
         /usr/local/FuBar/lib64
         /usr/local/FuBar/lib64/stub)
    list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST ${SOMEEXCLUDE})
    include(CPack)

Does not work =(

Could anyone point me to a receipe, which would just "pick away" the unwanted dependency if it is possible?
Thanks in advance for your effort.

0 Answers
Related