slackware-current/patches/source/ghostscript/dump.unused.internal.libraries.from.sources.sh
Patrick J Volkerding 9f285815b9 Thu Mar 7 20:40:08 UTC 2024
patches/packages/ghostscript-9.55.0-x86_64-2_slack15.0.txz:  Rebuilt.
  Fixes security issues:
  A vulnerability was identified in the way Ghostscript/GhostPDL called
  tesseract for the OCR devices, which could allow arbitrary code execution.
  Thanks to J_W for the heads-up.
  Mishandling of permission validation for pipe devices could allow arbitrary
  code execution.
  For more information, see:
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-36664
  (* Security fix *)
2024-03-08 13:30:42 +01:00

21 lines
948 B
Bash
Executable file

#!/bin/sh
# Repacks the ghostscript tarball to remove old unmaintained libraries.
# The SlackBuild would remove them before building anyway, but this way
# we don't waste bandwidth and storage on useless junk.
VERSION=${VERSION:-$(echo ghostscript-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
tar xf ghostscript-${VERSION}.tar.xz || exit 1
mv ghostscript-${VERSION}.tar.xz ghostscript-${VERSION}.tar.xz.orig
( cd ghostscript-${VERSION} && rm -rf freetype jpeg lcms2 lcms2art/doc/* leptonica libpng libtiff png tesseract tiff zlib )
# Dump huge PDFs:
( cd ghostscript-${VERSION}
find . -name GS9_Color_Management.pdf -exec rm {} \;
rm -f doc/colormanage/figures/*.pdf
rm -f lcms2mt/doc/*
)
tar cf ghostscript-${VERSION}.tar ghostscript-${VERSION}
rm -r ghostscript-${VERSION}
plzip -9 -n 6 ghostscript-${VERSION}.tar
touch -r ghostscript-${VERSION}.tar.xz.orig ghostscript-${VERSION}.tar.lz
rm ghostscript-${VERSION}.tar.xz.orig