File swaylock.spec of Package swaylock-effects

#
# spec file for package swaylock
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define program_name swaylock
Name:           swaylock-effects
Version:        v1.7.2
Release:        0
Summary:        Swaylock, with fancy effects 
License:        MIT
Group:          System/GUI/Other
URL:            https://github.com/jirutka/%{program_name}-effects
Source0:        %{program_name}-%{version}.tar.gz
BuildRequires:  meson >= 0.48.0
BuildRequires:  pam-devel
BuildRequires:  pkgconfig
BuildRequires:  scdoc
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-protocols) >= 1.14
BuildRequires:  pkgconfig(xkbcommon)
Suggests:       %{program_name}-bash-completion
Suggests:       %{program_name}-fish-completion
Suggests:       %{program_name}-zsh-completion
Conflicts:      sway < 1.0
Conflicts:      swaylock

%description
Swaylock-effects is a fork of swaylock which 
adds built-in screenshots and image manipulation 
effects like blurring. It's inspired by i3lock-color, 
although the feature sets aren't perfectly overlapping.

%package bash-completion
Summary:        Bash completion for %{program_name}
Group:          System/Shells
Requires:       %{program_name} = %{version}
BuildArch:      noarch
Conflicts:      swaylock-bash-completion

%description bash-completion
Bash command line completion support for %{program_name}.

%package fish-completion
Summary:        Fish completion for %{program_name}
Group:          System/Shells
Requires:       %{program_name} = %{version}
BuildArch:      noarch
Conflicts:      swaylock-fish-completion

%description fish-completion
Fish command line completion support for %{program_name}.

%package zsh-completion
Summary:        Zsh completion for %{program_name}
Group:          System/Shells
Requires:       %{program_name} = %{version}
BuildArch:      noarch
Conflicts:      sway < 1.0
Conflicts:      swaylock-zsh-completion

%description zsh-completion
Zsh command line completion support for %{program_name}.

%prep
%setup -q -n %{program_name}-%{version}

%build
export CFLAGS="%{optflags} -I/usr/include/wayland"
%meson
%meson_build

%install
%meson_install
%if 0%{?suse_version} > 1500
mkdir -p %{buildroot}%{_pam_vendordir}
mv %{buildroot}%{_sysconfdir}/pam.d/swaylock %{buildroot}%{_pam_vendordir}

%pre
# Prepare for migration to /usr/lib; save any old .rpmsave
for i in pam.d/swaylock ; do
     test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
done

%posttrans
# Migration to /usr/lib, restore just created .rpmsave
for i in pam.d/swaylock ; do
     test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif

%files
%{_bindir}/swaylock
%if 0%{?suse_version} > 1500
%{_pam_vendordir}/swaylock
%else
%config %{_sysconfdir}/pam.d/swaylock
%endif
%{_mandir}/man1/swaylock.1%{?ext_man}

%files bash-completion
%dir %{_datadir}/bash-completion/
%{_datadir}/bash-completion/completions

%files fish-completion
%dir %{_datadir}/fish/
%{_datadir}/fish/vendor_completions.d/

%files zsh-completion
%dir %{_datadir}/zsh/
%{_datadir}/zsh/site-functions

%changelog
openSUSE Build Service is sponsored by