File nitrokey-app2.spec of Package nitrokey-app2

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

%global use_python python3
%global UI_FILES_PATH nitrokeyapp/ui
%global pythons %{use_python}

Name:           nitrokey-app2
Version:        2.1.2
Release:        0
Summary:        Manage Nitrokey 3 devices
License:        Apache-2.0
URL:            https://github.com/Nitrokey/nitrokey-app2
Source:         %{name}-%{version}.tar.xz
BuildRequires:  cmake >= 3.1.0
BuildRequires:  hicolor-icon-theme
#BuildRequires:  nitropy
BuildRequires:  %{use_python}-flit
BuildRequires:  %{use_python}-pip
BuildRequires:  %{use_python}-wheel

# from pyproject.toml -> dependencies
BuildRequires:  python3-qt5-devel
BuildRequires:  %{use_python}-PyQt5
BuildRequires:  %{use_python}-pyudev
BuildRequires:  %{use_python}-pynitrokey >= 0.4.38
# BuildRequires:  %{use_python}-qt_material
# runtime
Requires:       %{use_python}-PyQt5
Requires:       %{use_python}-pyudev
Requires:       %{use_python}-pynitrokey >= 0.4.38
Requires:       %{use_python}-qt-material
# /pyproject.toml
%description
This application allows to manage Nitrokey 3 devices.

To manage Nitrokey Pro and Nitrokey Storage devices, use the older Nitrokey App.

%prep
%autosetup -p1

%build
# taken from the Makefile and converted to rpm
# Makefile section
# build-ui:
pyrcc5 %{UI_FILES_PATH}/resources.qrc -o %{UI_FILES_PATH}/resources_rc.py
for ui_file in %{UI_FILES_PATH}/*.ui ; do
  pyuic5 --from-imports ${ui_file} -o ${ui_file/.ui/.py}
done
# Makefile section
# build:
python3 -m flit build
# switch to our python macros for the rest
%pyproject_wheel

%install
%pyproject_install

%files
%license LICENSE
%doc *.md
%{_bindir}/nitrokeyapp
%{python3_sitelib}/nitrokeyapp/
%{python3_sitelib}/nitrokeyapp-%{version}.dist-info/

%changelog
openSUSE Build Service is sponsored by