Change the structure of installation directories, and move the completion scripts.

This commit is contained in:
Username404-59 2021-02-28 19:30:52 +01:00
parent a9eba99b98
commit ab71c08085
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
6 changed files with 9 additions and 19 deletions

View File

@ -65,20 +65,12 @@ if (UNIX AND NOT MINGW)
if (NOT DEFINED CPACK_GENERATOR)
set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB)
endif()
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon
${CMAKE_CURRENT_SOURCE_DIR}/scripts/bash-completion.sh
${CMAKE_CURRENT_SOURCE_DIR}/scripts/fish-completion.fish
${CMAKE_CURRENT_SOURCE_DIR}/scripts/zsh-completion.zsh
install(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/ybcon
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon
PERMISSIONS
OWNER_WRITE
OWNER_EXECUTE
OWNER_READ
WORLD_READ
WORLD_EXECUTE
DESTINATION bin)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/completions DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon
DESTINATION ${CMAKE_INSTALL_BINDIR})
elseif(MINGW OR MSVC)
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_wpkg")

View File

@ -3,25 +3,23 @@
# Post install ybcon script
ybconDir="/opt/etc/ybcon.d"
ln -sf "$ybconDir/ybcon" "/usr/bin/ybcon"
fishLoc="/usr/share/fish/vendor_completions.d"
bashcompleteLoc="/etc/bash_completion.d"
zshLoc="/etc/zsh_completion.d"
if [ -d $bashcompleteLoc ]; then
ln -sf "$ybconDir/bash-completion.sh" "$bashcompleteLoc/ybcon.sh"
ln -sf "$ybconDir/completions/bash-completion.sh" "$bashcompleteLoc/ybcon.sh"
fi
if [ -f "/usr/bin/fish" ]; then
if [ ! -d $fishLoc ]; then
mkdir "$fishLoc"
fi
ln -sf "$ybconDir/fish-completion.fish" "$fishLoc/ybcon.fish"
ln -sf "$ybconDir/completions/fish-completion.fish" "$fishLoc/ybcon.fish"
fi
zshBin="/usr/bin/zsh"
if [ -f $zshBin ]; then
if [ -d $zshLoc ]; then
ln -sf "$ybconDir/zsh-completion.zsh" "$zshLoc/_ybcon"
ln -sf "$ybconDir/completions/zsh-completion.zsh" "$zshLoc/_ybcon"
fi
fi

View File

@ -5,7 +5,7 @@
EXENAME=ybcon
# Default location of the executable
defaultBinLocation=/opt/bin/ybcon
defaultBinLocation=/opt/etc/ybcon.d/ybcon
usage() {
if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi