From cdb36fb4bbe8b38769812f2d5b0f22c448ae5a614dde157ad90256277f8f16c2 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 31 Oct 2023 16:22:04 +0000 Subject: [PATCH] avoid combining && and || drop init-dir OBS-URL: https://build.opensuse.org/package/show/network:ldap/sssd?expand=0&rev=293 --- sssd.spec | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sssd.spec b/sssd.spec index 9c6d260..33dad27 100644 --- a/sssd.spec +++ b/sssd.spec @@ -96,7 +96,7 @@ Obsoletes: libsss_sudo < %version-%release %define ldbdir %(pkg-config ldb --variable=modulesdir) # Both SSSD and cifs-utils provide an idmap plugin for cifs.ko -# /etc/cifs-utils/idmap-plugin should be a symlink to one of the 2 idmap plugins +# %_sysconfdir/cifs-utils/idmap-plugin should be a symlink to one of the 2 idmap plugins # * cifs-utils one is the default (priority 20) # * installing SSSD should NOT switch to SSSD plugin (priority 10) %define cifs_idmap_plugin %_sysconfdir/cifs-utils/idmap-plugin @@ -117,7 +117,7 @@ services for projects like FreeIPA. Summary: The ActiveDirectory backend plugin for sssd License: GPL-3.0-or-later Group: System/Daemons -Requires: %name-krb5-common = %{version}-%{release} +Requires: %name-krb5-common = %version-%release Requires: adcli %description ad @@ -163,7 +163,7 @@ caches. Summary: The Kerberos authentication backend plugin for sssd License: GPL-3.0-or-later Group: System/Daemons -Requires: %name-krb5-common = %{version}-%{release} +Requires: %name-krb5-common = %version-%release %description krb5 Provides the Kerberos back end that the SSSD can utilize authenticate @@ -183,7 +183,7 @@ use for Kerberos user or host authentication. Summary: The LDAP backend plugin for sssd License: GPL-3.0-or-later Group: System/Daemons -Requires: %name-krb5-common = %{version}-%{release} +Requires: %name-krb5-common = %version-%release %description ldap Provides the LDAP back end that the SSSD can utilize to fetch @@ -202,7 +202,7 @@ and/or PAM modules to leverage SSSD caching. Summary: Commandline tools for sssd License: GPL-3.0-or-later AND LGPL-3.0-or-later Group: System/Management -Requires: python3-sssd-config = %{version}-%{release} +Requires: python3-sssd-config = %version-%release Requires: sssd = %version %description tools @@ -358,7 +358,6 @@ autoreconf -fiv --with-pipe-path="%pipepath" \ --with-pubconf-path="%pubconfpath" \ --with-gpo-cache-path="%gpocachepath" \ - --with-init-dir="%_initrddir" \ --with-environment-file="%_sysconfdir/sysconfig/sssd" \ --with-initscript=systemd \ --with-syslog=journald \ @@ -378,7 +377,7 @@ autoreconf -fiv %install # sss_obfuscate is compatible with both python 2 and 3 perl -i -lpe 's{%_bindir/python\b}{%_bindir/python3}' src/tools/sss_obfuscate -%make_install dbuspolicydir=%{_datadir}/dbus-1/system.d +%make_install dbuspolicydir=%_datadir/dbus-1/system.d b="%buildroot" # Copy some defaults @@ -411,7 +410,9 @@ ln -sfv %_sysconfdir/alternatives/%cifs_idmap_name %buildroot/%cifs_idmap_plugin %if 0%{?suse_version} > 1500 # Prepare for migration to /usr/etc; save any old .rpmsave for i in pam.d/sssd-shadowutils logrotate.d/sssd ; do - test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: + if [ -f "%_sysconfdir/$i.rpmsave" ]; then + mv -v "%_sysconfdir/$i.rpmsave" "%_sysconfdir/$i.rpmsave.old" || : + fi done %endif @@ -450,7 +451,7 @@ fi %post -n libsss_nss_idmap0 -p /sbin/ldconfig %postun -n libsss_nss_idmap0 -p /sbin/ldconfig -%triggerun -- %{name} < %{version}-%{release} +%triggerun -- %name < %version-%release # sssd takes care of upgrading the database but it doesn't handle downgrades. # Clear caches when downgrading the package, which may have an # incompatible format afterwards preventing the daemon from startup. @@ -487,7 +488,9 @@ fi %posttrans # Migration to /usr/etc, restore just created .rpmsave for i in logrotate.d/sssd pam.d/sssd-shadowutils ; do - test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: + if [ -f "%_sysconfdir/$i.rpmsave" ]; then + mv -v "%_sysconfdir/$i.rpmsave" "%_sysconfdir/$i.rpmsave.old" || : + fi done %endif @@ -579,7 +582,7 @@ done %_datadir/%name/sssd.api.conf %dir %_datadir/%name/sssd.api.d/ %_datadir/%name/sssd.api.d/sssd-simple.conf -%exclude /usr/share/man/*/*/sssd-files.5.gz +%exclude %_mandir/*/*/sssd-files.5.gz # # sssd-client #