forked from pool/pulseaudio
Accepting request 76799 from home:vuntz:branches:multimedia:libs
bnc#707703: call setup-pulseaudio in %post OBS-URL: https://build.opensuse.org/request/show/76799 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=68
This commit is contained in:
parent
2e063bd5cb
commit
be7620f0a5
@ -1,3 +1,28 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jul 22 17:23:07 CEST 2011 - vuntz@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.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Mar 21 14:51:21 CET 2011 - tiwai@suse.de
|
Mon Mar 21 14:51:21 CET 2011 - tiwai@suse.de
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ Group: System/Sound Daemons
|
|||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: default.pa-for-gdm
|
Source1: default.pa-for-gdm
|
||||||
Source2: setup-pulseaudio
|
Source2: setup-pulseaudio
|
||||||
|
Source3: sysconfig.sound-pulseaudio
|
||||||
Source99: baselibs.conf
|
Source99: baselibs.conf
|
||||||
Patch0: disabled-start.diff
|
Patch0: disabled-start.diff
|
||||||
# PATCH-FIX-UPSTREAM bnc666350-fix-incorrect-check-of-return-value.patch sreeves@novell.com -- fix to correctly report realtime status
|
# PATCH-FIX-UPSTREAM bnc666350-fix-incorrect-check-of-return-value.patch sreeves@novell.com -- fix to correctly report realtime status
|
||||||
@ -58,6 +59,7 @@ BuildRequires: tcpd-devel
|
|||||||
BuildRequires: translation-update-upstream
|
BuildRequires: translation-update-upstream
|
||||||
BuildRequires: update-desktop-files
|
BuildRequires: update-desktop-files
|
||||||
BuildRequires: xorg-x11-devel
|
BuildRequires: xorg-x11-devel
|
||||||
|
PreReq: %fillup_prereq
|
||||||
PreReq: pwdutils
|
PreReq: pwdutils
|
||||||
Recommends: alsa-plugins-pulse
|
Recommends: alsa-plugins-pulse
|
||||||
Recommends: %{name}-lang
|
Recommends: %{name}-lang
|
||||||
@ -273,6 +275,8 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/*.a
|
|||||||
%find_lang %{name}
|
%find_lang %{name}
|
||||||
install %SOURCE2 $RPM_BUILD_ROOT%{_bindir}
|
install %SOURCE2 $RPM_BUILD_ROOT%{_bindir}
|
||||||
chmod 755 $RPM_BUILD_ROOT%{_bindir}/setup-pulseaudio
|
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
|
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.sh
|
||||||
touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.csh
|
touch $RPM_BUILD_ROOT/etc/profile.d/pulseaudio.csh
|
||||||
@ -301,7 +305,11 @@ groupadd -r pulse-access &>/dev/null || :
|
|||||||
|
|
||||||
%postun -n libpulse-browse0 -p /sbin/ldconfig
|
%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
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
@ -318,6 +326,7 @@ groupadd -r pulse-access &>/dev/null || :
|
|||||||
# created by setup-pulseaudio script
|
# created by setup-pulseaudio script
|
||||||
%ghost /etc/profile.d/pulseaudio.sh
|
%ghost /etc/profile.d/pulseaudio.sh
|
||||||
%ghost /etc/profile.d/pulseaudio.csh
|
%ghost /etc/profile.d/pulseaudio.csh
|
||||||
|
%{_localstatedir}/adm/fillup-templates/sysconfig.sound-pulseaudio
|
||||||
%dir %{_libdir}/pulse-%{drvver}/
|
%dir %{_libdir}/pulse-%{drvver}/
|
||||||
%dir %{_libdir}/pulse-%{drvver}/modules/
|
%dir %{_libdir}/pulse-%{drvver}/modules/
|
||||||
%{_libdir}/libpulsecore-%{drvver}.so
|
%{_libdir}/libpulsecore-%{drvver}.so
|
||||||
|
@ -3,11 +3,12 @@
|
|||||||
LIST_OF_OSS_APPS="aumix sox"
|
LIST_OF_OSS_APPS="aumix sox"
|
||||||
|
|
||||||
show_help() {
|
show_help() {
|
||||||
echo "setup-pulseaudio [ --enable | --disable | --status ]"
|
echo "setup-pulseaudio [ --enable | --disable | --auto | --status ]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Modifies configuration files of some applications for PulseAudio"
|
echo "Modifies configuration files of some applications for PulseAudio"
|
||||||
echo " --enable Enables PulseAudio"
|
echo " --enable Enables PulseAudio"
|
||||||
echo " --disable Disables 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 " --status Shows activation state (disabled or enabled) for PulseAudio"
|
||||||
echo ""
|
echo ""
|
||||||
echo "You need to be root for this command to succeed"
|
echo "You need to be root for this command to succeed"
|
||||||
@ -98,7 +99,7 @@ enable_speechd() {
|
|||||||
echo "Enabling PulseAudio for speech dispatcher..."
|
echo "Enabling PulseAudio for speech dispatcher..."
|
||||||
if test -f /etc/speech-dispatcher/speechd.conf; then
|
if test -f /etc/speech-dispatcher/speechd.conf; then
|
||||||
if grep -q 'AudioOutputMethod' /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
|
else
|
||||||
echo "AudioOutputMethod \"pulse\"" >> /etc/speech-dispatcher/speechd.conf
|
echo "AudioOutputMethod \"pulse\"" >> /etc/speech-dispatcher/speechd.conf
|
||||||
fi
|
fi
|
||||||
@ -158,7 +159,7 @@ EOF
|
|||||||
enable_autospawn() {
|
enable_autospawn() {
|
||||||
echo "Enabling PulseAudio autospawn..."
|
echo "Enabling PulseAudio autospawn..."
|
||||||
if grep -q ^autospawn /etc/pulse/client.conf; then
|
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
|
else
|
||||||
echo "autospawn = yes" >> /etc/pulse/client.conf
|
echo "autospawn = yes" >> /etc/pulse/client.conf
|
||||||
fi
|
fi
|
||||||
@ -177,7 +178,7 @@ disable_phonon() {
|
|||||||
disable_libao() {
|
disable_libao() {
|
||||||
if test -f /etc/libao.conf; then
|
if test -f /etc/libao.conf; then
|
||||||
echo "Disabling PulseAudio for libao..."
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +194,7 @@ disable_speechd() {
|
|||||||
echo "Disabling PulseAudio for speech dispatcher..."
|
echo "Disabling PulseAudio for speech dispatcher..."
|
||||||
if test -f /etc/speech-dispatcher/speechd.conf; then
|
if test -f /etc/speech-dispatcher/speechd.conf; then
|
||||||
if grep -q 'AudioOutputMethod' /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
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -206,7 +207,7 @@ disable_openal() {
|
|||||||
|
|
||||||
disable_oss() {
|
disable_oss() {
|
||||||
for app in $LIST_OF_OSS_APPS; do
|
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
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,7 +218,7 @@ disable_sdl() {
|
|||||||
|
|
||||||
disable_timidity() {
|
disable_timidity() {
|
||||||
echo "Disabling PulseAudio for 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() {
|
disable_xine() {
|
||||||
@ -238,16 +239,13 @@ disable_festival() {
|
|||||||
disable_autospawn() {
|
disable_autospawn() {
|
||||||
echo "Disabling PulseAudio autospawn..."
|
echo "Disabling PulseAudio autospawn..."
|
||||||
if grep -q ^autospawn /etc/pulse/client.conf; then
|
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
|
else
|
||||||
echo "autospawn = no" >> /etc/pulse/client.conf
|
echo "autospawn = no" >> /etc/pulse/client.conf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
enable_all() {
|
||||||
--enable)
|
|
||||||
check_root || exit
|
|
||||||
ENABLE=1
|
|
||||||
enable_alsa
|
enable_alsa
|
||||||
enable_libao
|
enable_libao
|
||||||
enable_mplayer
|
enable_mplayer
|
||||||
@ -260,10 +258,9 @@ case $1 in
|
|||||||
enable_autospawn
|
enable_autospawn
|
||||||
enable_phonon
|
enable_phonon
|
||||||
enable_speechd
|
enable_speechd
|
||||||
;;
|
}
|
||||||
--disable)
|
|
||||||
check_root || exit
|
disable_all() {
|
||||||
ENABLE=0
|
|
||||||
disable_alsa
|
disable_alsa
|
||||||
disable_libao
|
disable_libao
|
||||||
disable_mplayer
|
disable_mplayer
|
||||||
@ -276,6 +273,32 @@ case $1 in
|
|||||||
disable_autospawn
|
disable_autospawn
|
||||||
disable_phonon
|
disable_phonon
|
||||||
disable_speechd
|
disable_speechd
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
--enable)
|
||||||
|
check_root || exit
|
||||||
|
ENABLE=1
|
||||||
|
enable_all
|
||||||
|
;;
|
||||||
|
--disable)
|
||||||
|
check_root || exit
|
||||||
|
ENABLE=0
|
||||||
|
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)
|
--status)
|
||||||
if [ -f /etc/sysconfig/sound ]; then
|
if [ -f /etc/sysconfig/sound ]; then
|
||||||
@ -283,6 +306,8 @@ case $1 in
|
|||||||
fi
|
fi
|
||||||
if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
|
if [ "x$PULSEAUDIO_ENABLE" = "xyes" ]; then
|
||||||
echo "enabled"
|
echo "enabled"
|
||||||
|
elif [ "x$PULSEAUDIO_ENABLE" = "xcustom" ]; then
|
||||||
|
echo "custom configured"
|
||||||
else
|
else
|
||||||
echo "disabled"
|
echo "disabled"
|
||||||
fi
|
fi
|
||||||
@ -296,9 +321,9 @@ esac
|
|||||||
# Now, update /etc/sysconfig/sound with the PA status
|
# Now, update /etc/sysconfig/sound with the PA status
|
||||||
if grep -q PULSEAUDIO_ENABLE /etc/sysconfig/sound; then
|
if grep -q PULSEAUDIO_ENABLE /etc/sysconfig/sound; then
|
||||||
if [ "x$ENABLE" = "x1" ]; 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
|
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
|
fi
|
||||||
else
|
else
|
||||||
if [ "x$ENABLE" = "x1" ]; then
|
if [ "x$ENABLE" = "x1" ]; then
|
||||||
@ -307,5 +332,3 @@ else
|
|||||||
echo "PULSEAUDIO_ENABLE=\"no\"" >> /etc/sysconfig/sound
|
echo "PULSEAUDIO_ENABLE=\"no\"" >> /etc/sysconfig/sound
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/sbin/SuSEconfig
|
|
||||||
|
9
sysconfig.sound-pulseaudio
Normal file
9
sysconfig.sound-pulseaudio
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
## 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"
|
Loading…
x
Reference in New Issue
Block a user