CPack RPM change file ownership

I need to add a file to my project package to perform network configuration using NetworkManager (RHEL). The requirements for this file are that it be owned by root, not writable by group/other, and executable.

I know I can set the permissions with the install command, but how do I change owner? If I were writing the spec file, this would be a simple %attr(755, root, root) command, but CPack doesn’t seem to (obviously) support that.

Am I missing something?

maybe it’s a non-issue, because apparently, yum installs files owned by root by default, but it begs the question if I wanted other files not owned by root, how would I do that?

For RPM you can try to set CPACK_RPM_USER_FILELIST
cf: https://cmake.org/cmake/help/v3.19/cpack_gen/rpm.html#cpack_gen:CPack%20RPM%20Generator

Perfect. Thank you. I’m pretty sure I read through that whole page but just failed to comprehend that variable.

No problem.
Documentation patch/contribution is accepted too :smiley:

the sad part is, I already had it in my CMakeLists.txt file, but just for the %config directives.