Skip to content

Commit

Permalink
cmake: don't hard-code absolute path name /etc
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
jktjkt authored and michalvasko committed Apr 9, 2024
1 parent e35c5b9 commit a349281
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit a349281

Please sign in to comment.