Commit 0de9373d authored by Vitaly Lipatov's avatar Vitaly Lipatov

eepm.spec: move install to Makefile, drop cerv alias

parent 462c6fdd
installd_list = pack.d repack.d prescription.d play.d
cmd_list = epm serv yum
.PHONY: all clean install check install_common install_epm install_serv install_yum $(installd_list) $(cmd_list)
.PHONY: all clean install check install_common $(installd_list) $(cmd_list)
pkgdatadir=$(datadir)/eepm
install: install_common install_epm install_serv install_yum $(installd_list) $(cmd_list)
install: install_common $(installd_list) $(cmd_list)
install_common:
mkdir -p $(DESTDIR)$(bindir)/
......@@ -27,6 +27,16 @@ install_common:
mkdir -p $(DESTDIR)$(mandir)/man1
cp -a `ls -1 man/*` $(DESTDIR)$(mandir)/man1/
mkdir -p $(DESTDIR)$(sysconfdir)/bash_completion.d/
install -m 0644 bash_completion/serv $(DESTDIR)$(sysconfdir)/bash_completion.d/serv
# shebang.req.files
chmod a+x $(DESTDIR)$(pkgdatadir)/{serv-,epm-}*
chmod a+x $(DESTDIR)$(pkgdatadir)/tools_*
mkdir -p $(DESTDIR)/var/lib/eepm/
$(cmd_list):
sed -e "s|SHAREDIR=.*|SHAREDIR=$(pkgdatadir)|g" \
-e "s|CONFIGDIR=.*|CONFIGDIR=$(sysconfdir)/eepm|g" \
......
# cerv(8) completion
# This completes on a list of all available services for the
# 'cerv' command, followed by that script's available commands
#
_service_list()
{
COMPREPLY=( $( cerv list-all 2>/dev/null ; echo "list list-all list-startup" ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
_service_usage_list()
{
local USLIST=$(cerv ${prev##*/} usage 2>/dev/null | sed -e "y/|/ /" -ne "s/^.*\(u\|U\|msg_u\)sage.*{\(.*\)}.*$/\2/p")
COMPREPLY=( $( compgen -W '$USLIST' -- "$cur" ) )
}
_cerv()
{
local cur prev
COMPREPLY=()
_get_comp_words_by_ref cur prev
# don't complete for things like killall, ssh and mysql if it's
# the standalone command, rather than the init script
[[ ${COMP_WORDS[0]} != "cerv" ]] && return 0
# don't complete past 2nd token
[ $COMP_CWORD -gt 2 ] && return 0
if [[ $COMP_CWORD -eq 1 && $prev == "cerv" ]]; then
_service_list
else
_service_usage_list
fi
return 0
} &&
complete -F _cerv cerv
serv
\ No newline at end of file
......@@ -81,16 +81,6 @@ This package contains yum like frontend for Etersoft EPM package manager.
datadir=%_datadir bindir=%_bindir mandir=%_mandir \
sysconfdir=%_sysconfdir version=%version-%release
mkdir -p %buildroot%_sysconfdir/bash_completion.d/
install -m 0644 bash_completion/serv %buildroot%_sysconfdir/bash_completion.d/serv
install -m 0644 bash_completion/cerv %buildroot%_sysconfdir/bash_completion.d/cerv
# shebang.req.files
chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
chmod a+x %buildroot%_datadir/%name/tools_*
mkdir -p %buildroot/var/lib/eepm/
%if "%pkgsystem" == "yum-rpm"
rm -v %buildroot%_bindir/yum
%endif
......@@ -113,7 +103,6 @@ rm -v %buildroot%_bindir/yum
%_bindir/epm*
%_bindir/eepm
%_bindir/serv
%_bindir/cerv
%if "%pkgsystem" != "yum-rpm"
%exclude %_bindir/yum
%endif
......@@ -122,7 +111,6 @@ rm -v %buildroot%_bindir/yum
%_man1dir/*
%_datadir/%name/
%_sysconfdir/bash_completion.d/serv
%_sysconfdir/bash_completion.d/cerv
%if "%_vendor" == "alt"
%files repack
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment