From 52b56f5647d84a7d0a60eef11ee59406a3bd98f1 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Jan 18 2022 23:22:19 +0000 Subject: Add conditionals for documentation generation and tests for EPEL 9 Signed-off-by: Michel Alexandre Salim --- diff --git a/autojump.spec b/autojump.spec index 06fbeec..09622de 100644 --- a/autojump.spec +++ b/autojump.spec @@ -1,8 +1,20 @@ +%if 0%{?el9} +%bcond_with check +%else +%bcond_without check +%endif + +%if 0%{?el9} +%bcond_with docs +%else +%bcond_without docs +%endif + %global owner wting Name: autojump Version: 22.5.3 -Release: 7%{?dist} +Release: 8%{?dist} Summary: A fast way to navigate your filesystem from the command line @@ -14,24 +26,29 @@ Patch1: install-add-distribution-arg.patch BuildArch: noarch +%if %{with docs} +BuildRequires: make BuildRequires: pandoc +%endif BuildRequires: python%{python3_pkgversion}-devel +%if %{with check} BuildRequires: python%{python3_pkgversion}-mock BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: make +%endif -%description +%global _description %{expand: autojump is a faster way to navigate your filesystem. It works by maintaining -a database of the directories you use the most from the command line. +a database of the directories you use the most from the command line.} + +%description %{_description} %package zsh Requires: %{name} = %{version}-%{release} Summary: Autojump for zsh -%description zsh -autojump is a faster way to navigate your filesystem. It works by maintaining -a database of the directories you use the most from the command line. +%description zsh %{_description} + autojump-zsh is designed to work with zsh. @@ -39,9 +56,8 @@ autojump-zsh is designed to work with zsh. Requires: %{name} = %{version}-%{release} Summary: Autojump for fish shell -%description fish -autojump is a faster way to navigate your filesystem. It works by maintaining -a database of the directories you use the most from the command line. +%description fish %{_description} + autojump-fish is designed to work with fish shell. @@ -54,8 +70,12 @@ sed -i 's|autojump_argparse|argparse|' bin/%{name} pathfix.py -i %{__python3} -pn . ./bin/* sed -i '1{/^#!/d}' bin/%{name}_*.py + %build +%if %{with docs} make docs +%endif + %install ./install.py --destdir %{buildroot} --prefix usr --zshshare %{buildroot}%{_datadir}/zsh/site-functions --distribution @@ -65,8 +85,12 @@ rm %{buildroot}%{_bindir}/%{name}_argparse.py mkdir -p %{buildroot}%{python3_sitelib} mv %{buildroot}%{_bindir}/%{name}_*.py %{buildroot}%{python3_sitelib}/ + +%if %{with check} %check %{__python3} -m pytest tests -vv +%endif + %files %license LICENSE @@ -89,7 +113,11 @@ mv %{buildroot}%{_bindir}/%{name}_*.py %{buildroot}%{python3_sitelib}/ %files fish %config(noreplace) %{_datadir}/%{name}/%{name}.fish + %changelog +* Tue Jan 18 2022 Michel Alexandre Salim - 22.5.3-8 +- Add conditionals for documentation generation and tests for EPEL 9 + * Wed Jul 21 2021 Fedora Release Engineering - 22.5.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild