Change the structure of installation directories, and move the completion scripts.
This commit is contained in:
parent
a9eba99b98
commit
ab71c08085
|
@ -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")
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue