diff --git a/client-system.conf b/client-system.conf new file mode 100644 index 0000000..a1f390e --- /dev/null +++ b/client-system.conf @@ -0,0 +1 @@ +autospawn = no diff --git a/pulseaudio-alsa.patch b/pulseaudio-alsa.patch new file mode 100644 index 0000000..d4ee933 --- /dev/null +++ b/pulseaudio-alsa.patch @@ -0,0 +1,88 @@ +--- a/src/modules/alsa/alsa-mixer.c ++++ b/src/modules/alsa/alsa-mixer.c +@@ -23,7 +23,7 @@ + #endif + + #include +-#include ++#include + #include + + #ifdef HAVE_VALGRIND_MEMCHECK_H +--- a/src/modules/alsa/alsa-mixer.h ++++ b/src/modules/alsa/alsa-mixer.h +@@ -21,7 +21,7 @@ + along with PulseAudio; if not, see . + ***/ + +-#include ++#include + + #include + #include +--- a/src/modules/alsa/alsa-sink.c ++++ b/src/modules/alsa/alsa-sink.c +@@ -25,7 +25,7 @@ + #include + #include + +-#include ++#include + + #ifdef HAVE_VALGRIND_MEMCHECK_H + #include +--- a/src/modules/alsa/alsa-source.c ++++ b/src/modules/alsa/alsa-source.c +@@ -25,7 +25,7 @@ + #include + #include + +-#include ++#include + + #include + #include +--- a/src/modules/alsa/alsa-ucm.c ++++ b/src/modules/alsa/alsa-ucm.c +@@ -27,7 +27,7 @@ + #include + #include + #include +-#include ++#include + + #ifdef HAVE_VALGRIND_MEMCHECK_H + #include +--- a/src/modules/alsa/alsa-util.c ++++ b/src/modules/alsa/alsa-util.c +@@ -23,7 +23,7 @@ + #endif + + #include +-#include ++#include + + #include + #include +--- a/src/modules/alsa/alsa-util.h ++++ b/src/modules/alsa/alsa-util.h +@@ -21,7 +21,7 @@ + along with PulseAudio; if not, see . + ***/ + +-#include ++#include + + #include + #include +--- a/src/modules/alsa/module-alsa-source.c ++++ b/src/modules/alsa/module-alsa-source.c +@@ -24,7 +24,7 @@ + + #include + +-#include ++#include + + #ifdef HAVE_VALGRIND_MEMCHECK_H + #include diff --git a/pulseaudio.changes b/pulseaudio.changes index 1f5463d..00bb99b 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Wed Mar 27 00:55:14 UTC 2019 - Jan Engelhardt + +- Remove one redundant Requires: systemd, and add + BuildRequires: systemd-rpm-macros. + +------------------------------------------------------------------- +Tue Mar 26 07:03:44 UTC 2019 - olaf@aepfle.de + +- Use alsa API properly. Consumers are expected to use + instead of . + This is in preparation of an change to pkgconfig(alsa) to + not pollute CFLAGS with -I/usr/include/alsa anymore (bsc#1130333) + pulseaudio-alsa.patch + +------------------------------------------------------------------- +Wed Jan 30 16:49:19 UTC 2019 - alarrosa@suse.com + +- Make /var/lib/gdm %ghost again in pulseaudio-gdm-hooks so we don't + create the directory when installing the package. gdm was just + changed to create that directory as %ghost too to keep both + packages in sync. + +- Add /var/lib/pulseaudio (which is already created by systemd-tmpfiles) + as %ghost so users can easily query who created the directory, + it gets uninstalled on package removal and rpmlint doesn't complain + about it. + +------------------------------------------------------------------- +Tue Jan 15 12:46:45 CET 2019 - tiwai@suse.de + +- Enable systemd user socket for activating PA (bsc#1083473) +- Disable auto-spawn along with the change above + ------------------------------------------------------------------- Sun Nov 18 11:34:25 CET 2018 - tiwai@suse.de diff --git a/pulseaudio.spec b/pulseaudio.spec index 7a4ff90..e67675a 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -42,10 +42,12 @@ Source5: pulseaudio.service Source6: disable_flat_volumes.conf Source7: pulseaudio.tmpfiles Source8: pulseaudio-gdm-hooks.tmpfiles +Source9: client-system.conf Source99: baselibs.conf Patch0: disabled-start.diff Patch1: suppress-socket-error-msg.diff Patch2: pulseaudio-wrong-memset.patch +Patch3: pulseaudio-alsa.patch Patch4: pa-set-exit-idle-time-to-0-when-we-detect-a-session.patch # PATCH-FIX-OPENSUSE qpaeq-shebang.patch Avoid rpmlint error due to using env python shebang Patch5: qpaeq-shebang.patch @@ -70,6 +72,7 @@ BuildRequires: orc >= 0.4.9 BuildRequires: pkgconfig BuildRequires: systemd BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros BuildRequires: translation-update-upstream BuildRequires: update-desktop-files BuildRequires: pkgconfig(bash-completion) @@ -173,7 +176,6 @@ This package provides zeroconf network support for the PulseAudio sound server Summary: Support for running PulseAudio daemon system wide Group: System/Sound Daemons Requires: %{name} -Requires: systemd %systemd_requires %description system-wide @@ -344,6 +346,7 @@ Optional dependency offering zsh completion for various PulseAudio utilities %patch0 %patch1 -p1 %patch2 +%patch3 -p1 %patch4 -p1 %patch5 @@ -368,7 +371,8 @@ export CFLAGS="%{optflags} -fPIE" --enable-gconf \ --enable-gsettings \ --with-udev-rules-dir=%{_udevrulesdir} \ - --with-pulsedsp-location='%{_prefix}/\\$$LIB/pulseaudio' + --with-pulsedsp-location='%{_prefix}/\\$$LIB/pulseaudio' \ + --with-systemduserunitdir=%{_userunitdir} make %{?_smp_mflags} V=1 make %{?_smp_mflags} doxygen @@ -383,6 +387,7 @@ rm -rf \ # configure --disable-static had no effect; delete manually. rm -rf "%{buildroot}%{_libdir}"/*.a +# system-wide service (optional) install -D -m 0644 %{SOURCE5} %{buildroot}%{_libexecdir}/systemd/system/%{name}.service mkdir -p %{buildroot}%{_sbindir} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} @@ -405,7 +410,6 @@ install -m 644 %{SOURCE7} %{buildroot}%{_prefix}/lib/tmpfiles.d/pulseaudio.conf install -m 644 %{SOURCE8} %{buildroot}%{_prefix}/lib/tmpfiles.d/pulseaudio-gdm-hooks.conf mkdir -p %{buildroot}%{_prefix}/share/factory/var/lib/gdm/.pulse install -m 644 %{SOURCE1} %{buildroot}%{_prefix}/share/factory/var/lib/gdm/.pulse/default.pa -mkdir -p %{buildroot}%{_localstatedir}/lib/gdm ln -s esdcompat %{buildroot}%{_bindir}/esd # install firewall rule on SUSE %if %{defined suse_version} @@ -414,11 +418,10 @@ install -m 0644 %{SOURCE4} %{buildroot}/%{_fwdefdir}/pulseaudio-server %endif # create .d conf dirs (since 8.0) mkdir -p %{buildroot}%{_sysconfdir}/pulse/client.conf.d +install -m 0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/pulse/client.conf.d/50-system.conf mkdir -p %{buildroot}%{_sysconfdir}/pulse/daemon.conf.d # Install disable_flat_volumes.conf -install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/pulse/daemon.conf.d -# created by setup-pulseaudio script -touch %{buildroot}%{_sysconfdir}/pulse/client.conf.d/50-system.conf +install -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/pulse/daemon.conf.d/60-disable_flat_volumes.conf %fdupes doxygen/html %pre @@ -428,18 +431,37 @@ getent group pulse-access >/dev/null || groupadd -r pulse-access getent group audio | grep pulse >/dev/null || usermod -a -G audio pulse exit 0 -%post -n libpulse%{soname} -p /sbin/ldconfig -%postun -n libpulse%{soname} -p /sbin/ldconfig -%post -n libpulse-mainloop-glib%{soname} -p /sbin/ldconfig -%postun -n libpulse-mainloop-glib%{soname} -p /sbin/ldconfig %post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} +if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then + echo "Switching PulseAudio activation using systemd user socket." + echo "Please log out from all sessions once to make it effective." +fi +%systemd_user_post pulseaudio.socket +# FIXME: workaround to make sure the user socket symlink creation (bsc#1083473) +if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then + # below should work once when preset is defined properly: + # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket + mkdir -p /etc/systemd/user/sockets.target.wants + ln -s %{_userunitdir}/%{name}.socket /etc/systemd/user/sockets.target.wants/%{name}.socket +fi # Update the /etc/profile.d/pulseaudio.* files setup-pulseaudio --auto > /dev/null -%postun -p /sbin/ldconfig +%preun +%systemd_user_preun pulseaudio.socket + +%postun +/sbin/ldconfig +%systemd_user_postun pulseaudio.socket + +%post -n libpulse%{soname} -p /sbin/ldconfig +%postun -n libpulse%{soname} -p /sbin/ldconfig +%post -n libpulse-mainloop-glib%{soname} -p /sbin/ldconfig +%postun -n libpulse-mainloop-glib%{soname} -p /sbin/ldconfig + %pre system-wide %service_add_pre pulseaudio.service exit 0 @@ -562,17 +584,18 @@ exit 0 %{_mandir}/man5/pulse-cli-syntax.5* %dir %{_sysconfdir}/pulse/ %dir %{_sysconfdir}/pulse/daemon.conf.d -%config(noreplace) %{_sysconfdir}/pulse/daemon.conf.d/disable_flat_volumes.conf +%config %{_sysconfdir}/pulse/client.conf.d/50-system.conf +%config(noreplace) %{_sysconfdir}/pulse/daemon.conf.d/60-disable_flat_volumes.conf %config(noreplace) %{_sysconfdir}/pulse/daemon.conf %config(noreplace) %{_sysconfdir}/pulse/default.pa %config(noreplace) %{_sysconfdir}/pulse/system.pa %config(noreplace) %{_sysconfdir}/dbus-1/system.d/pulseaudio-system.conf # init -%dir %{_libexecdir}/systemd -%dir %{_libexecdir}/systemd/user -%{_libexecdir}/systemd/user/%{name}.service -%{_libexecdir}/systemd/user/%{name}.socket +%dir %{_userunitdir} +%{_userunitdir}/%{name}.service +%{_userunitdir}/%{name}.socket %{_prefix}/lib/tmpfiles.d/pulseaudio.conf +%ghost %dir %{_localstatedir}/lib/pulseaudio %if %{defined suse_version} %config(noreplace) %{_fwdefdir}/pulseaudio-server @@ -580,7 +603,6 @@ exit 0 # created by setup-pulseaudio script %ghost %{_sysconfdir}/profile.d/pulseaudio.sh %ghost %{_sysconfdir}/profile.d/pulseaudio.csh -%ghost %{_sysconfdir}/pulse/client.conf.d/50-system.conf %files esound-compat %{_bindir}/esdcompat @@ -588,7 +610,7 @@ exit 0 %{_mandir}/man1/esdcompat.1* %files gdm-hooks -%attr(0750, gdm, gdm) %dir %{_localstatedir}/lib/gdm +%attr(0750, gdm, gdm) %ghost %dir %{_localstatedir}/lib/gdm %attr(0700, gdm, gdm) %ghost %dir %{_localstatedir}/lib/gdm/.pulse %attr(0600, gdm, gdm) %ghost %{_localstatedir}/lib/gdm/.pulse/default.pa %dir %{_prefix}/share/factory/var diff --git a/setup-pulseaudio b/setup-pulseaudio index 5af85e4..052b500 100644 --- a/setup-pulseaudio +++ b/setup-pulseaudio @@ -208,6 +208,7 @@ enable_qemu () { } enable_autospawn() { + test -f /etc/systemd/user/sockets.target.wants/pulseaudio.socket && return echo "Enabling PulseAudio autospawn..." if grep -q ^autospawn $pulse_client_conf >/dev/null 2>&1; then sed -i -e "s|^autospawn.*|autospawn = yes|g" $pulse_client_conf @@ -316,6 +317,7 @@ disable_qemu () { } disable_autospawn() { + test -f /etc/systemd/user/sockets.target.wants/pulseaudio.socket && return echo "Disabling PulseAudio autospawn..." if grep -q ^autospawn $pulse_client_conf >/dev/null 2>&1; then sed -i -e "s|^autospawn.*|autospawn = no|g" $pulse_client_conf