File lfm.spec of Package lfm

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


%define skip_python2 1
Name:           lfm
Version:        3.1
Release:        0
Summary:        File Manager for the Console
License:        GPL-3.0-only
Group:          Productivity/File utilities
URL:            https://inigo.katxi.org/devel/lfm/
# http://lfm.googlecode.com/files/lfm-%%{version}.tar.gz
Source:         https://inigo.katxi.org/devel/lfm/lfm-%{version}.tar.gz
Source1:        lfm.desktop
Source99:       %{name}-rpmlintrc
BuildRequires:  %{python_module devel >= 3.4}
BuildRequires:  %{python_module setuptools}
BuildRequires:  perl
BuildRequires:  python-rpm-macros
BuildRequires:  update-desktop-files
Requires:       python >= 3.4
Provides:       pyview = %{version}-%{release}
BuildArch:      noarch

%description
Lfm is a curses-based file manager for the Unix console written in Python.

%prep
%setup -q
sed -i -e 's|/bin/env python3|%{_bindir}/python%{python_bin_suffix}|g' lfm/lfm
sed -i -e 's|/bin/env python3|%{_bindir}/python%{python_bin_suffix}|g' lfm/lfm.py

%build
%python_build

%install
%python_install
mkdir %{buildroot}%{_sysconfdir}
pushd %{buildroot}%{_sysconfdir}
ln -sf %{python_sitelib}/lfm/etc/lfm-default.keys lfm-default.keys
ln -sf %{python_sitelib}/lfm/etc/lfm-default.theme lfm-default.theme
popd
install -D -m0644 "%{SOURCE1}" "%{buildroot}%{_datadir}/applications/%{name}.desktop"
%suse_update_desktop_file -r "%{name}" System FileManager

%files
%license COPYING
%doc NEWS README* TODO
%config(noreplace) %{_sysconfdir}/lfm-default.keys
%config(noreplace) %{_sysconfdir}/lfm-default.theme
%{_bindir}/lfm
%{_mandir}/man1/lfm.1%{?ext_man}
%{_datadir}/applications/%{name}.desktop
%{python_sitelib}/lfm
%{python_sitelib}/lfm-%{version}-py%{python_bin_suffix}.egg-info
%pycache_only %{python_sitelib}/lfm/__pycache__

%changelog
openSUSE Build Service is sponsored by