From 6d2d6f4c789741a98544d1f068ca2277013d4db4 Mon Sep 17 00:00:00 2001 From: Miloš Jakubíček Date: Apr 08 2008 11:22:29 +0000 Subject: - Using --with-boinc-platform=i686-pc-linux-gnu on i386 instead of --build, --host, --target - Added bash completion script. --- diff --git a/boinc-client b/boinc-client new file mode 100644 index 0000000..9cbb4c3 --- /dev/null +++ b/boinc-client @@ -0,0 +1,99 @@ +# Source this file in bash to get command completion (using tab) +# for boinc_client and boinc_cmd +# Written by Frank S. Thomas + +_boinc_client() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts="$(boinc_client --help | \ + sed -n -r 's/^[[:space:]]*(--[a-z_]*).*/\1/p')" + + # Handle options that require one or more arguments. + case "$prev" in + --attach_project|--detach_project|--reset_project|--update_prefs|\ + --gui_rpc_port) + return 0 + ;; + esac + + # Handle options that require two arguments. + if [[ COMP_CWORD -gt 1 ]]; then + pprev="${COMP_WORDS[COMP_CWORD-2]}" + + case "$pprev" in + --attach_project) + return 0 + ;; + esac + fi + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + return 0 + fi +} +complete -F _boinc_client -o default boinc_client + +_boinc_cmd() +{ + local cur prev opts cmds + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + opts="--host --passwd -h --help -V --version" + cmds="$(boinc_cmd --help 2>&1 | \ + sed -n -r 's/^[[:space:]]*(--[a-z_]*).*/\1/p')" + + # The following construct assures that: + # - no command follows if one of $opts or $cmds was given + # - after --host follows only one command or --passwd and one command + # - after --passwd follows only one command + if [[ $COMP_CWORD -eq 1 ]]; then + COMPREPLY=( $(compgen -W "$opts $cmds" -- "$cur") ) + return 0 + else + if [[ "${COMP_WORDS[@]}" =~ ".* --host .* --passwd .*" ]]; then + if [[ $COMP_CWORD -eq 5 ]]; then + COMPREPLY=( $(compgen -W "$cmds" -- "$cur") ) + fi + elif [[ "${COMP_WORDS[@]}" =~ ".* --passwd .*" ]]; then + if [[ $COMP_CWORD -eq 3 ]]; then + COMPREPLY=( $(compgen -W "$cmds" -- "$cur") ) + fi + elif [[ "${COMP_WORDS[@]}" =~ ".* --host .*" ]]; then + if [[ $COMP_CWORD -eq 3 ]]; then + COMPREPLY=( $(compgen -W "--passwd $cmds" -- "$cur") ) + fi + fi + fi + + # Handle options/commands that require one or more arguments. + case "$prev" in + --get_messages|--passwd) + return 0 + ;; + + --host) + _known_hosts + return 0 + ;; + + --set_run_mode|--set_network_mode) + COMPREPLY=( $(compgen -W "always auto never" -- "$cur") ) + return 0 + ;; + + --set_screensaver_mode) + COMPREPLY=( $(compgen -W "on off" -- "$cur") ) + return 0 + ;; + esac +} +complete -F _boinc_cmd boinc_cmd +# vim: syntax=sh + diff --git a/boinc-client.spec b/boinc-client.spec index 6ddce3f..2f2c4b0 100644 --- a/boinc-client.spec +++ b/boinc-client.spec @@ -4,7 +4,7 @@ Summary: The BOINC client core Name: boinc-client Version: 5.10.45 -Release: 5.%{snap}svn%{?dist} +Release: 6.%{snap}svn%{?dist} License: LGPLv2+ Group: Applications/Engineering URL: http://boinc.berkeley.edu/ @@ -30,6 +30,7 @@ Source7: boincmgr.1 Source8: trim Source9: noexec Source10: unicode +Source11: boinc-client Patch0: boinc-gcc43.patch Patch1: boinc-gccflags.patch @@ -99,7 +100,7 @@ This package contains development files for %{name}. %build %ifarch i386 -%configure --disable-static --enable-unicode --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i686-redhat-linux-gnu +%configure --disable-static --enable-unicode --with-boinc-platform=i686-pc-linux-gnu %else %configure --disable-static --enable-unicode %endif @@ -170,6 +171,10 @@ find $RPM_BUILD_ROOT%{_datadir}/locale -name "BOINC Manager.mo" -execdir mv {} B %find_lang BOINC-Manager +# bash-completion + +install -Dp -m644 %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/boinc-client + %clean rm -rf $RPM_BUILD_ROOT @@ -206,6 +211,7 @@ fi %files %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%config(noreplace) %{_sysconfdir}/bash_completion.d/ %doc COPYING %doc COPYRIGHT %doc checkin_notes @@ -251,6 +257,11 @@ fi %changelog +* Mon Apr 07 2008 Milos Jakubicek - 5.10.45-6.20080315svn +- Using --with-boinc-platform=i686-pc-linux-gnu on i386 instead of --build, + --host, --target +- Added bash completion script. + * Fri Apr 04 2008 Milos Jakubicek - 5.10.45-5.20080315svn - Fixed build on i386 since it needs to be configured as i686-pc-linux-gnu and not i386-pc-linux-gnu.