Files
python-rofimoji/python-rofimoji.spec

97 lines
3.4 KiB
RPMSpec

#
# spec file for package python-rofimoji
#
# 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/
#
%define skip_python311 1
%define skip_python312 1
%define short_version %(echo %{version} | awk -F+ '{print $1}')
Name: python-rofimoji
Version: 6.7.0+git20250909.a2df29c
Release: 0
Summary: Simple character picker using rofi
License: MIT
URL: https://github.com/fdw/rofimoji
Source: rofimoji-%{version}.tar.gz
Source99: %{name}-rpmlintrc
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pip}
#BuildRequires: %%{python_module poetry-core >= 1.0.0}
BuildRequires: %{python_module hatchling}
BuildRequires: fdupes
Requires: python3-ConfigArgParse
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-rofimoji-manpage
BuildArch: noarch
%python_subpackages
%description
* Rofimoji: A character picker for rofi
* Do you want to use one of those fancy emojis? Or one of those other interesting characters Unicode offers? But you haven't found a good picker yet?
* Fear no more, `rofimoji` invokes the power of [rofi](https://github.com/DaveDavenport/rofi/) (and other dmenu-derivatives like [wofi](https://hg.sr.ht/~scoopta/wofi) or [fuzzel](https://codeberg.org/dnkl/fuzzel)) to give you exactly the picker you always wanted.
%package -n %{name}-manpage
Summary: Manpage for %{name}
Provides: python311-rofimoji-manpage
Provides: python312-rofimoji-manpage
Requires: python3-rofimoji = %{version}
Requires: man
Supplements: (%{name} and man)
BuildArch: noarch
%description -n %{name}-manpage
Manual page for %{name}.
%prep
%autosetup -p1 -n rofimoji-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/rofimoji
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand mkdir -vp %{buildroot}%{_mandir}/man1
%python_expand mkdir -vp %{buildroot}%{_defaultdocdir}/$python-rofimoji
%python_expand mv -v %{buildroot}%{$python_sitelib}/picker/docs/rofimoji.1 %{buildroot}%{_mandir}/man1/
%python_expand mv -v %{buildroot}%{$python_sitelib}/picker/docs/rofimoji.1.md %{buildroot}%{_defaultdocdir}/$python-rofimoji/
%python_expand rmdir -v %{buildroot}%{$python_sitelib}/picker/docs
%post
%python_install_alternative rofimoji
%postun
%python_uninstall_alternative rofimoji
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/rofimoji
### Not sure why it uses "picker" here, but it does ...
#%%{python_sitelib}/rofimoji
%{python_sitelib}/picker
#####
%{_defaultdocdir}/python%{python_version_nodots}-rofimoji/rofimoji.1.md
%dir %{python_sitelib}/rofimoji-%{short_version}.dist-info
%{python_sitelib}/rofimoji-%{short_version}.dist-info/*
%files -n %{name}-manpage
%doc %{_mandir}/man1/rofimoji.1%?ext_man
%changelog