File suse-distro-check.spec of Package suse-distro-check

#
# spec file for package python-sybil
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%{?!python_module:%define python_module() python-%{**} python311-%{**}}
# must be a single on or the rest of spec file won't work
%define pythons python312

Name:           suse-distro-check
Version:        0.0.1
Release:        0
Summary:        Repository State Validation Tool
License:        GPL-3.0-or-later
Group:          Development/Languages/Python
Url:            https://github.com/adrianschroeter/suse-distro-blockchain
Source:         https://github.com/adrianschroeter/suse-distro-blockchain-%{version}.tar.xz

BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module termcolor}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module web3}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires: %pythons-termcolor
Requires: %pythons-web3
BuildArch:     noarch

%systemd_requires

%description
Validate the state of your local registered zypper repositories.

%prep
%autosetup -p1 -n suse-distro-blockchain-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
mkdir -p %{buildroot}%{_bindir}
mv %buildroot%{python_sitelib}/suse-distro-blockchain/suse-distro-check.py \
   %{buildroot}%{_bindir}/suse-distro-check
chmod 0755 %{buildroot}%{_bindir}/suse-distro-check
sed -i 's,^#!/usr/bin.*,#!/usr/bin/python3.12,' %{buildroot}%{_bindir}/suse-distro-check

mkdir -p '%{buildroot}'/etc
install -D -m 644 suse-distro-check.conf %{buildroot}/etc/

%files
%doc README.md
%license LICENSE
%{_bindir}/suse-distro-check
%python_sitelib/suse-distro-blockchain
%python_sitelib/suse_distro_blockchain-*.dist-info
# NOT (noreplace) atm since contract addresses are still changing
%config /etc/*

%changelog
openSUSE Build Service is sponsored by