1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-06 06:30:19 +00:00
freebsd-ports/mail/postsrsd/files/patch-CMakeLists.txt
Kurt Jaeger 3a39651639 mail/postsrsd: 1.1 -> 1.3
Changes:
  https://github.com/roehling/postsrsd/commits/master

PR:		206116
Submitted by:	Krzysztof <ports@bsdserwis.com> (maintainer)
2016-01-18 20:29:11 +00:00

89 lines
4.2 KiB
Plaintext

--- CMakeLists.txt.orig 2015-12-13 08:56:05 UTC
+++ CMakeLists.txt
@@ -4,11 +4,14 @@ include(CheckIncludeFile)
option(GENERATE_SRS_SECRET "Generate a random SRS secret if none exists during install" ON)
option(USE_APPARMOR "Enable AppArmor profile" OFF)
+option(MK_CHROOT_DIR "Chroot jail for daemon" OFF)
+if(MK_CHROOT_DIR)
set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon")
+endif()
set(SYSCONF_DIR "/etc" CACHE PATH "Global system configuration folder")
set(SYSD_UNIT_DIR "${SYSCONF_DIR}/systemd/system" CACHE PATH "Systemd unit file folder")
-set(CONFIG_DIR "${SYSCONF_DIR}/default" CACHE PATH "Location of startup configuration file")
+set(CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "Location of startup configuration file")
set(DOC_DIR "share/doc/${PROJECT_NAME}" CACHE PATH "Path for documentation files")
mark_as_advanced(CHROOT_DIR SYSCONF_DIR SYSD_UNIT_DIR CONFIG_DIR DOC_DIR)
@@ -16,8 +19,6 @@ find_program(HELP2MAN help2man DOC "path
find_program(DD dd DOC "path to dd executable")
find_program(BASE64 base64 DOC "path to base64 executable")
find_program(OPENSSL openssl DOC "path to OpenSSL executable")
-find_program(INSSERV insserv DOC "path to insserv executable")
-find_program(CHKCONFIG chkconfig DOC "path to chkconfig executable")
find_library(LIBSOCKET socket)
find_library(LIBNSL nsl)
@@ -46,26 +47,6 @@ if(HAVE_TIME_H)
add_definitions(-DHAVE_TIME_H)
endif()
-if(NOT DEFINED INIT_FLAVOR)
- if(IS_DIRECTORY "${SYSD_UNIT_DIR}" AND EXISTS "/usr/lib/systemd/systemd")
- message(STATUS "Detected init flavor: systemd")
- set(INIT_FLAVOR "systemd" CACHE STRING "Init daemon of this system")
- elseif(IS_DIRECTORY "${SYSCONF_DIR}/init" AND EXISTS "/lib/init/upstart-job")
- message(STATUS "Detected init flavor: upstart")
- set(INIT_FLAVOR "upstart" CACHE STRING "Init daemon of this system")
- elseif(IS_DIRECTORY "${SYSCONF_DIR}/init.d" AND EXISTS "${SYSCONF_DIR}/init.d/functions")
- message(STATUS "Detected init flavor: sysv-redhat")
- set(INIT_FLAVOR "sysv-redhat" CACHE STRING "Init daemon of this system")
- elseif(IS_DIRECTORY "${SYSCONF_DIR}/init.d" AND EXISTS "/lib/lsb/init-functions")
- message(STATUS "Detected init flavor: sysv-lsb")
- set(INIT_FLAVOR "sysv-lsb" CACHE STRING "Init daemon of this system")
- else()
- message(STATUS "Detected init flavor: none")
- message(STATUS "System startup files will not be installed")
- set(INIT_FLAVOR "" CACHE STRING "Init daemon of this system")
- endif()
-endif()
-
add_executable(${PROJECT_NAME} postsrsd.c sha1.c srs2.c)
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
@@ -74,15 +55,7 @@ endif()
get_target_property(POSTSRSD ${PROJECT_NAME} LOCATION)
get_filename_component(POSTSRSD ${POSTSRSD} NAME_WE)
-set(APPARMOR_PROFILE "${CMAKE_INSTALL_PREFIX}/sbin/${POSTSRSD}")
-string(REGEX REPLACE "^/+" "" APPARMOR_PROFILE "${APPARMOR_PROFILE}")
-string(REPLACE "/" "." APPARMOR_PROFILE "${APPARMOR_PROFILE}")
-configure_file(init/${PROJECT_NAME}.sysv-lsb.in ${PROJECT_NAME}.sysv-lsb @ONLY)
-configure_file(init/${PROJECT_NAME}.sysv-redhat.in ${PROJECT_NAME}.sysv-redhat @ONLY)
-configure_file(init/${PROJECT_NAME}.upstart.in ${PROJECT_NAME}.upstart @ONLY)
-configure_file(init/${PROJECT_NAME}.apparmor.in ${PROJECT_NAME}.apparmor @ONLY)
-configure_file(init/${PROJECT_NAME}.systemd.in ${PROJECT_NAME}.systemd @ONLY)
configure_file(init/${PROJECT_NAME}.default.in ${PROJECT_NAME}.default @ONLY)
configure_file(postinstall.cmake.in postinstall.cmake @ONLY)
@@ -92,7 +65,7 @@ add_custom_command(TARGET ${PROJECT_NAME
COMMAND ${HELP2MAN} ARGS -s8 -o${PROJECT_NAME}.8 -n "Postfix Sender Rewriting Scheme daemon" -N -h-h -v-v ${CMAKE_CURRENT_BINARY_DIR}/${POSTSRSD}
VERBATIM
)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.8 DESTINATION "share/man/man8")
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.8 DESTINATION "man/man8")
endif()
if(USE_APPARMOR)
@@ -100,6 +73,8 @@ if(USE_APPARMOR)
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION "sbin")
+if(ENABLE_DOCS)
install(FILES README.md README_UPGRADE.md main.cf.ex DESTINATION "${DOC_DIR}")
+endif()
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/postinstall.cmake")