From fda11a652b4058105af34d56f5c37e922711ab77 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Tue, 16 Oct 2018 20:20:43 +0300 Subject: [PATCH] Install bash/zsh completions in correct locations --- CMakeLists.txt | 4 ++++ docker-build-centos.sh | 2 ++ docker-build-debian.sh | 2 +- laminarc-completion.bash => etc/laminarc-completion.bash | 0 laminarc-completion.zsh => etc/laminarc-completion.zsh | 0 5 files changed, 7 insertions(+), 1 deletion(-) rename laminarc-completion.bash => etc/laminarc-completion.bash (100%) rename laminarc-completion.zsh => etc/laminarc-completion.zsh (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6906fe8..a35be96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,10 @@ if(BUILD_TESTS) endif() set(SYSTEMD_UNITDIR /lib/systemd/system CACHE PATH "Path to systemd unit files") +set(BASH_COMPLETIONS_DIR usr/share/bash-completion/completions CACHE PATH "Path to bash completions directory") +set(ZSH_COMPLETIONS_DIR usr/share/zsh/site-functions CACHE PATH "Path to zsh completions directory") install(TARGETS laminard laminarc RUNTIME DESTINATION usr/bin) install(FILES laminar.service DESTINATION ${SYSTEMD_UNITDIR}) install(FILES laminar.conf DESTINATION etc) +install(FILES etc/laminarc-completion.bash DESTINATION ${BASH_COMPLETIONS_DIR} RENAME laminarc) +install(FILES etc/laminarc-completion.zsh DESTINATION ${ZSH_COMPLETIONS_DIR} RENAME _laminarc) diff --git a/docker-build-centos.sh b/docker-build-centos.sh index 7fe391c..0367214 100755 --- a/docker-build-centos.sh +++ b/docker-build-centos.sh @@ -66,6 +66,8 @@ make %{_bindir}/laminard %{_unitdir}/laminar.service %config(noreplace) %{_sysconfdir}/laminar.conf +%{_datarootdir}/bash-completion/completions/laminarc +%{_datarootdir}/zsh/site-functions/_laminarc %post echo Creating laminar user with home in %{_sharedstatedir}/laminar diff --git a/docker-build-debian.sh b/docker-build-debian.sh index 8a641c6..8010a80 100755 --- a/docker-build-debian.sh +++ b/docker-build-debian.sh @@ -37,7 +37,7 @@ cmake -DRAPIDJSON_BUILD_EXAMPLES=off . make install cd /build -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ /laminar +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/ -DZSH_COMPLETIONS_DIR=/usr/share/zsh/functions/Completion/Unix /laminar make -j4 mkdir laminar make DESTDIR=laminar install/strip diff --git a/laminarc-completion.bash b/etc/laminarc-completion.bash similarity index 100% rename from laminarc-completion.bash rename to etc/laminarc-completion.bash diff --git a/laminarc-completion.zsh b/etc/laminarc-completion.zsh similarity index 100% rename from laminarc-completion.zsh rename to etc/laminarc-completion.zsh