From 2e30d0cd8c5b5a5be150ecc39bd3ba329f65c43b Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Wed, 5 Jul 2023 16:11:33 +0200 Subject: [PATCH] - fix mtxrun stub - patch texmfcnf.lua - fix mptopdf.pl and thumbpdf.pl to have proper interpreter lines --- texlive-base-20230311-fix-scripts.patch | 20 +++++++++ texlive-fedora-texmfcnf.lua.patch | 59 +++++++++++++++++++++++++ texlive.spec | 23 ++++++++-- 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 texlive-base-20230311-fix-scripts.patch create mode 100644 texlive-fedora-texmfcnf.lua.patch diff --git a/texlive-base-20230311-fix-scripts.patch b/texlive-base-20230311-fix-scripts.patch new file mode 100644 index 0000000..6370ef6 --- /dev/null +++ b/texlive-base-20230311-fix-scripts.patch @@ -0,0 +1,20 @@ +diff -up ./scripts/context/perl/mptopdf.pl.fix-scripts ./scripts/context/perl/mptopdf.pl +--- ./scripts/context/perl/mptopdf.pl.fix-scripts 2023-05-25 11:52:19.149713294 -0400 ++++ ./scripts/context/perl/mptopdf.pl 2023-05-25 11:53:05.379317240 -0400 +@@ -1,5 +1,4 @@ +-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' +- if 0; ++#! /usr/bin/perl -w + + # MikTeX users can set environment variable TEXSYSTEM to "miktex". + +diff -up ./scripts/thumbpdf/thumbpdf.pl.fix-scripts ./scripts/thumbpdf/thumbpdf.pl +--- ./scripts/thumbpdf/thumbpdf.pl.fix-scripts 2023-05-25 11:53:23.018547680 -0400 ++++ ./scripts/thumbpdf/thumbpdf.pl 2023-05-25 11:53:44.086822918 -0400 +@@ -1,5 +1,4 @@ +-eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' +- if 0; ++#! /usr/bin/perl -w + use strict; + $^W=1; # turn warning on + # diff --git a/texlive-fedora-texmfcnf.lua.patch b/texlive-fedora-texmfcnf.lua.patch new file mode 100644 index 0000000..42607b9 --- /dev/null +++ b/texlive-fedora-texmfcnf.lua.patch @@ -0,0 +1,59 @@ +diff -up ./web2c/texmfcnf.lua.fedora ./web2c/texmfcnf.lua +--- ./web2c/texmfcnf.lua.fedora 2023-05-25 10:25:41.195939763 -0400 ++++ ./web2c/texmfcnf.lua 2023-05-25 10:33:33.761097942 -0400 +@@ -11,6 +11,7 @@ return { + comment = "ConTeXt MkIV and LMTX configuration file", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + target = "texlive", ++ -- modified for Fedora, based on Preining Norbert's work in Debian + + content = { + +@@ -52,7 +53,7 @@ return { + + TEXMFVAR = "home:" .. hiddentexlivepath .. "/texmf-var", + TEXMFCONFIG = "home:" .. hiddentexlivepath .. "/texmf-config", +- TEXMFSYSVAR = "selfautoparent:texmf-var", ++ TEXMFSYSVAR = "/var/lib/texmf", + TEXMFCACHE = "$TEXMFSYSVAR;$TEXMFVAR", + + -- I don't like this texmf under home and texmf-home would make more sense. One never knows +@@ -62,7 +63,7 @@ return { + -- By using prefixes we don't get expanded paths in the cache __path__ entry. This makes the + -- tex root relocatable. + +- TEXMFOS = "selfautodir:", ++ -- TEXMFOS = "selfautodir:", + + -- standalone: + +@@ -73,14 +74,15 @@ return { + + -- texlive: + +- TEXMFDIST = "selfautoparent:texmf-dist", +- TEXMFSYSCONFIG = "selfautoparent:texmf-config", ++ TEXMFDIST = "/usr/share/texlive/texmf-dist", ++ TEXMFFEDORA = "/usr/share/texmf", ++ TEXMFSYSCONFIG = "/usr/share/texlive/texmf-config", + + -- The texmf-local path is only used for (maybe) some additional configuration file. + +- TEXMFLOCAL = "selfautoparent:texmf-local", +- TEXMFFONTS = "selfautoparent:texmf-fonts", +- TEXMFPROJECT = "selfautoparent:texmf-project", ++ TEXMFLOCAL = "/usr/share/texlive/texmf-local", ++ -- TEXMFFONTS = "selfautoparent:texmf-fonts", ++ -- TEXMFPROJECT = "selfautoparent:texmf-project", + + TEXMFHOME = "home:texmf", + -- TEXMFHOME = os.name == "macosx" and "home:Library/texmf" or "home:texmf", +@@ -94,7 +96,7 @@ return { + + -- texlive: + +- TEXMF = "{$TEXMFCONFIG,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFPROJECT,!!$TEXMFFONTS,!!$TEXMFLOCAL,!!$TEXMFDIST}", ++ TEXMF = "{$TEXMFCONFIG,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFFEDORA,!!$TEXMFDIST}", + + TEXFONTMAPS = ".;$TEXMF/fonts/data//;$TEXMF/fonts/map/{pdftex,dvips}//", + ENCFONTS = ".;$TEXMF/fonts/data//;$TEXMF/fonts/enc/{dvips,pdftex}//", diff --git a/texlive.spec b/texlive.spec index 7842235..370a0f3 100644 --- a/texlive.spec +++ b/texlive.spec @@ -26,7 +26,7 @@ Name: texlive Version: %{source_date} -Release: 7%{?dist} +Release: 8%{?dist} Epoch: %{tl_epoch} Summary: TeX formatting system Group: Applications/Publishing @@ -803,6 +803,12 @@ Patch37: texlive-base-libpaperv2.patch # Fix issue where off_t could be set incorrectly on i686 due to order of header load Patch44: texlive-base-20220321-pdf-header-order-fix.patch +# Fix texmfcnf.lua for Fedora layout (thanks to Preining Norbert) +Patch45: texlive-fedora-texmfcnf.lua.patch + +# Fix interpreter on perl scripts (thanks again to Debian) +Patch46: texlive-base-20230311-fix-scripts.patch + # luatex CVE-2023-32700 Patch50: texlive-2023-luatex-CVE-2023-32700.patch @@ -24396,7 +24402,7 @@ pushd %{buildroot}%{_bindir} rm -f mtxrun cat > mtxrun << EOF #!/bin/sh -env LUATEXDIR=/usr/shared/texlive/texmf-dist/scripts/context/lua luatex --luaonly mtxrun.lua "\$@" +env LUATEXDIR=/usr/share/texlive/texmf-dist/scripts/context/lua luatex --luaonly mtxrun.lua "\$@" EOF chmod 0755 mtxrun popd @@ -25248,6 +25254,12 @@ xz -dc %{SOURCE5717} | tar x -C %{buildroot}%{_texdir}/texmf-dist pushd %{buildroot}%{_texdir}/texmf-dist # neuter tlmgr a bit patch -p1 < %{_sourcedir}/texlive-20190410-tlmgr-ignore-warning.patch + +# Fix texmfcnf.lua +patch -p1 < %{_sourcedir}/texlive-fedora-texmfcnf.lua.patch + +# Fix interpreter on perl scripts +patch -p1 < %{_sourcedir}/texlive-base-20230311-fix-scripts.patch popd # We want the texmf.cnf we patched, not the vanilla one from the kpathsea.tar.xz @@ -25273,7 +25285,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/texlive/web2c mkdir -p %{buildroot}%{_sysconfdir}/texlive/dvips/config mkdir -p %{buildroot}%{_sysconfdir}/texlive/tex/generic/config -for i in mktex.cnf texmf.cnf updmap.cfg; do +for i in mktex.cnf texmfcnf.lua texmf.cnf updmap.cfg; do mv %{buildroot}%{_texdir}/texmf-dist/web2c/$i %{buildroot}%{_sysconfdir}/texlive/web2c/ ln -s %{_sysconfdir}/texlive/web2c/$i %{buildroot}%{_texdir}/texmf-dist/web2c/$i done @@ -28287,6 +28299,11 @@ yes | %{_bindir}/updmap-sys --quiet --syncwithtrees >/dev/null 2>&1 || : %{_texdir}/texmf-dist/tex/latex/hopatch %changelog +* Wed Jul 05 2023 Than Ngo - 12:20230311-8 +- fix mtxrun stub +- patch texmfcnf.lua +- fix mptopdf.pl and thumbpdf.pl to have proper interpreter lines + * Tue Jun 27 2023 Than Ngo - 12:20230311-7 - fix deps, hopatch.sty was moved from oberdiek into seperates packages