File slimbookface.spec of Package slimbookface

#
# spec file for package slimbookface
#
# 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/
#


# exclude while 3.12 isn't default python in TW yet
%define skip_python312 1

Name:           slimbookface
Version:        1690285822.703b91c
Release:        0
Summary:        manage face recognition for PAM authentication
BuildArch:      noarch
License:        GPL-2.0
Group:          System/Management
URL:            https://github.com/Slimbook-Team/slimbookface
Source0:        %{name}-%{version}.tar.xz
Patch0:         %%{name}-howdy.patch
BuildRequires:  fdupes
BuildRequires:  python3-base
BuildRequires:  %{python_module gobject}
BuildRequires:  python3-dbus-python-devel
BuildRequires:  polkit
BuildRequires:  update-desktop-files

Requires:  python3-gobject
Requires:  python3-gobject-cairo
Requires:  python3-PIL
Requires:  libnotify-tools
Requires:  howdy

%description
Slimbook Face is an application that allows you to graphically manage 
multiple faces with https://github.com/boltgolt/howdy and enable PAM authentication 
throughout the system, or disable it at login, since login fails in 
some distributions or desktop environments (like KDE).

%prep
%setup -q
%autopatch -p1

%build
# nothing to do

%install
cd source/
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/%{name}/bin
mkdir -p %{buildroot}%{_datadir}/polkit-1/actions/
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/icons/hicolor
mkdir -p %{buildroot}%{_datadir}/%{name}/src/locale/it/LC_MESSAGES/
mkdir -p %{buildroot}%{_datadir}/%{name}/src/locale/es/LC_MESSAGES/
mkdir -p %{buildroot}%{_datadir}/%{name}/src/locale/en/LC_MESSAGES/

install -m 755 ./%{name} %{buildroot}/%{_bindir}
install -m 755 bin/%{name}-howdy-pkexec %{buildroot}/%{_bindir}
install -m 755 bin/*.sh %{buildroot}%{_datadir}/%{name}/bin/

cp src/locale/it_IT/LC_MESSAGES/*.mo %{buildroot}%{_datadir}/%{name}/src/locale/it/LC_MESSAGES/
cp src/locale/es_ES/LC_MESSAGES/*.mo %{buildroot}%{_datadir}/%{name}/src/locale/es/LC_MESSAGES/
cp src/locale/en_EN/LC_MESSAGES/*.mo %{buildroot}%{_datadir}/%{name}/src/locale/en/LC_MESSAGES/

cp src/%{name}.conf %{buildroot}%{_datadir}/%{name}
cp src/%{name}-howdy.py %{buildroot}%{_datadir}/%{name}

cp %{name}.desktop %{buildroot}%{_datadir}/applications/

cp -r src/images %{buildroot}%{_datadir}/%{name}/
mv %{buildroot}%{_datadir}/%{name}/images/icons/* %{buildroot}%{_datadir}/icons/hicolor/

chmod 644 ./*.desktop
chmod 755 src/*.py
cp -r src %{buildroot}%{_datadir}/%{name}/

install -m 644 policykit/* %{buildroot}%{_datadir}/polkit-1/actions/

%suse_update_desktop_file -i %{name} Utility System Settings

%fdupes %{buildroot}

%files
%license source/debian/copyright
%doc README.md
%{_bindir}/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/polkit-1/actions/*
%{_datadir}/applications/*
%{_datadir}/icons/*

%changelog
openSUSE Build Service is sponsored by