Hi,
I have a big RPM spec file for a project that I would like to use with CPack. I can change things in that file if needed. This specfile contains several %package tags I would like to keep. I tried to use CPack with those packages but failed. To simplify my issue, I wrote a little project with a little specfile containing two packages:
The project builds a program with a shared library:
/usr/bin/test
/usr/lib64/liblll.so
and I would like to get two rpm files, one test-test.rpm and another test-lll.rpm
In my CMakeLists.txt, I set those two lines:
install(TARGETS test COMPONENT test DESTINATION β${CMAKE_INSTALL_BINDIR}β)
install(TARGETS lll COMPONENT lll DESTINATION β${CMAKE_INSTALL_LIBDIR}β)
The idea is to have one component for one package.
In the specfile, I defined
%package test and also %package lll with
%files test
%{_bindir}/test
%files lll
%{libdir}/liblll.so
My CMakeCPack.cmake file contains:
set(CPACK_PACKAGE_NAME β${PROJECT_NAME}β)
set(CPACK_COMPONENTS_ALL test lll)
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_GENERATOR RPM)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_USER_BINARY_SPECFILE β${CMAKE_SOURCE_DIR}/test.specβ)
After a βmake packageβ: I get a tree that looks like:
_CPack_Packages/Linux/RPM/test-0.1.1-Linux/
βββ lll
β βββ usr
β βββ lib64
β βββ liblll.so
βββ test
βββ usr
βββ bin
βββ test
But I cannot get my two rpm files.
CPackRPM is complaining about /usr/bin/test that does not exist in lll or usr/lib64/liblll.so that does not exist in test.
Since I specified %files for each one, I donβt understand this error. What am I doing wrong?
Regards, thank you
David.