# Keep CPack INSTALL() from generating excess %config directives in RPM Spec file

**URL:** https://discourse.cmake.org/t/keep-cpack-install-from-generating-excess-config-directives-in-rpm-spec-file/7723
**Category:** Usage
**Created:** [March 20, 2023, 3:53pm UTC](https://discourse.cmake.org/t/keep-cpack-install-from-generating-excess-config-directives-in-rpm-spec-file/7723 "2023-03-20T15:53:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wdezell](https://discourse.cmake.org/user_avatar/discourse.cmake.org/wdezell/32/6081_2.png) [@wdezell](https://discourse.cmake.org/u/wdezell)
#### Post date: [March 20, 2023, 3:53pm UTC](https://discourse.cmake.org/t/keep-cpack-install-from-generating-excess-config-directives-in-rpm-spec-file/7723/1 "2023-03-20T15:53:27Z")

</div>

I’ve got a CPack scenario where a combination of INSTALL(DIRECTORY ), INSTALL(PROGRAMS ), and INSTALL(FILES ) are being used to set up creation of a binary RPM. At one point set(CPACK\_RPM\_USER\_FILELIST …) is used to explicitly (and correctly) establish certain files as %config files.

The problem is that a number of non-configuration directories are incorrectly appearing in the GENERATED spec prefixed with %config.

Ex:  
%config “/opt/a/path/that/should/not/be/config”

Upon comparing the generated spec file template (foo.spec.in) to the problematic spec FILE I see that every offending file/directory is coming from the list '@CPACK\_RPM\_ABSOLUTE\_INSTALL\_FILES@‘

Overriding this list prior to Spec file generation would fix my problem but set(CPACK\_RPM\_ABSOLUTE\_INSTALL\_FILES\_LIST “”) doesn’t help. What I really need to do is correctly avoid the problem rather than bandaid the symptom. set(CPACK\_RPM\_EXCLUDE\_FROM\_AUTO\_FILELIST\_ADDITION “/opt/a/path/that/should/not/be/config”) seems to have no effect.

Any suggestions?

Using Make 3.20.0 rc4

Thanks,  
Bill
