%global commit 23b5aeaa43572a59e95fb00732292087b091d4a1 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20260118 %global forgeurl https://github.com/afewmail/afew %forgemeta Name: python-afew Version: 3.0.1^%{commitdate}git%{shortcommit} Release: %autorelease Summary: An initial tagging script for notmuch mail License: ISC URL: %{forgurl} Source: %{forgesource} BuildArch: noarch BuildRequires: python3-devel # Initial versioning BuildRequires: python3dist(setuptools) BuildRequires: python3dist(setuptools-scm) # Documentation BuildRequires: python3dist(sphinx) # Tests BuildRequires: python3dist(freezegun) BuildRequires: python3dist(pytest) %global _description %{expand: afew is an initial tagging script for notmuch mail: - http://notmuchmail.org/ - http://notmuchmail.org/initial_tagging/ Its basic task is to provide automatic tagging each time new mail is registered with notmuch. In a classic setup, you might call it after 'notmuch new' in an offlineimap post sync hook. It can do basic thing such as adding tags based on email headers or maildir folders, handling killed threads and spam. In move mode, afew will move mails between maildir folders according to configurable rules that can contain arbitrary notmuch queries to match against any searchable attributes.} %description %_description %package -n python3-afew Summary: %{summary} %description -n python3-afew %_description %prep %forgesetup export SETUPTOOLS_SCM_PRETEND_VERSION=3.0.1 SETUPTOOLS_SCM_PRETEND_VERSION=3.0.1 %python3 setup.py --version sed -i "s|use_scm_version={'write_to': 'afew/version.py'},|version='3.0.1',|g" setup.py %generate_buildrequires %pyproject_buildrequires %build export SETUPTOOLS_SCM_PRETEND_VERSION=3.0.1 %pyproject_wheel pushd docs PYTHONPATH="%{_pyproject_wheeldir}:$PYTHONPATH" sphinx-build -b man . man popd %install %pyproject_install # Add top-level Python module names here as arguments, you can use globs %pyproject_save_files -l afew mkdir -p %{buildroot}%{_mandir}/man1 install -m0644 docs/man/afew.1 %{buildroot}%{_mandir}/man1/ %check %pyproject_check_import -t %pytest %files -n python3-afew -f %{pyproject_files} %doc README.rst %doc NEWS.md %{_bindir}/afew %{_mandir}/man1/afew.1* %changelog %autochangelog