From af67ac1fdf6444b9c31cdf3437b6d91bc2825658ccca3dda574873e56e9e317b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 16 Jan 2019 15:39:35 +0000 Subject: [PATCH 1/4] Accepting request 666499 from home:tiwai:branches:multimedia:libs - Enable systemd user socket for activating PA (bsc#1083473) - Disable auto-spawn along with the change above OBS-URL: https://build.opensuse.org/request/show/666499 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=198 --- client-system.conf | 1 + pulseaudio.changes | 6 ++++++ pulseaudio.spec | 50 ++++++++++++++++++++++++++++++++-------------- setup-pulseaudio | 2 ++ 4 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 client-system.conf 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.changes b/pulseaudio.changes index 1f5463d..5cd03da 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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..565ac26 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -42,6 +42,7 @@ 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 @@ -368,7 +369,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 +385,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} @@ -414,11 +417,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 +430,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,16 +583,16 @@ 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 %if %{defined suse_version} @@ -580,7 +601,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 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 From 4e7e43ee7838703abdf5cc8aa8611fd05e19231ca8faf850df200c1c9ae04b83 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 30 Jan 2019 18:47:19 +0000 Subject: [PATCH 2/4] Accepting request 670183 from home:alarrosa:branches:multimedia:libs - 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. OBS-URL: https://build.opensuse.org/request/show/670183 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=199 --- pulseaudio.changes | 13 +++++++++++++ pulseaudio.spec | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pulseaudio.changes b/pulseaudio.changes index 5cd03da..74025ea 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +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 diff --git a/pulseaudio.spec b/pulseaudio.spec index 565ac26..dfe7332 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -408,7 +408,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} @@ -594,6 +593,7 @@ exit 0 %{_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 @@ -608,7 +608,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 From 253f3bd89961c8082f156e5453d94cd6f65caf2cb3bc16024c57d4c84378ad17 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 26 Mar 2019 16:39:24 +0000 Subject: [PATCH 3/4] Accepting request 688622 from home:olh:branches:multimedia:libs - 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 OBS-URL: https://build.opensuse.org/request/show/688622 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=200 --- pulseaudio-alsa.patch | 88 +++++++++++++++++++++++++++++++++++++++++++ pulseaudio.changes | 9 +++++ pulseaudio.spec | 2 + 3 files changed, 99 insertions(+) create mode 100644 pulseaudio-alsa.patch 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 74025ea..2780b8b 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +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 diff --git a/pulseaudio.spec b/pulseaudio.spec index dfe7332..8d9c2a3 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -47,6 +47,7 @@ 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 @@ -345,6 +346,7 @@ Optional dependency offering zsh completion for various PulseAudio utilities %patch0 %patch1 -p1 %patch2 +%patch3 -p1 %patch4 -p1 %patch5 From 4906c96b2fe3bf46fa32029237c016daff17a85495caed36adeaf888048c2e0d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 27 Mar 2019 16:21:54 +0000 Subject: [PATCH 4/4] Accepting request 688933 from home:jengelh:sct - Remove one redundant Requires: systemd, and add BuildRequires: systemd-rpm-macros. OBS-URL: https://build.opensuse.org/request/show/688933 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pulseaudio?expand=0&rev=201 --- pulseaudio.changes | 6 ++++++ pulseaudio.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pulseaudio.changes b/pulseaudio.changes index 2780b8b..00bb99b 100644 --- a/pulseaudio.changes +++ b/pulseaudio.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/pulseaudio.spec b/pulseaudio.spec index 8d9c2a3..e67675a 100644 --- a/pulseaudio.spec +++ b/pulseaudio.spec @@ -72,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) @@ -175,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