#2 Use systemd presets to enable pulseaudio.socket
Closed 4 years ago by rdieter. Opened 4 years ago by zbyszek.
rpms/ zbyszek/pulseaudio use-scriptlets  into  master

file modified
+13 -51
@@ -17,13 +17,8 @@ 

  ## support systemd activation

  %global systemd 1

  ## enable systemd activation by default (instead of autospawn)

- %if 0%{?fedora} > 27

  %global systemd_activation 1

  ## TODO: ship preset to explicitly disable .service, enable .socket

- %else

- # gdm-hooks moved to gdm packaging f28+

- %global gdm_hooks 1

- %endif

  

  ## tcp_wrapper support

  %if 0%{?fedora} < 28
@@ -39,7 +34,7 @@ 

  Name:           pulseaudio

  Summary:        Improved Linux Sound Server

  Version:        %{pa_major}%{?pa_minor:.%{pa_minor}}

- Release:        4%{?snap:.%{snap}git%{shortcommit}}%{?dist}

+ Release:        5%{?snap:.%{snap}git%{shortcommit}}%{?dist}

  License:        LGPLv2+

  URL:            http://www.freedesktop.org/wiki/Software/PulseAudio

  %if 0%{?gitrel}
@@ -255,19 +250,6 @@ 

  %description utils

  This package contains command line utilities for the PulseAudio sound server.

  

- %if 0%{?gdm_hooks}

- %package gdm-hooks

- Summary:        PulseAudio GDM integration

- License:        LGPLv2+

- Requires:       gdm >= 1:2.22.0

- # for the gdm user

- Requires(pre):  gdm

- 

- %description gdm-hooks

- This package contains GDM integration hooks for the PulseAudio sound server.

- %endif

- 

- 

  %prep

  %setup -q -T -b0 -n %{name}-%{version}%{?gitrel:-%{gitrel}-g%{shortcommit}}

  
@@ -354,18 +336,6 @@ 

  mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d

  mv -fv $RPM_BUILD_ROOT/lib/udev/rules.d/90-pulseaudio.rules $RPM_BUILD_ROOT%{_prefix}/lib/udev/rules.d

  

- %if 0%{?gdm_hooks}

- install -p -m644 -D %{SOURCE5} $RPM_BUILD_ROOT%{_localstatedir}/lib/gdm/.pulse/default.pa

- %endif

- 

- # take cue from dbus and manually place wants symlink instead of

- # relying on scriptlets exclusively.  Helps handle upgrade cases

- # that standard scriptlets miss.

- %if 0%{?systemd_activation}

- mkdir %{buildroot}%{_userunitdir}/sockets.target.wants

- ln -s ../pulseaudio.socket %{buildroot}%{_userunitdir}/sockets.target.wants/pulseaudio.socket

- %endif

- 

  ## unpackaged files

  # extraneous libtool crud

  rm -fv $RPM_BUILD_ROOT%{_libdir}/lib*.la
@@ -419,24 +389,22 @@ 

  %post

  %{?ldconfig}

  %if 0%{?systemd_activation}

- # unsure if we want both .socket and .service here (or only socket)

- # test socket-only on f31+ -- rex

- %if 0%{?fedora} < 31

- %systemd_user_post pulseaudio.service

- %endif

- %systemd_user_post pulseaudio.socket

+ %systemd_user_post pulseaudio.service pulseaudio.socket

  %endif

  

  %if 0%{?systemd_activation}

  %preun

- %if 0%{?fedora} < 31

- %systemd_user_preun pulseaudio.service

- %endif

- %systemd_user_preun pulseaudio.socket

+ %systemd_user_preun pulseaudio.service pulseaudio.socket

  %endif

  

  %ldconfig_postun

  

+ %triggerun -- %{name} < 12.2-4

+ # This is for upgrades from previous versions which had a static symlink.

+ # The %%post scriptlet above only does anything on initial package installation.

+ # Remove before F33.

+ systemctl --no-reload preset --global pulseaudio.socket >/dev/null 2>&1 || :

+ 

  %files

  %doc README

  %license LICENSE GPL LGPL
@@ -448,9 +416,6 @@ 

  %if 0%{?systemd}

  %{_userunitdir}/pulseaudio.service

  %{_userunitdir}/pulseaudio.socket

- %if 0%{?systemd_activation}

- %{_userunitdir}/sockets.target.wants/pulseaudio.socket

- %endif

  %endif

  %{_bindir}/pulseaudio

  %{_libdir}/pulseaudio/libpulsecore-%{pa_major}.so
@@ -667,14 +632,11 @@ 

  %{_mandir}/man1/pasuspender.1*

  %{_mandir}/man1/pax11publish.1*

  

- %if 0%{?gdm_hooks}

- %files gdm-hooks

- %attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.pulse

- %attr(0600, gdm, gdm) %{_localstatedir}/lib/gdm/.pulse/default.pa

- %endif

- 

- 

  %changelog

+ * Thu May  9 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 12.2-5

+ - Drop pre-f28 conditionals

+ - Use systemd presets to enable user units

+ 

  * Wed Apr 10 2019 Rex Dieter <rdieter@fedoraproject.org> - 12.2-4

  - test using only socket activation (f31+ only for now)

  

no initial comment

This PR does way more than the commit log says. Please limit your changes to just that (and and possibly do cleanup in a subsequent commit/pr)

I guess they're in separate commits, but no changelog for it. Add that and I can withdraw my objection.

The change in the first commit is completely invisible (unless I messed up) in F >= 28. In the repo, there are seperate branches for each release, so this change doesn't affect older releases. I can add it, if you think it's necessary, but I don't think there's a good reason to add a changelog entry (as opposed to a git commit entry). What would it even say?

changelog should say approximately the same as the git commit message: Drop pre-f28 conditionals or clean up conditionals

The PR says there are conflicts (I was going to add changelog post-merge manually). It appears this merge missed the latest commit to master branch, where I made it use socket activation only.

I'll go ahead and commit the important bits from here manually, thanks for the help

Oh, I added the changelog entry but forgot to push. And I missed the commit in the master branch too. I'll rebase.

Updated. But please don't merge this before https://src.fedoraproject.org/rpms/fedora-release/pull-request/80 goes in. I missed the fact that the preset needs to be added there too.

Pull-Request has been closed by rdieter

4 years ago

So, this change will only work on f31+ ?

But please don't merge this before https://src.fedoraproject.org/rpms/fedora-release/pull-request/80 goes in. I missed the fact that the preset needs to be added there too.

Eh, sorry. It was a long day yesterday.

That comment is wrong, it is OK to merge this PR independently of the other one.

So, this change will only work on f31+ ?

No, it's fine in all releases.

Pull-Request has been reopened by zbyszek

4 years ago

rebased onto 72e1fe5

4 years ago

I believe this got implemented in a separate commit 8b44e5c

Pull-Request has been closed by rdieter

4 years ago