Add tectonic (I guess)

This commit is contained in:
windowsboy111
2022-11-01 14:02:25 +08:00
committed by GitHub
parent e71c419452
commit 7a213a3c52
7 changed files with 49 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
project "pkg" {
rpm {
spec = "tectonic.spec"
sources = "."
}
}
+19
View File
@@ -0,0 +1,19 @@
import os
import requests
import re
NAME = 'tectonic'
REPO = "tectonic-typesetting/tectonic"
REGEX_VER = r'Version:\s*([\.\d]+)\n'
SPEC = f"{NAME}.spec"
LINK = f'https://api.github.com/repos/{REPO}/releases/latest'
ver = requests.get(LINK).json()['tag_name']
with open(SPEC, 'r') as f:
matches = re.findall(REGEX_VER, f.read())
if not len(matches): exit(f"{NAME}: Failed to match regex!")
cur = matches[0]
if ver == cur: exit(f'{NAME}: Up to date!')
print(f'{NAME}: {cur} -> {ver}')
os.system(f'rpmdev-bumpspec -n {ver} {SPEC}')
+24
View File
@@ -0,0 +1,24 @@
Name: tectonic
Version: 0.12.0
Release: %autorelease
Summary: A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive
URL: https://github.com/tectonic-typesetting/tectonic
License: MIT
Source0: %{url}/archive/refs/tags/tectonic@%{version}.tar.gz
Requires: r-openssl harfbuzz-icu libpng freetype graphite2 zlib fontconfig
BuildRequires: cargo gcc gcc-c++ mold
%description
Tectonic is a modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
%build
cargo build
%install
cargo install
%files
%doc README.md
%license LICENSE