From fcaf2115010d438691775119b0b37719a3252838b8ebb165f798bfbc7e0f5a08 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Sun, 1 Aug 2010 15:15:11 +0000 Subject: [PATCH] Updating link to change in openSUSE:Factory/pulseaudio revision 64.0 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=c0265568f84d09386e2e41bdcfff9a6c --- pulseaudio.changes | 12 +++++ pulseaudio.spec | 2 +- setup-pulseaudio | 107 +++++++++++++++++++++++++++------------------ 3 files changed, 77 insertions(+), 44 deletions(-) diff --git a/pulseaudio.changes b/pulseaudio.changes index e1a6578..1ee5b10 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Jul 20 18:41:58 CEST 2010 - tiwai@suse.de + +- set up sh/csh profiles instead of /etc/environment in + setup-pulseaudio script (bnc#623837) + +------------------------------------------------------------------- +Tue Jul 20 18:20:35 CEST 2010 - tiwai@suse.de + +- Add speechd setup to setup-pulseaudio (bnc#619859) +- Use grep -q for testing in setup-pulseaudio + ------------------------------------------------------------------- Sat May 15 11:07:54 UTC 2010 - coolo@novell.com diff --git a/pulseaudio.spec b/pulseaudio.spec index ac5ae03..e43b2b4 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -22,7 +22,7 @@ Name: pulseaudio Summary: A Networked Sound Server Version: 0.9.21 -Release: 7 +Release: 12 License: GPLv2+ ; LGPLv2.1+ Group: System/Sound Daemons Source: %{name}-%{version}.tar.bz2 diff --git a/setup-pulseaudio b/setup-pulseaudio index d9db659..ff5c908 100644 --- a/setup-pulseaudio +++ b/setup-pulseaudio @@ -25,24 +25,49 @@ check_root() { fi } +PROFNAME=/etc/profile.d/pulseaudio.sh +CPROFNAME=/etc/profile.d/pulseaudio.csh + +set_variable () { + if test -f $PROFNAME && + grep -q "export $1"= $PROFNAME; then + sed -ie "s|export $1=.*|export $1=$2|g" $PROFNAME + else + echo "export $1=$2" >> $PROFNAME + fi + if test -f $CPROFNAME && + grep -q "setenv $1 " $CPROFNAME; then + sed -ie "s|setenv $1 .*|setenv $1 $2|g" $CPROFNAME + else + echo "setenv $1 $2" >> $CPROFNAME + fi +} + +delete_variable () { + if test -f $PROFNAME && + grep -q "export $1"= $PROFNAME; then + sed -ie "/export $1=.*/d" $PROFNAME + fi + if test -f $CPROFNAME && + grep -q "setenv $1 " $CPROFNAME; then + sed -ie "/setenv $1 .*/d" $CPROFNAME + fi +} + enable_phonon() { echo "Enabling PulseAudio for Phonon..." - perl -pi -e "s|PHONON_PULSEAUDIO_DISABLE=1||g;" /etc/environment + delete_variable PHONON_PULSEAUDIO_DISABLE } enable_alsa() { echo "Enabling PulseAudio for ALSA..." - if grep "ALSA_CONFIG_PATH" /etc/environment; then - echo "PulseAudio config for ALSA already in use" - else - echo "ALSA_CONFIG_PATH=/etc/alsa-pulse.conf" >> /etc/environment - fi + set_variable ALSA_CONFIG_PATH /etc/alsa-pulse.conf } enable_libao() { echo "Enabling PulseAudio for libao..." if test -f /etc/libao.conf; then - if grep "default_driver=pulse" /etc/libao.conf; then + if grep -q "default_driver=pulse" /etc/libao.conf; then echo "Default driver is pulse already in /etc/libao.conf" else echo "default_driver=pulse" >> /etc/libao.conf @@ -65,6 +90,17 @@ enable_mplayer() { # FIXME: mplayerplug-in uses $HOME/.mplayer/mplayerplug-in.conf } +enable_speechd() { + echo "Enabling PulseAudio for speech dispatcher..." + if test -f /etc/speech-dispatcher/speechd.conf; then + if grep -q 'AudioOutputMethod' /etc/speech-dispatcher/speechd.conf; then + perl -pi -e "s|^.*AudioOutputMethod .*|AudioOutputMethod \"pulse\"|g;" /etc/speech-dispatcher/speechd.conf + else + echo "AudioOutputMethod \"pulse\"" >> /etc/speech-dispatcher/speechd.conf + fi + fi +} + enable_openal() { # nothing to do here. openal-soft is patched to prefer pulse but # it won't autostart the daemon. @@ -72,16 +108,12 @@ enable_openal() { } enable_oss() { - # this is broken. /etc/environment must only contain environment - # variables. It's not a shell script - return 0 - echo "Enabling PulseAudio for OSS..." for app in $LIST_OF_OSS_APPS; do - if grep "alias $app=padsp $app" /etc/environment; then + if grep -q "alias $app='padsp $app'" $PROFNAME; then echo "Application $app already setup for PulseAudio" else - echo "alias $app=padsp $app" >> /etc/environment + echo "alias $app='padsp $app'" >> $PROFNAME fi done } @@ -89,24 +121,16 @@ enable_oss() { enable_sdl() { echo "Enabling PulseAudio for SDL..." # For SDL, we just add an environment variable, so that apps use the PA audio driver - if grep SDL_AUDIODRIVER /etc/environment; then - echo "SDL already setup to use PulseAudio" - else - echo "SDL_AUDIODRIVER=pulse" >> /etc/environment - fi + set_variable SDL_AUDIODRIVER pulse } enable_timidity() { - # this is broken. /etc/environment must only contain environment - # variables. It's not a shell script - return 0 - echo "Enabling PulseAudio for Timidity..." # Use esound output for timidity - if grep "alias timidity=timidity -Oe" /etc/environment; then + if grep -q "alias timidity='timidity -Oe'" $PROFNAME; then echo "Timidity already setup for using PulseAudio" else - echo "alias timidity=timidity -Oe" >> /etc/environment + echo "alias timidity='timidity -Oe'" >> $PROFNAME fi } @@ -127,16 +151,12 @@ enable_autospawn() { disable_alsa() { echo "Disabling PulseAudio for ALSA..." - perl -pi -e "s|ALSA_CONFIG_PATH=/etc/alsa-pulse.conf||g;" /etc/environment + delete_variable ALSA_CONFIG_PATH } disable_phonon() { echo "Disabling PulseAudio for Phonon..." - if grep "PHONON_PULSEAUDIO_DISABLE" /etc/environment; then - echo "PulseAudio config for Phonon already in use" - else - echo "PHONON_PULSEAUDIO_DISABLE=1" >> /etc/environment - fi + set_variable PHONON_PULSEAUDIO_DISABLE 1 } disable_libao() { @@ -153,6 +173,15 @@ disable_mplayer() { fi } +disable_speechd() { + echo "Disabling PulseAudio for speech dispatcher..." + if test -f /etc/speech-dispatcher/speechd.conf; then + if grep -q 'AudioOutputMethod' /etc/speech-dispatcher/speechd.conf; then + perl -pi -e "s|^.*AudioOutputMethod .*|#AudioOutputMethod \"pulse\"|g;" /etc/speech-dispatcher/speechd.conf + fi + fi +} + disable_openal() { # nothing to do here. openal-soft is patched to prefer pulse but # it won't autostart the daemon. @@ -160,29 +189,19 @@ disable_openal() { } disable_oss() { - # this is broken. /etc/environment must only contain environment - # variables. It's not a shell script - return 0 - for app in $LIST_OF_OSS_APPS; do - perl -pi -e "s|alias $app=padsp $app||g;" /etc/environment + perl -pi -e "s|alias $app='padsp $app'||g;" $PROFNAME done } disable_sdl() { echo "Disabling PulseAudio for SDL..." - if grep "SDL_AUDIODRIVER=pulse" /etc/environment; then - perl -pi -e "s|SDL_AUDIODRIVER=pulse||g;" /etc/environment - fi + delete_variable SDL_AUDIODRIVER } disable_timidity() { - # this is broken. /etc/environment must only contain environment - # variables. It's not a shell script - return 0 - echo "Disabling PulseAudio for Timidity..." - perl -pi -e "s|alias timidity=timidity -Oe||g;" /etc/environment + perl -pi -e "s|alias timidity='timidity -Oe'||g;" $PROFNAME } disable_xine() { @@ -214,6 +233,7 @@ case $1 in enable_xine enable_autospawn enable_phonon + enable_speechd ;; --disable) check_root || exit @@ -228,6 +248,7 @@ case $1 in disable_xine disable_autospawn disable_phonon + disable_speechd ;; --status) STATUS=`grep PULSEAUDIO_ENABLE /etc/sysconfig/sound | cut -f2 -d= | cut -f2 -d\"`