From 39ae1a7257f051bb42e0be4c68614fb2518bc801588c840ea6763e82bc12f45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Thu, 3 Feb 2022 21:54:42 +0000 Subject: [PATCH] Accepting request 947943 from home:gmbr3:Active - Change to systemd-sysusers OBS-URL: https://build.opensuse.org/request/show/947943 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/avahi?expand=0&rev=196 --- avahi-autoipd.sysusers | 2 ++ avahi-glib2.spec | 31 ++++++++++++++++++------------- avahi-mono.spec | 31 ++++++++++++++++++------------- avahi-qt5.spec | 31 ++++++++++++++++++------------- avahi.changes | 5 +++++ avahi.spec | 31 ++++++++++++++++++------------- avahi.sysusers | 2 ++ 7 files changed, 81 insertions(+), 52 deletions(-) create mode 100644 avahi-autoipd.sysusers create mode 100644 avahi.sysusers diff --git a/avahi-autoipd.sysusers b/avahi-autoipd.sysusers new file mode 100644 index 0000000..9872a1e --- /dev/null +++ b/avahi-autoipd.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u avahi-autoipd - "User for Avahi IPv4LL" /var/lib/avahi-autoipd - diff --git a/avahi-glib2.spec b/avahi-glib2.spec index ee3d704..f4d8b87 100644 --- a/avahi-glib2.spec +++ b/avahi-glib2.spec @@ -62,6 +62,8 @@ Source8: %{_name}_spec-prepare.sh Source9: avahi-autoipd.README.SUSE Source10: avahi-autoipd.if-up Source11: avahi-autoipd.if-down +Source13: avahi.sysusers +Source14: avahi-autoipd.sysusers # File missing from 0.8 tarball Source12: https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db Source100: attributes @@ -98,6 +100,7 @@ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: sysuser-tools # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig @@ -116,7 +119,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) Requires: nss-mdns Requires: sudo -Requires(pre): shadow +%sysusers_requires # # mDNSResponder was used for <= 10.2: Provides: mDNSResponder = 107.5 @@ -300,8 +303,7 @@ Summary: IPv4LL Service for Zeroconf and Bonjour # coreutils contains /usr/bin/chown Group: Productivity/Networking/Other Requires(post): coreutils -# shadow contains useradd and groupadd -Requires(pre): shadow +%sysusers_requires Provides: avahi:%{_sbindir}/avahi-autoipd %description autoipd @@ -422,8 +424,12 @@ DNS specifications for Zeroconf Computing. -# This is the avahi-discover command, only provided for the primary python3 flavor + + + + +# This is the avahi-discover command, only provided for the primary python3 flavor %package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python @@ -559,6 +565,8 @@ if ! test -f %{_datadir}/aclocal/glib-gettext.m4 ; then fi %build +%sysusers_generate_pre %{SOURCE13} avahi avahi.conf +%sysusers_generate_pre %{SOURCE14} autoipd avahi-autoipd.conf autoreconf -f -i intltoolize -f %{python_expand # configure for every python flavor @@ -695,6 +703,8 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcavahi-dnsconfd install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ +install -Dm0644 %{SOURCE13} %{buildroot}%{_sysusersdir}/avahi.conf +install -Dm0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/avahi-autoipd.conf %if ! %{build_glib2} # Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces @@ -746,9 +756,7 @@ strip-nondeterminism %{buildroot}/%{_prefix}/lib/monodoc/sources/*.zip %endif %fdupes %{buildroot}/%{_libdir} -%pre -getent group avahi >/dev/null || %{_sbindir}/groupadd -r avahi -getent passwd avahi >/dev/null || %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi" -d /run/avahi-daemon -g avahi avahi +%pre -f avahi.pre %service_add_pre avahi-dnsconfd.service avahi-daemon.service # bnc#853845,bnc#851953: do not start by default under # sysconfig as this breaks vlan,bridge,bonding setups @@ -773,12 +781,7 @@ fi %postun %service_del_postun avahi-dnsconfd.service avahi-daemon.service -%pre autoipd -getent group avahi-autoipd >/dev/null || %{_sbindir}/groupadd -r avahi-autoipd -getent passwd avahi-autoipd >/dev/null || \ - %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi IPv4LL" \ - -d %{_localstatedir}/lib/avahi-autoipd -g avahi-autoipd \ - avahi-autoipd +%pre autoipd -f autoipd.pre %post autoipd %{fillup_only -ns avahi autoipd} @@ -866,6 +869,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service +%{_sysusersdir}/avahi.conf # Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces @@ -907,6 +911,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_sysconfdir}/avahi/avahi-autoipd.action %{_sysconfdir}/sysconfig/network/*/avahi-autoipd %{_fillupdir}/sysconfig.avahi-autoipd +%{_sysusersdir}/avahi-autoipd.conf %files utils %{_bindir}/avahi-browse* diff --git a/avahi-mono.spec b/avahi-mono.spec index e50d0a5..824bdcb 100644 --- a/avahi-mono.spec +++ b/avahi-mono.spec @@ -62,6 +62,8 @@ Source8: %{_name}_spec-prepare.sh Source9: avahi-autoipd.README.SUSE Source10: avahi-autoipd.if-up Source11: avahi-autoipd.if-down +Source13: avahi.sysusers +Source14: avahi-autoipd.sysusers # File missing from 0.8 tarball Source12: https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db Source100: attributes @@ -98,6 +100,7 @@ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: sysuser-tools # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig @@ -116,7 +119,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) Requires: nss-mdns Requires: sudo -Requires(pre): shadow +%sysusers_requires # # mDNSResponder was used for <= 10.2: Provides: mDNSResponder = 107.5 @@ -299,8 +302,7 @@ Summary: IPv4LL Service for Zeroconf and Bonjour # coreutils contains /usr/bin/chown Group: Productivity/Networking/Other Requires(post): coreutils -# shadow contains useradd and groupadd -Requires(pre): shadow +%sysusers_requires Provides: avahi:%{_sbindir}/avahi-autoipd %description autoipd @@ -421,8 +423,12 @@ DNS specifications for Zeroconf Computing. -# This is the avahi-discover command, only provided for the primary python3 flavor + + + + +# This is the avahi-discover command, only provided for the primary python3 flavor %package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python @@ -558,6 +564,8 @@ if ! test -f %{_datadir}/aclocal/glib-gettext.m4 ; then fi %build +%sysusers_generate_pre %{SOURCE13} avahi avahi.conf +%sysusers_generate_pre %{SOURCE14} autoipd avahi-autoipd.conf autoreconf -f -i intltoolize -f %{python_expand # configure for every python flavor @@ -694,6 +702,8 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcavahi-dnsconfd install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ +install -Dm0644 %{SOURCE13} %{buildroot}%{_sysusersdir}/avahi.conf +install -Dm0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/avahi-autoipd.conf %if ! %{build_glib2} # Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces @@ -745,9 +755,7 @@ strip-nondeterminism %{buildroot}/%{_prefix}/lib/monodoc/sources/*.zip %endif %fdupes %{buildroot}/%{_libdir} -%pre -getent group avahi >/dev/null || %{_sbindir}/groupadd -r avahi -getent passwd avahi >/dev/null || %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi" -d /run/avahi-daemon -g avahi avahi +%pre -f avahi.pre %service_add_pre avahi-dnsconfd.service avahi-daemon.service # bnc#853845,bnc#851953: do not start by default under # sysconfig as this breaks vlan,bridge,bonding setups @@ -772,12 +780,7 @@ fi %postun %service_del_postun avahi-dnsconfd.service avahi-daemon.service -%pre autoipd -getent group avahi-autoipd >/dev/null || %{_sbindir}/groupadd -r avahi-autoipd -getent passwd avahi-autoipd >/dev/null || \ - %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi IPv4LL" \ - -d %{_localstatedir}/lib/avahi-autoipd -g avahi-autoipd \ - avahi-autoipd +%pre autoipd -f autoipd.pre %post autoipd %{fillup_only -ns avahi autoipd} @@ -865,6 +868,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service +%{_sysusersdir}/avahi.conf # Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces @@ -906,6 +910,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_sysconfdir}/avahi/avahi-autoipd.action %{_sysconfdir}/sysconfig/network/*/avahi-autoipd %{_fillupdir}/sysconfig.avahi-autoipd +%{_sysusersdir}/avahi-autoipd.conf %files utils %{_bindir}/avahi-browse* diff --git a/avahi-qt5.spec b/avahi-qt5.spec index 6386b1f..19eefa4 100644 --- a/avahi-qt5.spec +++ b/avahi-qt5.spec @@ -62,6 +62,8 @@ Source8: %{_name}_spec-prepare.sh Source9: avahi-autoipd.README.SUSE Source10: avahi-autoipd.if-up Source11: avahi-autoipd.if-down +Source13: avahi.sysusers +Source14: avahi-autoipd.sysusers # File missing from 0.8 tarball Source12: https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db Source100: attributes @@ -98,6 +100,7 @@ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: sysuser-tools # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig @@ -116,7 +119,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) Requires: nss-mdns Requires: sudo -Requires(pre): shadow +%sysusers_requires # # mDNSResponder was used for <= 10.2: Provides: mDNSResponder = 107.5 @@ -300,8 +303,7 @@ Summary: IPv4LL Service for Zeroconf and Bonjour # coreutils contains /usr/bin/chown Group: Productivity/Networking/Other Requires(post): coreutils -# shadow contains useradd and groupadd -Requires(pre): shadow +%sysusers_requires Provides: avahi:%{_sbindir}/avahi-autoipd %description autoipd @@ -422,8 +424,12 @@ DNS specifications for Zeroconf Computing. -# This is the avahi-discover command, only provided for the primary python3 flavor + + + + +# This is the avahi-discover command, only provided for the primary python3 flavor %package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python @@ -559,6 +565,8 @@ if ! test -f %{_datadir}/aclocal/glib-gettext.m4 ; then fi %build +%sysusers_generate_pre %{SOURCE13} avahi avahi.conf +%sysusers_generate_pre %{SOURCE14} autoipd avahi-autoipd.conf autoreconf -f -i intltoolize -f %{python_expand # configure for every python flavor @@ -695,6 +703,8 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcavahi-dnsconfd install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ +install -Dm0644 %{SOURCE13} %{buildroot}%{_sysusersdir}/avahi.conf +install -Dm0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/avahi-autoipd.conf %if ! %{build_glib2} # Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces @@ -746,9 +756,7 @@ strip-nondeterminism %{buildroot}/%{_prefix}/lib/monodoc/sources/*.zip %endif %fdupes %{buildroot}/%{_libdir} -%pre -getent group avahi >/dev/null || %{_sbindir}/groupadd -r avahi -getent passwd avahi >/dev/null || %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi" -d /run/avahi-daemon -g avahi avahi +%pre -f avahi.pre %service_add_pre avahi-dnsconfd.service avahi-daemon.service # bnc#853845,bnc#851953: do not start by default under # sysconfig as this breaks vlan,bridge,bonding setups @@ -773,12 +781,7 @@ fi %postun %service_del_postun avahi-dnsconfd.service avahi-daemon.service -%pre autoipd -getent group avahi-autoipd >/dev/null || %{_sbindir}/groupadd -r avahi-autoipd -getent passwd avahi-autoipd >/dev/null || \ - %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi IPv4LL" \ - -d %{_localstatedir}/lib/avahi-autoipd -g avahi-autoipd \ - avahi-autoipd +%pre autoipd -f autoipd.pre %post autoipd %{fillup_only -ns avahi autoipd} @@ -866,6 +869,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service +%{_sysusersdir}/avahi.conf # Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces @@ -907,6 +911,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_sysconfdir}/avahi/avahi-autoipd.action %{_sysconfdir}/sysconfig/network/*/avahi-autoipd %{_fillupdir}/sysconfig.avahi-autoipd +%{_sysusersdir}/avahi-autoipd.conf %files utils %{_bindir}/avahi-browse* diff --git a/avahi.changes b/avahi.changes index 9950d5c..5f2ed39 100644 --- a/avahi.changes +++ b/avahi.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 21 13:05:58 UTC 2022 - Callum Farmer + +- Change to systemd-sysusers + ------------------------------------------------------------------- Mon Jan 17 17:12:07 UTC 2022 - Michael Gorse diff --git a/avahi.spec b/avahi.spec index 2bab135..49f373b 100644 --- a/avahi.spec +++ b/avahi.spec @@ -64,6 +64,8 @@ Source8: %{_name}_spec-prepare.sh Source9: avahi-autoipd.README.SUSE Source10: avahi-autoipd.if-up Source11: avahi-autoipd.if-down +Source13: avahi.sysusers +Source14: avahi-autoipd.sysusers # File missing from 0.8 tarball Source12: https://raw.githubusercontent.com/lathiat/avahi/master/service-type-database/build-db Source100: attributes @@ -100,6 +102,7 @@ BuildRequires: gdbm-devel BuildRequires: intltool BuildRequires: libdaemon-devel BuildRequires: libexpat-devel +BuildRequires: sysuser-tools # libtool is needed to build all variants: bootstrap is unconditional in the build section BuildRequires: libtool BuildRequires: pkgconfig @@ -118,7 +121,7 @@ BuildRequires: zlib-devel BuildRequires: pkgconfig(systemd) Requires: nss-mdns Requires: sudo -Requires(pre): shadow +%sysusers_requires # # mDNSResponder was used for <= 10.2: Provides: mDNSResponder = 107.5 @@ -302,8 +305,7 @@ Summary: IPv4LL Service for Zeroconf and Bonjour # coreutils contains /usr/bin/chown Group: Productivity/Networking/Other Requires(post): coreutils -# shadow contains useradd and groupadd -Requires(pre): shadow +%sysusers_requires Provides: avahi:%{_sbindir}/avahi-autoipd %description autoipd @@ -424,8 +426,12 @@ DNS specifications for Zeroconf Computing. -# This is the avahi-discover command, only provided for the primary python3 flavor + + + + +# This is the avahi-discover command, only provided for the primary python3 flavor %package -n python3-avahi-gtk Summary: A set of Avahi utilities written in Python Using python-gtk Group: Development/Languages/Python @@ -554,6 +560,8 @@ if ! test -f %{_datadir}/aclocal/glib-gettext.m4 ; then fi %build +%sysusers_generate_pre %{SOURCE13} avahi avahi.conf +%sysusers_generate_pre %{SOURCE14} autoipd avahi-autoipd.conf autoreconf -f -i intltoolize -f %{python_expand # configure for every python flavor @@ -690,6 +698,8 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcavahi-dnsconfd install -d %{buildroot}/%{_datadir}/pixmaps install -d %{buildroot}%{_fillupdir} install -m 644 sysconfig.avahi* %{buildroot}%{_fillupdir}/ +install -Dm0644 %{SOURCE13} %{buildroot}%{_sysusersdir}/avahi.conf +install -Dm0644 %{SOURCE14} %{buildroot}%{_sysusersdir}/avahi-autoipd.conf %if ! %{build_glib2} # Note: This file is intentionally installed here. It is needed for avahi-utils-gtk and python3-avahi-gtk: install -d %{buildroot}/%{_datadir}/avahi/interfaces @@ -741,9 +751,7 @@ strip-nondeterminism %{buildroot}/%{_prefix}/lib/monodoc/sources/*.zip %endif %fdupes %{buildroot}/%{_libdir} -%pre -getent group avahi >/dev/null || %{_sbindir}/groupadd -r avahi -getent passwd avahi >/dev/null || %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi" -d /run/avahi-daemon -g avahi avahi +%pre -f avahi.pre %service_add_pre avahi-dnsconfd.service avahi-daemon.service # bnc#853845,bnc#851953: do not start by default under # sysconfig as this breaks vlan,bridge,bonding setups @@ -768,12 +776,7 @@ fi %postun %service_del_postun avahi-dnsconfd.service avahi-daemon.service -%pre autoipd -getent group avahi-autoipd >/dev/null || %{_sbindir}/groupadd -r avahi-autoipd -getent passwd avahi-autoipd >/dev/null || \ - %{_sbindir}/useradd -r -s /bin/false -c "User for Avahi IPv4LL" \ - -d %{_localstatedir}/lib/avahi-autoipd -g avahi-autoipd \ - avahi-autoipd +%pre autoipd -f autoipd.pre %post autoipd %{fillup_only -ns avahi autoipd} @@ -861,6 +864,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_unitdir}/avahi-daemon.service %{_unitdir}/avahi-daemon.socket %{_unitdir}/avahi-dnsconfd.service +%{_sysusersdir}/avahi.conf # Common file for avahi-utils-gtk and python3-avahi-gtk: %dir %{_datadir}/avahi/ %{_datadir}/avahi/interfaces @@ -902,6 +906,7 @@ find %{_localstatedir}/lib/avahi-autoipd -user avahi -exec chown avahi-autoipd:a %{_sysconfdir}/avahi/avahi-autoipd.action %{_sysconfdir}/sysconfig/network/*/avahi-autoipd %{_fillupdir}/sysconfig.avahi-autoipd +%{_sysusersdir}/avahi-autoipd.conf %files utils %{_bindir}/avahi-browse* diff --git a/avahi.sysusers b/avahi.sysusers new file mode 100644 index 0000000..1ba4037 --- /dev/null +++ b/avahi.sysusers @@ -0,0 +1,2 @@ +#Type Name ID GECOS Home directory Shell +u avahi - "User for Avahi" /run/avahi-daemon -