File howdy.spec of Package howdy

#
# spec file for package howdy
#
# Copyright (c) 2025 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/
#


Name:           howdy
Version:        3.0.0~git20250622.d3ab993
Release:        0
Summary:        Windows Helloâ„¢ style authentication for Linux
License:        MIT
URL:            https://github.com/boltgolt/howdy
Source0:        %{name}-%{version}.tar.zst
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  meson
BuildRequires:  ninja
BuildRequires:  pam-devel
BuildRequires:  polkit
BuildRequires:  python3
BuildRequires:  python3-devel
BuildRequires:  python3-dlib
BuildRequires:  python3-gobject
BuildRequires:  pkgconfig(INIReader)
BuildRequires:  pkgconfig(libevdev)
Requires:       ffmpeg
Requires:       pam-python3
Requires:       python3-dlib
Requires:       python3-numpy
Requires:       python3-opencv

%description
Windows Hello style authentication for Linux. Use your built-in IR emitters
and camera in combination with face recognition to prove who you are.

%package gtk
Summary:        Gtk UI for Howdy
BuildArch:      noarch
Requires:       %{name} = %{version}
Requires:       polkit
Requires:       python3-elevate
Requires:       python3-gobject
Requires:       python3-gobject-Gdk

%description gtk
Windows Hello style authentication for Linux. Use your built-in IR emitters
and camera in combination with face recognition to prove who you are.

This package provides a Gtk UI for configuring Howdy.

%prep
%autosetup -p1
( cd ./howdy/src/dlib-data/ ; ln %{_sourcedir}/*.bz2 . ; bzip2 -d -f *.bz2 )

# Delete hashbangs from files not installed to PATH
sed -Ei '1{\@^#!/usr/bin/env python3@d}' \
  ./howdy/src/cli.py \
  ./howdy/src/compare.py \
  ./howdy-gtk/src/init.py

%build
%meson \
  -Dpam_dir=%{_pam_moduledir} \
  -Dinstall_in_site_packages=true \
  -Dpython_path=%{_bindir}/python%{python3_version} \
  -Dwith_polkit=true \
%if 0%{suse_version} < 1600
  -Dpython.purelibdir=%{python3_sitelib} \
%endif
%{nil}
%meson_build

%install
%meson_install

# Install necessary data files
cp ./howdy/src/dlib-data/*.dat %{buildroot}%{_datadir}/dlib-data/

# No longer needed for user as package will install the data files
rm %{buildroot}%{_datadir}/dlib-data/{Readme.md,install.sh}

chmod -x \
  %{buildroot}%{_sysconfdir}/howdy/config.ini \
  %{buildroot}%{python3_sitelib}/howdy/cli.py \
  %{buildroot}%{python3_sitelib}/howdy-gtk/init.py \
  %{nil}

%files
%license LICENSE
%doc README.md
%config %{_sysconfdir}/howdy/
%{_bindir}/howdy
%{_pam_moduledir}/pam_howdy.so
%{python3_sitelib}/howdy/
%{_datadir}/bash-completion/completions/howdy
%{_datadir}/dlib-data/
%{_datadir}/howdy/
%{_mandir}/man1/%{name}.1%{?ext_man}

%files gtk
%license LICENSE
%doc README.md
%{_bindir}/howdy-gtk
%{_datadir}/howdy-gtk/
%{_datadir}/polkit-1/actions/*.policy
%{python3_sitelib}/howdy-gtk/

%changelog
openSUSE Build Service is sponsored by