[Cmake] Install cleanup

Now a variable is used for the spool file and the installation process
is less verbose.
This commit is contained in:
Davide Berardi 2020-01-31 19:08:24 +01:00
parent 1350a0964c
commit f74176b388
6 changed files with 17 additions and 90 deletions

View File

@ -32,4 +32,7 @@ add_subdirectory(man)
add_subdirectory(src)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/Uninstall.cmake")
"${CMAKE_COMMAND}"
-DCADO_SPOOL_DIR=${CADO_SPOOL_DIR}
-P "${PROJECT_SOURCE_DIR}/Uninstall.cmake"
)

View File

@ -14,12 +14,12 @@ execute_process(COMMAND bash -c "\
-g _cado \
_cado;
fi")
execute_process(COMMAND mkdir -p /usr/local/var/spool/cado)
execute_process(COMMAND chown root:_cado /usr/local/var/spool/cado)
execute_process(COMMAND chmod 4770 /usr/local/var/spool/cado)
execute_process(COMMAND mkdir -p ${CADO_SPOOL_DIR})
execute_process(COMMAND chown root:_cado ${CADO_SPOOL_DIR})
execute_process(COMMAND chmod 4770 ${CADO_SPOOL_DIR})
execute_process(COMMAND chown :_cado ${BINDIR}/scado)
execute_process(COMMAND chmod g+s ${BINDIR}/scado)
execute_process(COMMAND chown _cado: ${BINDIR}/cado)
execute_process(COMMAND chmod u+s ${BINDIR}/cado)
execute_process(COMMAND ldconfig ${LIBDIR})
execute_process(COMMAND ${BINDIR}/cado --setcap)
execute_process(COMMAND bash -c "${BINDIR}/cado --setcap >/dev/null 2>&1")

View File

@ -31,11 +31,11 @@ if(${remove_user})
message(FATAL_ERROR "Failed to remove user: '_cado'.")
endif()
message(STATUS "Removing folder: '/usr/local/var/spool/cado'")
message(STATUS "Removing folder: '${CADO_SPOOL_DIR}'")
execute_process(
COMMAND bash "-c" "rm -r /usr/local/var/spool/cado"
COMMAND bash "-c" "rm -r ${CADO_SPOOL_DIR}"
OUTPUT_VARIABLE remove_spool_folder
)
if("${remove_spool_folder}")
message(FATAL_ERROR "Failed to remove folder: '/usr/local/var/spool/cado'.")
message(FATAL_ERROR "Failed to remove folder: '${CADO_SPOOL_DIR}'.")
endif()

View File

@ -2,8 +2,10 @@
#ifndef _CADO_PATHS_H
#define _CADO_PATHS_H
#include <config.h>
/* Spool directory path */
#define SPOOL_DIR "/usr/local/var/spool/cado"
#define SPOOL_DIR CADO_SPOOL_DIR
/* Cado temporary exe directory path */
#define CADO_EXE_DIR "/tmp"

View File

@ -1,84 +1,5 @@
/* default editor */
#cmakedefine EDITOR "/usr/bin/vi"
/* Define to 1 if you have the <execs.h> header file. */
#cmakedefine HAVE_EXECS_H 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
/* Define to 1 if you have the `execs' library (-lexecs). */
#cmakedefine HAVE_LIBEXECS 1
/* Define to 1 if you have the `mhash' library (-lmhash). */
#cmakedefine HAVE_LIBMHASH 1
/* Define to 1 if you have the <mhash.h> header file. */
#cmakedefine HAVE_MHASH_H 1
/* Define to 1 if you have the <security/pam_appl.h> header file. */
#cmakedefine HAVE_SECURITY_PAM_APPL_H 1
/* Define to 1 if you have the <security/pam_misc.h> header file. */
#cmakedefine HAVE_SECURITY_PAM_MISC_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#cmakedefine HAVE_STRDUP 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the `strtoull' function. */
#cmakedefine HAVE_STRTOULL 1
/* Define to 1 if you have the <sys/capability.h> header file. */
#cmakedefine HAVE_SYS_CAPABILITY_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Name of package */
#cmakedefine PACKAGE "cado"
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine PACKAGE_BUGREPORT "info@v2.cs.unibo.it"
/* Define to the full name of this package. */
#cmakedefine PACKAGE_NAME "cado"
/* Define to the full name and version of this package. */
#cmakedefine PACKAGE_STRING "cado 0.9.2"
/* Define to the one symbol short name of this package. */
#cmakedefine PACKAGE_TARNAME "cado"
/* Define to the version of this package. */
#cmakedefine PACKAGE_VERSION "0.9.2"
/* Version number of package */
#cmakedefine VERSION "0.9.2"
/* Define to `int' if <sys/types.h> doesn't define. */
#cmakedefine gid_t
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine pid_t
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine ssize_t
/* Define to `int' if <sys/types.h> doesn't define. */
#cmakedefine uid_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#cmakedefine uint64_t
/* SPOOL Directory for scado */
#cmakedefine CADO_SPOOL_DIR "@CADO_SPOOL_DIR@"

View File

@ -40,6 +40,7 @@ if(NOT DEBUILD)
COMMAND ${CMAKE_COMMAND}
-DBINDIR=${CMAKE_INSTALL_FULL_BINDIR}
-DLIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
-DCADO_SPOOL_DIR=${CADO_SPOOL_DIR}
-P ${PROJECT_SOURCE_DIR}/PostInstall.cmake
)"
)