Use the /usr directory instead of /opt.

This commit is contained in:
Username404 2021-03-24 13:18:17 +01:00
parent fe1cf70770
commit 40ff865489
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
4 changed files with 11 additions and 9 deletions

View File

@ -78,12 +78,13 @@ target_compile_definitions(ybcon PRIVATE YBCON_VERSION="${CODENAME} ${PROJECT_VE
set(PNAME ${PROJECT_NAME}-${CODENAME}-${TIME}) set(PNAME ${PROJECT_NAME}-${CODENAME}-${TIME})
if (UNIX AND NOT MINGW) if (UNIX AND NOT MINGW)
include(GNUInstallDirs) include(GNUInstallDirs)
set(CMAKE_INSTALL_PREFIX "/opt") set(CMAKE_INSTALL_PREFIX "/usr")
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
set(CPACK_PACKAGE_FILE_NAME "${PNAME}_lpkg") set(CPACK_PACKAGE_FILE_NAME "${PNAME}_lpkg")
set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE) set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/scripts/postinst") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scripts/postinst" "processed/postinst" @ONLY)
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}) set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/processed/postinst")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libstdc++6 (>= 9)") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libstdc++6 (>= 9)")
set(CPACK_DEBIAN_COMPRESSION_TYPE lzma) set(CPACK_DEBIAN_COMPRESSION_TYPE lzma)
set(CPACK_RPM_COMPRESSION_TYPE lzma) set(CPACK_RPM_COMPRESSION_TYPE lzma)
@ -110,7 +111,7 @@ if (UNIX AND NOT MINGW)
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/completions DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ybcon.d) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/completions DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ybcon.d)
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon
DESTINATION yerbacon/${CMAKE_INSTALL_BINDIR}) DESTINATION ${CMAKE_INSTALL_BINDIR})
endif() endif()
elseif(MINGW OR MSVC) elseif(MINGW OR MSVC)
set(CMAKE_INSTALL_PREFIX "C:\\progs\\${PROJECT_NAME}") set(CMAKE_INSTALL_PREFIX "C:\\progs\\${PROJECT_NAME}")

View File

@ -1 +1 @@
cd ./cmake-build-release/ && clear && ./ybcon -printresult ../examples/HelloWorld.ybcon cd ./cmake-build-release/ && clear && ./ybcon --printresult ../examples/HelloWorld.ybcon

View File

@ -2,8 +2,7 @@
# Post install ybcon script # Post install ybcon script
ybconDir="/opt/share/ybcon.d" ybconDir="@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@/ybcon.d"
ln -sf "/opt/yerbacon/bin/ybcon" "/usr/bin/ybcon"
fishLoc="/usr/share/fish/vendor_completions.d" fishLoc="/usr/share/fish/vendor_completions.d"
bashcompleteLoc="/etc/bash_completion.d" bashcompleteLoc="/etc/bash_completion.d"
zshLoc="/etc/zsh_completion.d" zshLoc="/etc/zsh_completion.d"

View File

@ -4,8 +4,10 @@
EXENAME=ybcon EXENAME=ybcon
# Default location of the executable scriptDir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
defaultBinLocation=/opt/libexec/ybcon
# Location of the executable
defaultBinLocation="$scriptDir/../libexec/ybcon"
usage() { usage() {
if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi