Hello community,

here is the log from the commit of package pulseaudio for openSUSE:Factory
checked in at Mon Jul 25 08:44:23 CEST 2011.



--------
--- pulseaudio/pulseaudio.changes       2011-03-21 14:51:53.000000000 +0100
+++ /mounts/work_src_done/STABLE/pulseaudio/pulseaudio.changes  2011-07-22 
18:04:56.000000000 +0200
@@ -1,0 +2,25 @@
+Fri Jul 22 17:23:07 CEST 2011 - vu...@opensuse.org
+
+- Automatically configure the system for pulseaudio in %post:
+  + Note that this change will forcefully enable PulseAudio on
+    systems where it had manually been disabled with
+    "setup-pulseaudio --disable" but without adding
+    PULSEAUDIO_ENABLE="no" to /etc/sysconfig/sound.
+  + Install sysconfig.sound-pulseaudio template, and use fillup in
+    %post to merge it in /etc/sysconfig/sound. Add %fillup_prereq
+    PreReq for this.
+  + This defines the PULSEAUDIO_ENABLE variable that can be set to
+    "yes", "no", "custom" (which means that the user has manually
+    changed the configuration). Set to "yes" by default.
+  + Add --auto option setup-pulseaudio: this automatically
+    enables (resp. disables) pulseaudio if PULSEAUDIO_ENABLE is set
+    to "yes" (resp. "no"). It does nothing if PULSEAUDIO_ENABLE is
+    set to "custom".
+  + Call "setup-pulseaudio --auto" in %post.
+  + This fixes bnc#707703.
+- Remove call to /sbin/SuSEconfig in setup-pulseaudio: it should
+  not be needed.
+- Use sed instead of perl in setup-pulseaudio: this avoids leaving
+  empty lines when removing a line from the configuration.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  sysconfig.sound-pulseaudio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pulseaudio.spec ++++++
--- /var/tmp/diff_new_pack.crOeO4/_old  2011-07-25 08:42:48.000000000 +0200
+++ /var/tmp/diff_new_pack.crOeO4/_new  2011-07-25 08:42:48.000000000 +0200
@@ -22,12 +22,13 @@
 Name:           pulseaudio
 Summary:        A Networked Sound Server
 Version:        0.9.22
-Release:        9
+Release:        10
 License:        GPLv2+ ; LGPLv2.1+
 Group:          System/Sound Daemons
 Source:         %{name}-%{version}.tar.bz2
 Source1:        default.pa-for-gdm
 Source2:        setup-pulseaudio
+Source3:        sysconfig.sound-pulseaudio
 Source99:       baselibs.conf
 Patch0:         disabled-start.diff
 # PATCH-FIX-UPSTREAM bnc666350-fix-incorrect-check-of-return-value.patch 
sree...@novell.com -- fix to correctly report realtime status
@@ -58,6 +59,7 @@
 BuildRequires:  translation-update-upstream
 BuildRequires:  update-desktop-files
 BuildRequires:  xorg-x11-devel
+PreReq:         %fillup_prereq
 PreReq:         pwdutils
 Recommends:     alsa-plugins-pulse
 Recommends:     %{name}-lang
@@ -273,6 +275,8 @@
 %find_lang %{name}
 install %SOURCE2 $RPM_BUILD_ROOT%{_bindir}
 chmod 755 $RPM_BUILD_ROOT%{_bindir}/setup-pulseaudio
+install -d $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates
+install -m 0644 %SOURCE3 %{buildroot}%{_localstatedir}/adm/fillup-templates
 mkdir -p $RPM_BUILD_ROOT/etc/profile.d
 touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.sh
 touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.csh
@@ -301,7 +305,11 @@
 
 %postun -n libpulse-browse0 -p /sbin/ldconfig
 
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+%{fillup_only -an sound}
+# Update the /etc/profile.d/pulseaudio.* files
+setup-pulseaudio --auto > /dev/null
 
 %postun -p /sbin/ldconfig
 
@@ -318,6 +326,7 @@
 # created by setup-pulseaudio script
 %ghost /etc/profile.d/pulseaudio.sh
 %ghost /etc/profile.d/pulseaudio.csh
+%{_localstatedir}/adm/fillup-templates/sysconfig.sound-pulseaudio
 %dir %{_libdir}/pulse-%{drvver}/
 %dir %{_libdir}/pulse-%{drvver}/modules/
 %{_libdir}/libpulsecore-%{drvver}.so

++++++ setup-pulseaudio ++++++
--- /var/tmp/diff_new_pack.crOeO4/_old  2011-07-25 08:42:48.000000000 +0200
+++ /var/tmp/diff_new_pack.crOeO4/_new  2011-07-25 08:42:48.000000000 +0200
@@ -3,11 +3,12 @@
 LIST_OF_OSS_APPS="aumix sox"
 
 show_help() {
-    echo "setup-pulseaudio [ --enable | --disable | --status ]"
+    echo "setup-pulseaudio [ --enable | --disable | --auto | --status ]"
     echo ""
     echo "Modifies configuration files of some applications for PulseAudio"
     echo "  --enable   Enables PulseAudio"
     echo "  --disable  Disables PulseAudio"
+    echo "  --auto     Automatically enables/disables PulseAudio based on 
configuration"
     echo "  --status   Shows activation state (disabled or enabled) for 
PulseAudio"
     echo ""
     echo "You need to be root for this command to succeed"
@@ -98,7 +99,7 @@
     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
+            sed -i -e "s|^.*AudioOutputMethod .*|AudioOutputMethod 
\"pulse\"|g" /etc/speech-dispatcher/speechd.conf
        else
             echo "AudioOutputMethod \"pulse\"" >> 
/etc/speech-dispatcher/speechd.conf
        fi
@@ -158,7 +159,7 @@
 enable_autospawn() {
     echo "Enabling PulseAudio autospawn..."
     if grep -q ^autospawn /etc/pulse/client.conf; then
-       perl -pi -e "s|^autospawn.*|autospawn = yes|g;" /etc/pulse/client.conf
+       sed -i -e "s|^autospawn.*|autospawn = yes|g" /etc/pulse/client.conf
     else
        echo "autospawn = yes" >> /etc/pulse/client.conf
     fi
@@ -177,7 +178,7 @@
 disable_libao() {
     if test -f /etc/libao.conf; then
        echo "Disabling PulseAudio for libao..."
-       perl -pi -e "s|default_driver=pulse||g;" /etc/libao.conf
+       sed -i -e "/default_driver=pulse/d" /etc/libao.conf
     fi
 }
 
@@ -193,7 +194,7 @@
     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
+            sed -i -e "s|^.*AudioOutputMethod .*|#AudioOutputMethod 
\"pulse\"|g" /etc/speech-dispatcher/speechd.conf
        fi
     fi
 }
@@ -206,7 +207,7 @@
 
 disable_oss() {
     for app in $LIST_OF_OSS_APPS; do
-       perl -pi -e "s|alias $app='padsp $app'||g;" $PROFNAME
+       sed -i -e "/alias $app='padsp $app'/d" $PROFNAME
     done
 }
 
@@ -217,7 +218,7 @@
 
 disable_timidity() {
     echo "Disabling PulseAudio for Timidity..."
-    perl -pi -e "s|alias timidity='timidity -Oe'||g;" $PROFNAME
+    sed -i -e "/alias timidity='timidity -Oe'/d" $PROFNAME
 }
 
 disable_xine() {
@@ -238,44 +239,66 @@
 disable_autospawn() {
     echo "Disabling PulseAudio autospawn..."
     if grep -q ^autospawn /etc/pulse/client.conf; then
-       perl -pi -e "s|^autospawn.*|autospawn = no|g;" /etc/pulse/client.conf
+       sed -i -e "s|^autospawn.*|autospawn = no|g" /etc/pulse/client.conf
     else
        echo "autospawn = no" >> /etc/pulse/client.conf
     fi
 }
 
+enable_all() {
+    enable_alsa
+    enable_libao
+    enable_mplayer
+    enable_openal
+    enable_oss
+    enable_sdl
+    enable_timidity
+    enable_xine
+    enable_festival
+    enable_autospawn
+    enable_phonon
+    enable_speechd
+}
+
+disable_all() {
+    disable_alsa
+    disable_libao
+    disable_mplayer
+    disable_openal
+    disable_oss
+    disable_sdl
+    disable_timidity
+    disable_xine
+    disable_festival
+    disable_autospawn
+    disable_phonon
+    disable_speechd
+}
+
 case $1 in
     --enable)
        check_root || exit
        ENABLE=1
-       enable_alsa
-       enable_libao
-       enable_mplayer
-       enable_openal
-       enable_oss
-       enable_sdl
-       enable_timidity
-       enable_xine
-       enable_festival
-       enable_autospawn
-       enable_phonon
-       enable_speechd
+        enable_all
        ;;
     --disable)
        check_root || exit
        ENABLE=0
-       disable_alsa
-       disable_libao
-       disable_mplayer
-       disable_openal
-       disable_oss
-       disable_sdl
-       disable_timidity
-       disable_xine
-       disable_festival
-       disable_autospawn
-       disable_phonon
-       disable_speechd
+        disable_all
+       ;;
+    --auto)
+       check_root || exit
+       if [ -f /etc/sysconfig/sound ]; then
+           . /etc/sysconfig/sound
+       fi
+       if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
+           enable_all
+       elif [ "x$PULSEAUDIO_ENABLE" = "xcustom" ]; then
+            echo "Custom configuration detected, doing nothing."
+        else
+           disable_all
+       fi
+       exit
        ;;
     --status)
        if [ -f /etc/sysconfig/sound ]; then
@@ -283,6 +306,8 @@
        fi
        if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
            echo "enabled"
+       elif [ "x$PULSEAUDIO_ENABLE" = "xcustom" ]; then
+            echo "custom configured"
        else
            echo "disabled"
        fi
@@ -296,9 +321,9 @@
 # Now, update /etc/sysconfig/sound with the PA status
 if grep -q PULSEAUDIO_ENABLE /etc/sysconfig/sound; then
     if [  "x$ENABLE" = "x1" ]; then
-       perl -pi -e "s|PULSEAUDIO_ENABLE=\"no\"|PULSEAUDIO_ENABLE=\"yes\"|g;" 
/etc/sysconfig/sound
+       sed -i -e "s|PULSEAUDIO_ENABLE=\"no\"|PULSEAUDIO_ENABLE=\"yes\"|g" 
/etc/sysconfig/sound
     else
-       perl -pi -e "s|PULSEAUDIO_ENABLE=\"yes\"|PULSEAUDIO_ENABLE=\"no\"|g;" 
/etc/sysconfig/sound
+       sed -i -e "s|PULSEAUDIO_ENABLE=\"yes\"|PULSEAUDIO_ENABLE=\"no\"|g" 
/etc/sysconfig/sound
     fi
 else
     if [ "x$ENABLE" = "x1" ]; then
@@ -307,5 +332,3 @@
        echo "PULSEAUDIO_ENABLE=\"no\"" >> /etc/sysconfig/sound
     fi
 fi
-
-/sbin/SuSEconfig

++++++ sysconfig.sound-pulseaudio ++++++

## Path:        Hardware/Soundcard/PulseAudio
## Description: PulseAudio configuration
## Type:        list(yes,no,custom)
#
# Enable or disable PulseAudio system. Can be set to "custom" to not have
# scripts automatically change sound-related configuration for PulseAudio.
#
PULSEAUDIO_ENABLE="yes"

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to