typst/typst.spec
Sergey Zhemoytel 39b58e1da9 0.5.0
2023-07-04 11:56:23 +00:00

58 lines
1.3 KiB
RPMSpec

%define rustver 1.70.0
%define debug %nil
%define debug_package %nil
Name: typst
Version: 0.5.0
Release: 1
Summary: Markup-based typesetting system
URL: https://typst.app
Source0: https://github.com/typst/typst/archive/v%{version}/%{name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
License: ASL 2.0
Group: Development/Other
%if %{mdvver} > 201610
BuildRequires: rust
BuildRequires: cargo
%else
BuildRequires: curl
%endif
BuildRequires: upx
%description
Typst is a new markup-based typesetting system that is
designed to be as powerful as LaTeX while being much
easier to learn and use. Typst has:
- Built-in markup for the most common formatting tasks
- Flexible functions for everything else
- A tightly integrated scripting system
- Math typesetting, bibliography management, and more
- Fast compile times thanks to incremental compilation
- Friendly error messages in case something goes wrong
%prep
%setup -q
%if %{mdvver} <= 201610
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |\
sh -s -- -y --profile default --default-toolchain %{rustver}
%endif
%build
%if %{mdvver} <= 201610
source "$HOME/.cargo/env"
%endif
cargo build --release
upx target/release/%{name}
%install
install -Dm0755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
%files
%doc README.md LICENSE docs
%{_bindir}/%{name}