File hygg.spec of Package hygg

#
# spec file for package hygg
#
# Copyright (c) 2025 mantarimay
#
# 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/
#


%bcond_without test
%bcond_with server
%bcond_with online
Name:           hygg
Version:        0.1.17
Release:        0
Summary:        Simplifying the way you read
License:        AGPL-3.0-only
URL:            https://github.com/kruserr/hygg
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Source1:        vendor.tar.zst
BuildRequires:  cargo-packaging
BuildRequires:  openssl-devel

%description
A minimalistic Vim-like TUI document reader.

%if %{with server}
%package -n %{name}-server
Summary:        A less like CLI text reader - %{name} server

%description -n %{name}-server
A less like CLI text reader - %{name} server
%endif

%package -n cli-epub-to-text
Summary:        A CLI epub to plain text converter

%description -n cli-epub-to-text
A CLI epub to plain text converter

%package -n cli-pdf-to-text
Summary:        A CLI pdf to plain text converter

%description -n cli-pdf-to-text
A CLI pdf to plain text converter

%package -n cli-text-reader
Summary:        A less like CLI text reader - cli- text reader

%description -n cli-text-reader
A less like CLI text reader - cli text reader

%package -n cli-justify
Summary:        A CLI text justify tool

%description -n cli-justify
A CLI text justify tool

%prep
%autosetup -a1 -p1

%build
%{cargo_build}

%install
install -Dm755 target/release/%{name} -t %{buildroot}%{_bindir}
%if %{with server}
install -Dm755 target/release/%{name}-server -t %{buildroot}%{_bindir}
%endif
install -Dm755 target/release/cli-epub-to-text -t %{buildroot}%{_bindir}
install -Dm755 target/release/cli-pdf-to-text -t %{buildroot}%{_bindir}
install -Dm755 target/release/cli-text-reader -t %{buildroot}%{_bindir}
%if %{with online}
install -Dm755 target/release/cli-text-reader-online -t %{buildroot}%{_bindir}
%endif
install -Dm755 target/release/cli-justify -t %{buildroot}%{_bindir}

%if %{with test}
%check
%{cargo_test}
%endif

%files
%license LICENSE
%doc *.md
%{_bindir}/%{name}

%if %{with server}
%files -n %{name}-server
%{_bindir}/%{name}-server
%endif

%files -n cli-epub-to-text
%{_bindir}/cli-epub-to-text

%files -n cli-pdf-to-text
%{_bindir}/cli-pdf-to-text

%files -n cli-text-reader
%{_bindir}/cli-text-reader
%if %{with online}
%{_bindir}/cli-text-reader-online
%endif

%files -n cli-justify
%{_bindir}/cli-justify

%changelog
openSUSE Build Service is sponsored by