From a8658ad0d7a3c1a38f066db8a019b06e52d06bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Mon, 8 Apr 2024 12:29:04 +0200 Subject: [PATCH] cmake: don't hard-code absolute path name /etc - this breaks packaging and installation into a prefix in general - there's a GNUInstallDirs variable for /etc, too Also, don't make this installation conditional on the existence of /etc. Whether or not that directory exists on a build system has no meaning for installation to a target system. This had a potential to break cross-compiling. --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec67fc18..d4efb080 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,10 +347,7 @@ if(NP2SRV_HAVE_SYSTEMD) install(FILES ${PROJECT_BINARY_DIR}/netopeer2-server.service DESTINATION ${SYSTEMD_UNIT_DIR}) endif() -# copy pam service to /etc/pam.d -if(EXISTS "/etc/pam.d") - install(FILES "${CMAKE_SOURCE_DIR}/pam/netopeer2.conf" DESTINATION "/etc/pam.d") -endif() +install(FILES "${CMAKE_SOURCE_DIR}/pam/netopeer2.conf" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/pam.d") if(SYSREPO_SETUP) install(CODE "