Marking files as config files in CPack

1.1k views Asked by At

When creating RPM packages: How do I tell CPack to treat a file as config file so it won't get overridden when updating the RPM?

The %config directive is used in rpm-spec for that case. Is there something like this in CPack?

2

There are 2 answers

1
Etan Reisner On BEST ANSWER

A quick look at what appears to be the CPack documentation doesn't show me anything that looks like it is directly relevant or helpful here.

However, if you are using a new enough version of CMake (2.8.1+ it looks like) or apply the patch yourself it looks like you can manually specify the spec file to build by using CPACK_RPM_USER_BINARY_SPECFILE.

0
Mark Jansen On

As of now, files specified with an absolute path will get marked with %config, files with a relative path are marked as 'normal' files.