Blob Blame History Raw
# As of 2021-08-11, mkdocs and many of its dependencies are orphaned.
%bcond_with mkdocs

Name:           jrnl
Version:        2.8.3
Release:        %autorelease
Summary:        A simple journal application for the command line

License:        GPLv3
URL:            https://%{name}.sh
%global forgeurl https://github.com/%{name}-org/%{name}/
Source0:        %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel

BuildRequires:  help2man

%description
%{name} is a simple journal application for the command line.

You can use it to easily create, search, and view journal entries. Journals are
stored as human-readable plain text, and can also be encrypted using AES
encryption.


%package doc
Summary:        Documentation for %{name}

%if %{with mkdocs}
BuildRequires:  mkdocs
%endif

%description doc
The %{name}-doc package contains detailed documentation for %{name}.


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


%generate_buildrequires
%pyproject_buildrequires -x testing


%build
%pyproject_wheel

# https://github.com/jrnl-org/jrnl/issues/74
# https://github.com/jrnl-org/jrnl/issues/1274
help2man --no-info '%{python3} -m %{name}' --output='%{name}.1'

%if %{with mkdocs}
mkdocs build
%endif


%install
%pyproject_install
%pyproject_save_files %{name}

install -D -t '%{buildroot}%{_mandir}/man1' -p -m 0644 '%{name}.1'


%check
export PYTHONPATH="${PWD}:%{buildroot}%{python3_sitelib}"
%pytest tests/unit
%pytest tests/bdd --gherkin-terminal-reporter


%files -f %{pyproject_files}
%license LICENSE.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*


%files doc
%license LICENSE.md
%doc CHANGELOG.md
%doc CODE_OF_CONDUCT.md
%doc CONTRIBUTING.md
%doc README.md
%if %{with mkdocs}
%doc site/
%else
%doc docs/
%endif


%changelog
%autochangelog