File nautilus-open-any-terminal.spec of Package nautilus-open-any-terminal

#
# spec file for package nautilus-open-any-terminal
#
# Copyright (c) 2022 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 pythons python3
Name:           nautilus-open-any-terminal
Version:        0.6.2
Release:        0
Summary:        New variable terminal entry in contextmenu
License:        GPL-3.0
URL:            https://github.com/Stunkymonkey/nautilus-open-any-terminal
Source:         https://files.pythonhosted.org/packages/source/n/nautilus-open-any-terminal/nautilus_open_any_terminal-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module pip}
BuildRequires:  fdupes
BuildArch:      noarch

%description
New variable terminal entry in contextmenu

%package -n caja-open-any-terminal
Summary:        New variable terminal entry in contextmenu for caja
Requires:       %{name}-%{version}

%description -n caja-open-any-terminal
%{description}.

%prep
%autosetup -n nautilus_open_any_terminal-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
# Fix locale
mv %{buildroot}%{python3_sitelib}/nautilus_open_any_terminal/locale %{buildroot}%{_datadir}/locale
%find_lang %{name}
pushd %{buildroot}%{_datadir}/locale/
mkdir %{buildroot}%{python3_sitelib}/nautilus_open_any_terminal/locale/
ls | while read -r f; do
    if ( echo "$f" | grep -q '\.py$' ); then
        mv -f "$f" %{buildroot}%{python3_sitelib}/nautilus_open_any_terminal/locale/
    else
        ln -s "%{_datadir}/locale/$f" \
          "%{buildroot}%{python3_sitelib}/nautilus_open_any_terminal/locale/$f"
    fi
done
popd
%fdupes %{buildroot}%{python_sitelib}/

%files -f %{name}.lang
%doc README.md
%license LICENSE
%{python_sitelib}/*
%dir %{_datadir}/glib-2.0
%dir %{_datadir}/glib-2.0/schemas
%dir %{_datadir}/nautilus-python
%dir %{_datadir}/nautilus-python/extensions
%{_datadir}/glib-2.0/schemas/*.gschema.xml
%{_datadir}/nautilus-python/extensions/nautilus_open_any_terminal.py

%files -n caja-open-any-terminal
%dir %{_datadir}/caja-python/
%dir %{_datadir}/caja-python/extensions
%{_datadir}/caja-python/extensions/nautilus_open_any_terminal.py

%changelog
openSUSE Build Service is sponsored by