diff --git a/ghostscript-9.56-fix-PDFFitPage-with-square-MediaBox.patch b/ghostscript-9.56-fix-PDFFitPage-with-square-MediaBox.patch new file mode 100644 index 0000000000000000000000000000000000000000..948efde9e48bb834cdca197e826fa1761c5cc3a4 --- /dev/null +++ b/ghostscript-9.56-fix-PDFFitPage-with-square-MediaBox.patch @@ -0,0 +1,35 @@ +From 50e114295a65cceac49123f359e24f2f5007110a Mon Sep 17 00:00:00 2001 +Message-Id: <50e114295a65cceac49123f359e24f2f5007110a.1662477568.git.mjg@fedoraproject.org> +From: Ken Sharp +Date: Tue, 6 Sep 2022 14:39:33 +0100 +Subject: [PATCH] GhostPDF + GS - fix PDFFitPage with square MediaBox + +Bug #705849 "New PDF interpreter errors out with PDFFitPage" + +If the input PDF file had square media then we would correctly decide +we did not need to rotate the media for a better fit, but we left the +values we would normally use to calculate if rotation was required on +the operand stack, resulting in an error. + +Pop the unused values. + +Signed-off-by: Michael J Gruber +--- + Resource/Init/pdf_main.ps | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps +index 3259c0fe3..27eb7ab33 100644 +--- a/Resource/Init/pdf_main.ps ++++ b/Resource/Init/pdf_main.ps +@@ -364,6 +364,7 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if + 3 1 roll eq + or % square media or square page, no point in rotating + { ++ pop pop pop pop + //false + } + { +-- +2.37.2.827.g188294c313 + diff --git a/ghostscript-9.56.1-Deal-with-different-VM-modes-during-CIDFont-loading.patch b/ghostscript-9.56.1-Deal-with-different-VM-modes-during-CIDFont-loading.patch new file mode 100644 index 0000000000000000000000000000000000000000..180193a186a45e3d8e79a57d075689c5ed53d6c4 --- /dev/null +++ b/ghostscript-9.56.1-Deal-with-different-VM-modes-during-CIDFont-loading.patch @@ -0,0 +1,88 @@ +From 0b74b65ecc0f36d40b8d04a7fa1fa8b5f9d2b3ff Mon Sep 17 00:00:00 2001 +From: Chris Liddell +Date: Thu, 13 Oct 2022 14:55:28 +0100 +Subject: [PATCH] Deal with different VM modes during CIDFont loading + +To help differentiate between a substituted CIDFont and an embedded one, a +change was made to store the file path in the CIDFont dictionary. That change +failed to account for the possibility that the file object and the CIDFont +dictionary may not be in compatible VM modes. + +This adds code to ensure that the string holding the path is in a suitable VM +mode to be stored into the dictionary. + +Reported by Richard Lescak +--- + Resource/Init/gs_cidfn.ps | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/Resource/Init/gs_cidfn.ps b/Resource/Init/gs_cidfn.ps +index 870a2e11c..fa050ed7a 100644 +--- a/Resource/Init/gs_cidfn.ps ++++ b/Resource/Init/gs_cidfn.ps +@@ -1,4 +1,4 @@ +-% Copyright (C) 2001-2021 Artifex Software, Inc. ++% Copyright (C) 2001-2022 Artifex Software, Inc. + % All Rights Reserved. + % + % This software is provided AS-IS with no warranty, either express or +@@ -36,6 +36,17 @@ + + 30 dict begin + ++/.gcompatstringcopy % .gcompatstringcopy ++{ ++ dup 2 index gcheck eq ++ { pop } ++ { ++ currentglobal 3 1 roll setglobal ++ dup length string copy ++ exch setglobal ++ } ifelse ++} bind def ++ + % The key in .cidfonttypes is the CIDFontType value; + % the value is a procedure that takes a font name and the CIDFont dictionary + % and replaces the latter with a real font. +@@ -58,7 +69,7 @@ dup 0 { + end + } if + 1 index exch .buildfont9 +- .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse ++ .currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop + } put % Don't bind it here, because gs_fapi.ps redefines .buildfont9 + +@@ -138,10 +149,11 @@ dup 0 { + + % ------ CIDFontType 1 (FontType 10) ------ % + ++ + dup 1 { + 10 //.checkfonttype exec pop + 1 index exch .buildfont10 +- .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse ++ .currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop + } put % Don't bind it here because gs_fapi.ps redefines .buildfont10 + +@@ -150,12 +162,15 @@ dup 1 { + dup 2 { + 11 //.checkfonttype exec pop + 1 index exch .buildfont11 +- .currentresourcefile dup type /filetype eq { //.filename {1 index exch /ResourcePath exch put} if }{ pop} ifelse ++ .currentresourcefile dup type /filetype eq { //.filename {1 index gcheck //.gcompatstringcopy exec 1 index exch /ResourcePath exch put} if }{ pop} ifelse + exch pop + } put % Don't bind it here because gs_fapi.ps redefines .buildfont11 + ++currentdict /.gcompatstringcopy .undef ++ + pop % .cidfonttypes + ++ + % ---------------- Reading CIDFontType 0 files ---------------- % + + /StartData { % <(Binary)|(Hex)> StartData - +-- +2.37.3 + diff --git a/ghostscript-9.56.1-Fix-color-info-juggling-with-x11-devices.patch b/ghostscript-9.56.1-Fix-color-info-juggling-with-x11-devices.patch new file mode 100644 index 0000000000000000000000000000000000000000..1d707268b02df3a3430ce373768c4b09a2719b3c --- /dev/null +++ b/ghostscript-9.56.1-Fix-color-info-juggling-with-x11-devices.patch @@ -0,0 +1,78 @@ +From a3768a91418925a5eb5cf268222f1e90e1abc396 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Chris Liddell +Date: Mon, 3 Oct 2022 16:17:56 +0100 +Subject: [PATCH] Bug 705863: Fix color info juggling with x11 devices + +For the "wrapped" X11 devices (x11cmyk, x11gray2, x11gray4 etc) we have to +juggle the color info between the wrapping device and the wrapped device so that +the put/get_params continue to work properly, and not cause bad rendering and +segfaults. + +The "wrapped" x11 device initialises with 24bit RGB color setup, and doesn't get +updated to match the actual display until the device is opened. + +The problem was, if it was not talking to a 24bit RGB X display, the stashed +color_info did not match the actual color_info of the actual device, and +resulted in segfaults when using wrapped devices on those non 24bit RGB +displays. + +This just ensures the stashed color_info gets updated after those devices config +changes take place. + +Also reverts "Bug 703013: Fix color_info for buffered/wrapped X11 devices" +commit: 270438bfda605c258f5841e7917a16fdc2cf7968. + +Signed-off-by: Michael J Gruber +--- + devices/gdevxcmp.c | 4 ++-- + devices/gdevxini.c | 6 +++--- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/devices/gdevxcmp.c b/devices/gdevxcmp.c +index c43426d76..55051763b 100644 +--- a/devices/gdevxcmp.c ++++ b/devices/gdevxcmp.c +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2001-2021 Artifex Software, Inc. ++/* Copyright (C) 2001-2022 Artifex Software, Inc. + All Rights Reserved. + + This software is provided AS-IS with no warranty, either express or +@@ -477,7 +477,7 @@ monochrome: + } + } + #endif +- ++ xdev->orig_color_info = xdev->color_info; + return 0; + } + +diff --git a/devices/gdevxini.c b/devices/gdevxini.c +index fafcd42a8..914e88e78 100644 +--- a/devices/gdevxini.c ++++ b/devices/gdevxini.c +@@ -589,9 +589,9 @@ x_set_buffer(gx_device_X * xdev) + * *But* if we run buffered, we have to use the real specs of the real x11 device. + * Hence, the real color_info is saved into orig_color_info, and we use that here. + */ +- if (mdev == 0 || mdev->color_info.depth != xdev->color_info.depth) { ++ if (mdev == 0 || mdev->color_info.depth != xdev->orig_color_info.depth) { + const gx_device_memory *mdproto = +- gdev_mem_device_for_bits(xdev->color_info.depth); ++ gdev_mem_device_for_bits(xdev->orig_color_info.depth); + + if (!mdproto) { + buffered = false; +@@ -643,7 +643,7 @@ x_set_buffer(gx_device_X * xdev) + rc_decrement(mdev->icc_struct, "x_set_buffer"); + mdev->icc_struct = xdev->icc_struct; + rc_increment(xdev->icc_struct); +- mdev->color_info = xdev->color_info; ++ mdev->color_info = xdev->orig_color_info; + mdev->base = xdev->buffer; + gdev_mem_open_scan_lines(mdev, xdev->height); + } +-- +2.38.0.420.gc7a4235b32 + diff --git a/ghostscript-9.56.1-use-proper-bounds-check-for-subfunctions-of.patch b/ghostscript-9.56.1-use-proper-bounds-check-for-subfunctions-of.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d3e70023d044c4c00f3890e02d411d3f192a6e4 --- /dev/null +++ b/ghostscript-9.56.1-use-proper-bounds-check-for-subfunctions-of.patch @@ -0,0 +1,76 @@ +From 61ee992bf2e132da2168754f587fcf163a68eb12 Mon Sep 17 00:00:00 2001 +Message-Id: <61ee992bf2e132da2168754f587fcf163a68eb12.1666169658.git.mjg@fedoraproject.org> +From: Ken Sharp +Date: Thu, 19 May 2022 16:59:05 +0100 +Subject: [PATCH] GhostPDF - use proper bounds check for subfunctions of type 3 + +Bug #705225 "Gradients not rendered with the new PDF interpreter" + +The files in question have some remarkably complicated functions used +to define a shading. One has a type 3 stitching function with 33 type 2 +subfunctions, to define basically a blue fill.... + +The Domain of the shading is, additionally, unusual ranging from +negative to positive instead of the more usual 0 to N for the parametric +variable. + +The problem is that we were comparing the Domain of each subfunction +against the Domain of the shading function, when in fact each sub +function uses the relevant Encode parameter of the type 3 function +and it is this that we should be checking against the Domain of the sub +function. +--- + pdf/pdf_func.c | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +diff --git a/pdf/pdf_func.c b/pdf/pdf_func.c +index 9537152ed..6e2d4e4e9 100644 +--- a/pdf/pdf_func.c ++++ b/pdf/pdf_func.c +@@ -560,6 +560,18 @@ pdfi_build_function_3(pdf_context *ctx, gs_function_params_t * mnDR, + + params.Functions = (const gs_function_t * const *)ptr; + ++ code = pdfi_make_float_array_from_dict(ctx, (float **)¶ms.Bounds, function_dict, "Bounds"); ++ if (code < 0) ++ goto function_3_error; ++ ++ code = pdfi_make_float_array_from_dict(ctx, (float **)¶ms.Encode, function_dict, "Encode"); ++ if (code < 0) ++ goto function_3_error; ++ ++ if (code != 2 * params.k) ++ goto function_3_error; ++ code = 0; ++ + for (i = 0; i < params.k; ++i) { + pdf_obj * rsubfn = NULL; + +@@ -578,23 +590,12 @@ pdfi_build_function_3(pdf_context *ctx, gs_function_params_t * mnDR, + if (code < 0) + goto function_3_error; + +- code = pdfi_build_sub_function(ctx, &ptr[i], shading_domain, num_inputs, rsubfn, page_dict); ++ code = pdfi_build_sub_function(ctx, &ptr[i], ¶ms.Encode[i * 2], num_inputs, rsubfn, page_dict); + pdfi_countdown(rsubfn); + if (code < 0) + goto function_3_error; + } + +- code = pdfi_make_float_array_from_dict(ctx, (float **)¶ms.Bounds, function_dict, "Bounds"); +- if (code < 0) +- goto function_3_error; +- +- code = pdfi_make_float_array_from_dict(ctx, (float **)¶ms.Encode, function_dict, "Encode"); +- if (code < 0) +- goto function_3_error; +- +- if (code != 2 * params.k) +- goto function_3_error; +- + if (params.Range == 0) + params.n = params.Functions[0]->params.n; + +-- +2.38.0.124.g8fc341881c + diff --git a/ghostscript-9.56.1.tar.xz b/ghostscript-9.56.1.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..7b311e1885329c4dc365535d0706a273acf22605 Binary files /dev/null and b/ghostscript-9.56.1.tar.xz differ diff --git a/ghostscript.spec b/ghostscript.spec new file mode 100644 index 0000000000000000000000000000000000000000..061233ac2f620fff9f1f794c715b5b000347a1fa --- /dev/null +++ b/ghostscript.spec @@ -0,0 +1,414 @@ +%define anolis_release 1 +# +# Important notes regarding the package: +# ====================================== +# 1) This package has GUI versions (*-x11, *-gtk), but we are not shipping the +# desktop files, because the GUI versions are used for displaying of files +# invoked from command line. The displaying GUI does not contain any buttons +# or other means for user interaction. It can't even open a different file +# from the GUI version. Therefore it does not make sense to ship desktop +# files... + +# === GLOBAL MACROS =========================================================== + +# According to Fedora Package Guidelines, it is advised that packages that can +# process untrusted input are build with position-independent code (PIC). +# +# Koji should override the compilation flags and add the -fPIC or -fPIE flags by +# default. This is here just in case this wouldn't happen for some reason. +# For more info: https://fedoraproject.org/wiki/Packaging:Guidelines#PIE +%global _hardened_build 1 + +# By redefining the '_docdir_fmt' macro we override the default location of +# documentation or license files. Instead of them being located in 'libgs' +# folder, they are now located in 'ghostscript'. +%global _docdir_fmt %{name} + +# NOTE: Artifex is using Github only as a mirror for providing the source +# tarballs, and their release tags/branches do not use the dot in version +# tag. This makes obtaining the current version harder, and might prevent +# automatic builds of new releases... +%global version_short %%(echo "%{version}" | tr -d '.') + +# Starting version of new sup-package layout scheme for Ghostscript, which is +# conflicting with the previous sup-package layout scheme. +# +# Obtain the location of Google Droid fonts directory: +%global google_droid_fontpath %%(dirname $(fc-list : file | grep "DroidSansFallback")) + +# Desired jbig2dec header files and library version +# Apparantly, ghostscript complains even about newer versions +# Please update if needed. +%global jbig2dec_version 0.19 + +# ============================================================================= + +Name: ghostscript +Summary: Interpreter for PostScript language & PDF +Version: 9.56.1 +Release: %{anolis_release}%{?dist} + +License: AGPLv3+ + +URL: https://ghostscript.com/ +Source: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%{version_short}/ghostscript-%{version}.tar.xz + +Requires: libgs = %{version}-%{release} +Requires: jbig2dec-libs = %{jbig2dec_version} +Requires: %{name}-tools-fonts = %{version}-%{release} +Requires: %{name}-tools-printing = %{version}-%{release} + +Provides: ghostscript-core = %{version}-%{release} +Obsoletes: ghostscript-core < 9.53.3-6 + +# Auxiliary build requirements: +BuildRequires: automake +BuildRequires: gcc + +# Already packaged Resources -- needed to build package correctly: +BuildRequires: adobe-mappings-cmap-devel +BuildRequires: adobe-mappings-pdf-devel +BuildRequires: google-droid-sans-fonts +BuildRequires: urw-base35-fonts-devel + +# Already packaged software -- needed for debundling of Ghostscript: +BuildRequires: cups-devel +BuildRequires: dbus-devel +BuildRequires: fontconfig-devel +BuildRequires: freetype-devel +BuildRequires: jbig2dec-devel = %{jbig2dec_version} +BuildRequires: jbig2dec-libs = %{jbig2dec_version} +BuildRequires: lcms2-devel +BuildRequires: libidn2-devel +BuildRequires: libijs-devel +BuildRequires: libjpeg-turbo-devel +BuildRequires: libpng-devel +BuildRequires: libpaper-devel +BuildRequires: libtiff-devel +BuildRequires: openjpeg2-devel +BuildRequires: zlib-devel + +# Enabling the GUI possibilities of Ghostscript: +BuildRequires: gtk3-devel +BuildRequires: libXt-devel +BuildRequires: make + +# ============================================================================= + +# NOTE: 'autosetup' macro (below) uses 'git' for applying the patches: +# ->> All the patches should be provided in 'git format-patch' format. +# ->> Auxiliary repository will be created during 'fedpkg prep', you +# can see all the applied patches there via 'git log'. + +# Upstream patches -- official upstream patches released by upstream since the +# ---------------- last rebase that are necessary for any reason: +Patch000: ghostscript-9.56-fix-PDFFitPage-with-square-MediaBox.patch +Patch001: ghostscript-9.56.1-Fix-color-info-juggling-with-x11-devices.patch +Patch002: ghostscript-9.56.1-use-proper-bounds-check-for-subfunctions-of.patch +Patch003: ghostscript-9.56.1-Deal-with-different-VM-modes-during-CIDFont-loading.patch + +# Downstream patches -- these should be always included when doing rebase: +# ------------------ + + +# Patches to be removed -- deprecated functionality which shall be removed at +# --------------------- some point in the future: + + +%description +This package provides useful conversion utilities based on Ghostscript software, +for converting PS, PDF and other document formats between each other. + +Ghostscript is a suite of software providing an interpreter for Adobe Systems' +PostScript (PS) and Portable Document Format (PDF) page description languages. +Its primary purpose includes displaying (rasterization & rendering) and printing +of document pages, as well as conversions between different document formats. + +# === SUBPACKAGES ============================================================= + +# Below requirements are resources, which are not detected by RPM automatically: +%package -n libgs +Summary: Library providing Ghostcript's core functionality +Requires: adobe-mappings-cmap +Requires: adobe-mappings-cmap-deprecated +Requires: adobe-mappings-pdf +Requires: google-droid-sans-fonts +Requires: urw-base35-fonts + +%description -n libgs +This library provides Ghostscript's core functionality, based on Ghostscript's +API, which is useful for many packages that are build on top of Ghostscript. + +# --------------- + +%package -n libgs-devel +Summary: Development files for Ghostscript's library +Requires: libgs = %{version}-%{release} + +# This virtual provides is useful in case people get confused what *-devel +# subpackage they should actually use (i.e. ghostscript-devel vss libgs-devel?). +# By having this virtual provide both of the options above will work... +Provides: %{name}-devel = %{version}-%{release} + +%description -n libgs-devel +This package contains development files that are useful for building packages +against Ghostscript's library, which provides Ghostscript's core functionality. + +# --------------- + +# NOTE: The 'dvipdf' utility invokes 'dvips', which is part of 'texlive-dvips'. +# This requirement pulls in a lot of texlive subpackages. Not all users +# need to use this utility, nor they wish to have a lot of disk space to +# be used by 'texlive'. Therefore the specific subpackage is necessary. +# +# Previously, the 'dvips' was moving between packages before, so it's +# more convenient (even for users) to have a direct requiremnt for the +# executable instead of package. +%package tools-dvipdf +Summary: Ghostscript's 'dvipdf' utility +Requires: %{name} = %{version}-%{release} +Requires: %{_bindir}/dvips + +%description tools-dvipdf +This package provides the utility 'dvipdf' for converting of TeX DVI files into +PDF files using Ghostscript and dvips. + +# --------------- + +%package tools-fonts +Summary: Ghostscript's font utilities +Requires: %{name} = %{version}-%{release} + +%description tools-fonts +This package provides utilities which are useful when you are working with AFM, +PFB or PFA files, mostly for conversion purposes. + +# --------------- + +%package tools-printing +Summary: Ghostscript's printing utilities +Requires: %{name} = %{version}-%{release} + +%description tools-printing +This package provides utilities for formatting and printing text files using +either Ghostscript, or BubbleJet, DeskJet, DeskJet 500, and LaserJet printers. + +It also provides the utility 'pphs', which is useful for printing of Primary +Hint Stream of a linearized PDF file. + +# --------------- + +%package gtk +Summary: Ghostscript's GTK-based document renderer +Requires: libgs = %{version}-%{release} + +%description gtk +This package provides GTK-based utility 'gsx', which can be used for displaying +of various document files (including PS and PDF). + +# --------------- + +%package x11 +Summary: Ghostscript's X11-based driver for document rendering +Requires: %{name} = %{version}-%{release} + +%description x11 +This package provides X11-based driver for Ghostscript, which enables displaying +of various document files (including PS and PDF). + +# --------------- + +%package doc +Summary: Documentation files for Ghostscript +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +This package provides detailed documentation files for Ghostscript software. + +# === BUILD INSTRUCTIONS ====================================================== + +# Call the 'autosetup' macro to prepare the environment, but do not patch the +# source code yet -- we need to remove bundled software before the build first: +%prep +%autosetup -p1 + +# Libraries that we already have packaged in Fedora (see Build Requirements): +rm -rf cups/libs freetype ijs jbig2dec jpeg lcms2* leptonica libpng openjpeg tesseract tiff windows zlib + +%build +# --enable-dynamic +# ... enables dynamically loaded drivers +# +# --disable-compile-inits +# ... disables compiling of init files (PS code, fonts, etc.) into resulting +# binaries, so they are loaded dynamically +# +# --without-versioned-path +# ... tells configure to not use version string in the resulting paths after +# 'make_install' macro - this is safe, because only one version of +# package can be installed at a given time on Fedora distribution, +# so we won't end up with conflicting folders when doing rebase +# +# --with-fonthpath +# ... searches for necessary fonts in these column-separated directories, +# not just default ones +# +%configure --enable-dynamic --disable-compile-inits --without-versioned-path \ + --with-fontpath="%{urw_base35_fontpath}:%{google_droid_fontpath}:%{_datadir}/%{name}/conf.d/" +%make_build so + +# --------------- + +%install +# Using the 'make_install' macro with 'soinstall' target would result in some +# files being installed unnecessary, so we are using traditional way: +make DESTDIR=%{buildroot} soinstall + +# Remove files that we do not want ship / support: +# ------------------------------------------------ +# LPR-related scripts: +rm -f %{buildroot}%{_bindir}/{lprsetup.sh,unix-lpr.sh} + +# Rename the dynamic binary to be used by default as 'gs' binary. +mv -f %{buildroot}%{_bindir}/{gsc,gs} + +# Remove useless files from doc/ directory and doc/ symlink: +rm -f %{buildroot}%{_docdir}/%{name}/{AUTHORS,COPYING,*.tex,*.hlp,*.txt} +rm -f %{buildroot}%{_datadir}/%{name}/doc + +# --------------- + +# Move html documentation into html/ subdir: +install -m 0755 -d %{buildroot}%{_docdir}/%{name}/html +mv -f %{buildroot}%{_docdir}/%{name}/{*.htm*,html} + +# --------------- + +# Create 'ghostscript' symlink for its binary: +ln -s %{_bindir}/gs %{buildroot}%{_bindir}/ghostscript + +# Create a man page symlink for 'ghostscript': +ln -s %{_mandir}/man1/gs.1 %{buildroot}%{_mandir}/man1/ghostscript.1 + +# --------------- + +# According to upstream, using fontconfig for fonts lookup is quite a slow +# process for Ghostscript startup, and they advise using the symlinks where +# possible. The fontconfig (Ghostscript's search path) should be used preferably +# as a fallback only. +ln -fs %{google_droid_fontpath}/DroidSansFallbackFull.ttf %{buildroot}%{_datadir}/%{name}/Resource/CIDFSubst/DroidSansFallback.ttf + +for font in $(basename --multiple %{buildroot}%{_datadir}/%{name}/Resource/Font/*); do + ln -fs %{urw_base35_fontpath}/${font}.t1 %{buildroot}%{_datadir}/%{name}/Resource/Font/${font} +done + +# Using the system-wide available CMap files from Adobe via Ghostscript's search +# path is not safe (nor was ever intended to be supported) way of doing so +# according to upstream. Their preferred solution is to just create symlink for +# each of the CMap files in Ghostscript's Resources/CMap folder. +for file in $(basename --multiple %{buildroot}%{_datadir}/%{name}/Resource/CMap/*); do + find %{adobe_mappings_rootpath} -type f -name ${file} -exec ln -fs {} %{buildroot}%{_datadir}/%{name}/Resource/CMap/${file} \; +done + +# Create the configuration folder: +install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ + +# === PACKAGING INSTRUCTIONS ================================================== + +%files -n libgs +%license LICENSE doc/COPYING + +%{_libdir}/libgs.so.* +%{_datadir}/%{name}/ + +# Include the configuration folder: +%dir %{_datadir}/%{name}/conf.d/ + +# --------------- + +%files -n libgs-devel +%{_libdir}/libgs.so +%{_includedir}/%{name}/ + +# --------------- + +%files +%{_bindir}/gs +%{_bindir}/gsnd +%{_bindir}/ghostscript + +# Useful conversion scripts: +%{_bindir}/eps2* +%{_bindir}/pdf2* +%{_bindir}/ps2* + +%{_mandir}/man1/gs.1* +%{_mandir}/man1/gsnd* +%{_mandir}/man1/ghostscript* +%{_mandir}/man1/eps2* +%{_mandir}/man1/pdf2* +%{_mandir}/man1/ps2* + +%lang(de) %{_mandir}/de/man1/gsnd* +%lang(de) %{_mandir}/de/man1/eps2* +%lang(de) %{_mandir}/de/man1/pdf2* +%lang(de) %{_mandir}/de/man1/ps2* + +# --------------- + +%files tools-dvipdf +%{_bindir}/dvipdf + +%{_mandir}/man1/dvipdf* + +%lang(de) %{_mandir}/de/man1/dvipdf* + +# --------------- + +%files tools-fonts +%{_bindir}/pf2afm +%{_bindir}/pfbtopfa +%{_bindir}/printafm + +%{_mandir}/man1/pf2afm* +%{_mandir}/man1/pfbtopfa* +%{_mandir}/man1/printafm* + +%lang(de) %{_mandir}/de/man1/printafm* + +# --------------- + +%files tools-printing +%{_bindir}/gsbj +%{_bindir}/gsdj +%{_bindir}/gsdj500 +%{_bindir}/gslj +%{_bindir}/gslp +%{_bindir}/pphs + +%{_mandir}/man1/gsbj* +%{_mandir}/man1/gsdj* +%{_mandir}/man1/gslj* +%{_mandir}/man1/gslp* + +# --------------- + +%files gtk +%{_bindir}/gsx + +# --------------- + +%files x11 +%{_libdir}/%{name}/ + +# --------------- + +%files doc +%doc %{_docdir}/%{name}/ + +# ============================================================================= + +%changelog +* Fri Jan 20 2023 Funda Wang - 9.56.1-1 +- Import package for anolis 23