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)
|
if (NOT DEFINED CPACK_GENERATOR)
|
||||||
set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB)
|
set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB)
|
||||||
endif()
|
endif()
|
||||||
install(FILES
|
install(PROGRAMS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon
|
${CMAKE_CURRENT_BINARY_DIR}/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
|
|
||||||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
|
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/completions DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/ybcon.d)
|
||||||
PERMISSIONS
|
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/ybcon
|
||||||
OWNER_WRITE
|
DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
OWNER_EXECUTE
|
|
||||||
OWNER_READ
|
|
||||||
WORLD_READ
|
|
||||||
WORLD_EXECUTE
|
|
||||||
DESTINATION bin)
|
|
||||||
elseif(MINGW OR MSVC)
|
elseif(MINGW OR MSVC)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}")
|
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_wpkg")
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}_wpkg")
|
||||||
|
|
|
@ -3,25 +3,23 @@
|
||||||
# Post install ybcon script
|
# Post install ybcon script
|
||||||
|
|
||||||
ybconDir="/opt/etc/ybcon.d"
|
ybconDir="/opt/etc/ybcon.d"
|
||||||
ln -sf "$ybconDir/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"
|
||||||
if [ -d $bashcompleteLoc ]; then
|
if [ -d $bashcompleteLoc ]; then
|
||||||
ln -sf "$ybconDir/bash-completion.sh" "$bashcompleteLoc/ybcon.sh"
|
ln -sf "$ybconDir/completions/bash-completion.sh" "$bashcompleteLoc/ybcon.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "/usr/bin/fish" ]; then
|
if [ -f "/usr/bin/fish" ]; then
|
||||||
if [ ! -d $fishLoc ]; then
|
if [ ! -d $fishLoc ]; then
|
||||||
mkdir "$fishLoc"
|
mkdir "$fishLoc"
|
||||||
fi
|
fi
|
||||||
ln -sf "$ybconDir/fish-completion.fish" "$fishLoc/ybcon.fish"
|
ln -sf "$ybconDir/completions/fish-completion.fish" "$fishLoc/ybcon.fish"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
zshBin="/usr/bin/zsh"
|
zshBin="/usr/bin/zsh"
|
||||||
if [ -f $zshBin ]; then
|
if [ -f $zshBin ]; then
|
||||||
if [ -d $zshLoc ]; then
|
if [ -d $zshLoc ]; then
|
||||||
ln -sf "$ybconDir/zsh-completion.zsh" "$zshLoc/_ybcon"
|
ln -sf "$ybconDir/completions/zsh-completion.zsh" "$zshLoc/_ybcon"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
|
@ -5,7 +5,7 @@
|
||||||
EXENAME=ybcon
|
EXENAME=ybcon
|
||||||
|
|
||||||
# Default location of the executable
|
# Default location of the executable
|
||||||
defaultBinLocation=/opt/bin/ybcon
|
defaultBinLocation=/opt/etc/ybcon.d/ybcon
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi
|
if [ "$1" = false ]; then echo "Invalid arguments, usage:"; fi
|
||||||
|
|
Loading…
Reference in New Issue