[CMake] [CPACK] [RPM] Using %if in %file section

Luc J. Bourhis luc_j_bourhis at mac.com
Thu May 14 12:50:52 EDT 2015


Ok, sorry, I used the online nabble interface to cmake mailing list actually
but here is my original message without any formatting, after the marker
-----. I'll take the opportunity to explain the rationales. I found out that
the time spent by CPack running rpmbuild is only a very small portion of the
total runtime and I need to build the same package on different platforms.
So I thought of simply running CPack once and then copying over the
_CPack_Packages/... directory and run rpmbuild directly.

---------------

I would like to end up with the following in the specs file: 

...
%file
...
%if 0%{fedora} >= 14
"/path/to/some/file"
%endif

I tried to use CPACK_RPM_USER_FILELIST as 

set(CPACK_RPM_USER_FILELIST ${CPACK_RPM_USER_FILELIST}
    "%if 0%{fedora} >= 14"
    "/path/to/some/file"
    "%endif"
)

but this results in 

%if "0%{fedora} >= 14"
"/path/to/some/file"
%endif "%endif"
which is not quite right. 

Is there something I am missing? Or is it a fundamental limitation of CPack
RPM generator? If so, would there be any workaround? Thanks in advance for
any help.




-----
--
Luc J. Bourhis

--
View this message in context: http://cmake.3232098.n2.nabble.com/CPACK-RPM-Using-if-in-file-section-tp7590576p7590586.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list