diff --git a/disabled-start.diff b/disabled-start.diff index 4d27a5d..cdc48cf 100644 --- a/disabled-start.diff +++ b/disabled-start.diff @@ -8,7 +8,7 @@ Index: src/daemon/start-pulseaudio-x11.in +. /etc/sysconfig/sound + -+if [ x"$PULSEAUDIO_ENABLE" = x"no" ] ; then ++if [ x"$PULSEAUDIO_ENABLE" = x"no" ] || [ x"$PULSEAUDIO_SYSTEM" = x"yes" ] ; then + exit 1 +fi + @@ -25,7 +25,7 @@ Index: src/daemon/start-pulseaudio-kde.in +. /etc/sysconfig/sound + -+if [ x"$PULSEAUDIO_ENABLE" = x"no" ] ; then ++if [ x"$PULSEAUDIO_ENABLE" = x"no" ] || [ x"$PULSEAUDIO_SYSTEM" = x"yes" ]; then + exit 1 +fi + diff --git a/pulseaudio.changes b/pulseaudio.changes index a7e45ce..3c6df5d 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -17,6 +17,11 @@ Wed Sep 25 17:48:30 UTC 2013 - dimstar@opensuse.org - No longer pass --enable-bluez5 --disable-bluez4 to configure: master only speaks bluez5. +------------------------------------------------------------------- +Wed Sep 11 10:34:33 CEST 2013 - mhrusecky@suse.cz + +- support for system wide mode (separate subpackage with service) + ------------------------------------------------------------------- Sat Sep 7 11:30:40 UTC 2013 - dimstar@opensuse.org diff --git a/pulseaudio.service b/pulseaudio.service new file mode 100644 index 0000000..a0fac85 --- /dev/null +++ b/pulseaudio.service @@ -0,0 +1,11 @@ +[Unit] +Description=System wide PulseAudio instance +After=syslog.target network.target alsasound.service + +[Service] +Type=simple +Restart=always +ExecStart=/usr/bin/pulseaudio --system --log-target=syslog + +[Install] +WantedBy=multi-user.target diff --git a/pulseaudio.spec b/pulseaudio.spec index 533822b..f315816 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -34,13 +34,11 @@ Source1: default.pa-for-gdm Source2: setup-pulseaudio Source3: sysconfig.sound-pulseaudio Source4: pulseaudio-server.fw +Source5: pulseaudio.service Source99: baselibs.conf Patch0: disabled-start.diff Patch1: suppress-socket-error-msg.diff Patch2: pulseaudio-wrong-memset.patch -%if 0%{?suse_version} >= 1210 -BuildRequires: pkgconfig(systemd) -%endif BuildRequires: alsa-devel >= 1.0.24 BuildRequires: bluez-devel >= 5 BuildRequires: doxygen @@ -63,6 +61,8 @@ BuildRequires: libwebrtc_audio_processing-devel BuildRequires: lirc-devel BuildRequires: orc >= 0.4.9 BuildRequires: speex-devel +BuildRequires: systemd +BuildRequires: systemd-devel BuildRequires: tcpd-devel BuildRequires: translation-update-upstream BuildRequires: update-desktop-files @@ -146,6 +146,26 @@ improved drop-in replacement for the Enlightened Sound Daemon (ESOUND). This package provides zeroconf network support for the PulseAudio sound server +%package system-wide +Summary: Support for running PulseAudio daemon system wide +Group: System/Sound Daemons +Requires: %{name} +Requires: systemd +%systemd_requires + +%description system-wide +PulseAudio daemon can be run as a system-wide instance which than can be shared +by multiple local users. We recommend running the PulseAudio daemon per-user, +just like the traditional ESD sound daemon. In some situations however, such as +embedded systems where no real notion of a user exists, it makes sense to use +the system-wide mode. + +Before you now go ahead and use it please read about what is wrong with system +mode: + +http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide + + %package module-jack Summary: JACK support for the PulseAudio sound server Group: System/Sound Daemons @@ -296,6 +316,10 @@ rm -rf \ # configure --disable-static had no effect; delete manually. rm -rf "%{buildroot}%{_libdir}"/*.a +install -D -m 0644 %{SOURCE5} %{buildroot}/usr/lib/systemd/system/%{name}.service +mkdir -p %{buildroot}%{_sbindir} +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} + # openSUSE 11.3 cannot find the .desktop files %suse_update_desktop_file pulseaudio %suse_update_desktop_file pulseaudio-kde @@ -342,6 +366,22 @@ setup-pulseaudio --auto > /dev/null %postun -p /sbin/ldconfig +%pre system-wide +%service_add_pre pulseaudio.service +exit 0 + +%post system-wide +%service_add_post pulseaudio.service +exit 0 + +%preun system-wide +%service_del_preun pulseaudio.service +exit 0 + +%postun system-wide +%service_del_preun pulseaudio.service +exit 0 + %files %defattr(-,root,root) %doc README LICENSE GPL LGPL @@ -564,4 +604,10 @@ setup-pulseaudio --auto > /dev/null %files lang -f %{name}.lang +%files system-wide +%{_sbindir}/rc%{name} +%dir /usr/lib/systemd +%dir /usr/lib/systemd/system +/usr/lib/systemd/system/%{name}.service + %changelog diff --git a/sysconfig.sound-pulseaudio b/sysconfig.sound-pulseaudio index d67b33b..4dc935d 100644 --- a/sysconfig.sound-pulseaudio +++ b/sysconfig.sound-pulseaudio @@ -7,3 +7,15 @@ # scripts automatically change sound-related configuration for PulseAudio. # PULSEAUDIO_ENABLE="yes" + +## Path: Hardware/Soundcard/PulseAudio/SystemWide +## Description: System Wide PulseAudio +## Type: list(yes,no) +# +# Allows you to configure that you have system wide PulseAudio daemon. Such is +# setup is not recommended. To make it work, you would need +# pulseaudio-systemwide package and enable pulseaudio systemd service. If you +# are not sure whether you want this, you don't. So unless you know what you +# are doing, keep this set to "no". +# +PULSEAUDIO_SYSTEM="no"