Last-Update: 2021-09-13
Forwarded: no
Bug-Upstream: https://github.com/pvpgn/pvpgn-server/issues/281
Bug-Upstream: https://github.com/pvpgn/pvpgn-server/issues/467
Author: Dmitry Smirnov <onlyjob@debian.org>
Description: install "/etc" and "/var" and man pages where they belong.
 https://cmake.org/cmake/help/latest/command/install.html
 https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

--- a/cmake/Modules/DefineInstallationPaths.cmake
+++ b/cmake/Modules/DefineInstallationPaths.cmake
@@ -36,9 +36,9 @@
     FORCE
   )
 else()
   SET(LOCALSTATE_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/var/${APPLICATION_NAME}"
+    "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/${APPLICATION_NAME}"
     CACHE PATH "The ${APPLICATION_NAME} local state install dir (default prefix/var)"
     FORCE
   )
 endif()
@@ -70,9 +70,9 @@
     FORCE
   )
 else()
   SET(SYSCONF_INSTALL_DIR
-    "${EXEC_INSTALL_PREFIX}/etc/${APPLICATION_NAME}"
+    "${CMAKE_INSTALL_SYSCONFDIR}/${APPLICATION_NAME}"
     CACHE PATH "The ${APPLICATION_NAME} sysconfig install dir (default prefix/etc)"
     FORCE
   )
 endif()
\ No newline at end of file
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -1,4 +1,7 @@
-install(FILES bnbot.1 bnchat.1 bnetd.1 bnetd.conf.5 bnftp.1 bni2tga.1 
+install(FILES bnbot.1 bnchat.1 bnetd.1 bnftp.1 bni2tga.1 
     bnibuild.1 bniextract.1 bnilist.1 bnpass.1 bnpcap.1 bnproxy.1 bnstat.1 
-    bntext.5 bntrackd.1 tgainfo.1
-    DESTINATION ${MANDIR})
+    bntrackd.1 tgainfo.1
+    DESTINATION ${MAN_INSTALL_DIR}/man1)
+
+install(FILES bnetd.conf.5 bntext.5
+    DESTINATION ${MAN_INSTALL_DIR}/man5)
