File pqm.spec of Package pqm

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

%if 0%{?suse_version} >= 1600
%global use_python python3
%else
%global use_python python311
%endif

Name:           pqm
Version:        0.3
Release:        0
Summary:        Postfix (cluster) queue manager
License:        MIT
URL:            https://git-nks-public.tik.uni-stuttgart.de/mail/pqm 
Source0:        %{name}-%{version}.tar.zst 
BuildRequires:  zstd
BuildRequires:  python-rpm-macros
BuildRequires:  %{use_python} >= 3.10
BuildRequires:  %{use_python}-trio
BuildRequires:  %{use_python}-pyparsing
BuildRequires:  %{use_python}-PyYAML
Requires:       %{use_python} >= 3.10
Requires:       %{use_python}-trio
Requires:       %{use_python}-pyparsing
Requires:       %{use_python}-PyYAML
BuildArch:      noarch
%description
CLI tool to manage postfix queues (optionally across multiple hosts through
ssh).

It uses trio for asynchronous operations (i.e. parallel handling of many nodes
in a cluster).

It also has proper readline support with history of commands.

%prep
%autosetup -p1

%build
%python3_fix_shebang_path %{name}
# perl -p -i -e 's|^|#|g' pqm.example.yaml

%install
install -D -m 0755 %{name} %{buildroot}%{_sbindir}/%{name}
install -D -m 0640 /dev/null %{buildroot}%{_sysconfdir}/pqm.yaml

%files
%license LICENSE
%doc README.md
%doc pqm.example.yaml
%{_sbindir}/%{name}
%ghost %config(noreplace) %attr(0640,root,root) %{_sysconfdir}/pqm.yaml

%changelog
openSUSE Build Service is sponsored by