diff --git a/ghostscript.spec b/ghostscript.spec index 73a358484102726d0a1974bf8629402f6e947daf..eec18f6eade78bc808445f1e35ab69b046f05b2a 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -1,164 +1,66 @@ -%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. -%global _hardened_build 1 +%define anolis_release 2 -# 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 _hardened_build 1 %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 jbig2dec_version 0.19 %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: 10.01.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} +Source0: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%{version_short}/ghostscript-%{version}.tar.xz + +BuildRequires: gcc gcc-c++ automake autoconf +BuildRequires: adobe-mappings-cmap-devel adobe-mappings-pdf-devel +BuildRequires: google-droid-sans-fonts urw-base35-fonts-devel +BuildRequires: cups-devel dbus-devel fontconfig-devel freetype-devel +BuildRequires: jbig2dec-devel = %{jbig2dec_version} jbig2dec-libs = %{jbig2dec_version} +BuildRequires: lcms2-devel libidn2-devel libjpeg-turbo-devel libpng-devel +BuildRequires: libpaper-devel libtiff-devel openjpeg2-devel zlib-devel +BuildRequires: gtk3-devel libXt-devel make +Requires: libgs = %{version}-%{release} 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: 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: - -# Downstream patches -- these should be always included when doing rebase: -# ------------------ Patch0: ghostscript-10.01.0-fix-linkage.patch -# 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 an interpreter for PostScript® and Portable Document Format (PDF) files. -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. +Ghostscript consists of a PostScript interpreter layer, and a graphics library. +The graphics library is shared with all the other products in the Ghostscript family, +so all of these technologies are sometimes referred to as Ghostscript, +rather than the more correct GhostPDL. -# === 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 +Requires: adobe-mappings-cmap adobe-mappings-cmap-deprecated adobe-mappings-pdf +Requires: google-droid-sans-fonts urw-base35-fonts Provides: bundled(ijs) = 0.35 %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. - -# --------------- +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} @@ -168,8 +70,6 @@ Requires: %{_bindir}/dvips 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} @@ -178,20 +78,15 @@ Requires: %{name} = %{version}-%{release} 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. - -# --------------- +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 @@ -201,8 +96,6 @@ Requires: libgs = %{version}-%{release} 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} @@ -211,8 +104,6 @@ Requires: %{name} = %{version}-%{release} 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} @@ -221,123 +112,66 @@ 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 -rm -rf cups/libs freetype jbig2dec jpeg lcms2* leptonica libpng openjpeg tesseract tiff windows zlib +for f in cups/libs freetype jbig2dec jpeg lcms2* leptonica libpng openjpeg tesseract tiff windows zlib +do + rm -rf $f +done %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-hidden-visibility --disable-compile-inits --without-versioned-path \ - --with-ijs \ +%configure --enable-dynamic --disable-hidden-visibility --disable-compile-inits \ + --without-versioned-path --with-ijs \ --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 +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 - +%dir %{_datadir}/%{name}/conf.d/ %{_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* @@ -345,25 +179,20 @@ install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ %{_mandir}/man1/pdf2* %{_mandir}/man1/ps2* -# --------------- %files tools-dvipdf %{_bindir}/dvipdf - %{_mandir}/man1/dvipdf* -# --------------- %files tools-fonts %{_bindir}/pf2afm %{_bindir}/pfbtopfa %{_bindir}/printafm - %{_mandir}/man1/pf2afm* %{_mandir}/man1/pfbtopfa* %{_mandir}/man1/printafm* -# --------------- %files tools-printing %{_bindir}/gsbj @@ -372,30 +201,28 @@ install -m 0755 -d %{buildroot}%{_datadir}/%{name}/conf.d/ %{_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 +* Thu Apr 13 2023 chen_yu_ao - 10.01.1-2 +- change spec file format + * Mon Mar 27 2023 Funda Wang - 10.01.1-1 - New version 10.01.1