install(... TYPE SYSCONF) doesn't create Apt Configuration Files
I'm struggling to make an Apt package from a C++ project. The general build is fine, as it the general "shape" of packaging. However, I'm trying to put a configuration file for my app in /etc/myapp/myapp.conf
. I can do this as a regular file, or as a TYPE SYSCONF
file, but in both cases, the result is a regular file in the Apt package - NOT a "configuration file". A regular file gets overwritten when the package is upgraded/re-installed, even if it has been modified, whereas a configuration file does not.
In my CMakeLists.txt
I have the following:
set(CMAKE_INSTALL_SYSCONFDIR "/etc/myapp")
install(FILES "${PROJECT_SOURCE_DIR}/share/myapp.config" TYPE SYSCONF)
I have also tried:
set(CMAKE_INSTALL_SYSCONFDIR "/etc/myapp")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/share/" TYPE SYSCONF)
...and...
install(DIRECTORY "${PROJECT_SOURCE_DIR}/share/" DESTINATION "/etc/myapp/")
In all three cases, the outcome appears to be the same - /etc/myapp/myapp.conf
is created on the target system, but is overwritten, even though it contains changes, when the package is upgraded/re-installed. I have verified that no "conffiles" exist, because there is no /var/lib/dpkg/info/mypackage.conffile
(but there is /var/lib/dpkg/info/mypackage.list
).
What am I doing wrong here, or is what I'm looking to do not possible?