2014-01-07 17:37:18 +01:00
|
|
|
#
|
|
|
|
# spec file for package ghostscript-fonts-grops
|
|
|
|
#
|
2023-10-04 10:48:40 +02:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2014-01-07 17:37:18 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2021-02-01 14:46:16 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-01-07 17:37:18 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: ghostscript-fonts-grops
|
|
|
|
Version: 1.22.2
|
|
|
|
Release: 0
|
|
|
|
Summary: Ghostscript fonts imported to groff for use with grops
|
2018-12-17 15:54:21 +01:00
|
|
|
License: GPL-2.0-only
|
2014-01-07 17:37:18 +01:00
|
|
|
Group: Productivity/Publishing/Troff
|
2023-10-04 10:48:40 +02:00
|
|
|
URL: https://www.gnu.org/software/groff/groff.html
|
2014-01-07 17:37:18 +01:00
|
|
|
Source: gsalias.txt
|
2014-01-09 09:52:04 +01:00
|
|
|
Source1: zzz-groff-gs.sh
|
|
|
|
Source2: zzz-groff-gs.csh
|
2018-12-17 15:54:21 +01:00
|
|
|
# In version 9.26, the ghostscript package doesn't provide a COPYING file
|
|
|
|
# anymore. So providing it:
|
|
|
|
Source3: COPYING
|
2014-01-07 17:37:18 +01:00
|
|
|
BuildRequires: fontforge
|
|
|
|
BuildRequires: ghostscript
|
2023-10-04 10:48:40 +02:00
|
|
|
BuildRequires: groff-full
|
|
|
|
%requires_eq groff
|
|
|
|
Provides: locale(groff:pl)
|
|
|
|
BuildArch: noarch
|
2018-04-27 08:48:59 +02:00
|
|
|
%if 0%{?suse_version} > 1320
|
|
|
|
BuildRequires: ghostscript-fonts-std
|
|
|
|
%endif
|
2013-12-28 14:33:08 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
A version of PostScript® driver for Groff to support characters outside ISO Latin 1 character set.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
|
|
%build
|
|
|
|
%define gs_fonts %{_datadir}/ghostscript/fonts
|
2018-04-27 08:48:59 +02:00
|
|
|
%define gs_version %(gs --version)
|
2021-02-01 14:46:16 +01:00
|
|
|
%if %{lua:print(rpm.vercmp(rpm.expand("%{gs_version}"), "9.50"))} >= 0
|
2023-10-04 10:48:40 +02:00
|
|
|
%define import_font() ln -s -T "%{gs_fonts}/%{1}.afm" "%{2}.afm" && gs -P- -dNOSAFER -dNODISPLAY -- pfbtopfa.ps %{gs_fonts}/%{1}.pfb devps/%{1}.pfa
|
2020-09-28 10:25:49 +02:00
|
|
|
%else
|
2023-10-04 10:48:40 +02:00
|
|
|
%define import_font() ln -s -T "%{gs_fonts}/%{1}.afm" "%{2}.afm" && pfbtopfa %{gs_fonts}/%{1}.pfb devps/%{1}.pfa
|
2020-09-28 10:25:49 +02:00
|
|
|
%endif
|
2018-04-27 08:48:59 +02:00
|
|
|
%define gs_docdir %(if [ -d "%{_datadir}/ghostscript/%{gs_version}/doc" ] ; then echo "%{_datadir}/ghostscript/%{gs_version}/doc" ; else echo "%{_datadir}/doc/ghostscript/%{gs_version}"; fi)
|
2023-10-04 10:48:40 +02:00
|
|
|
cp %{SOURCE3} .
|
2013-12-28 14:33:08 +01:00
|
|
|
mkdir devps
|
|
|
|
while read fn fa
|
2021-02-01 14:46:16 +01:00
|
|
|
# Grops font generator expects conventional font file names;
|
2013-12-28 14:33:08 +01:00
|
|
|
# the substitutes provided by ghostscript must be linked accordingly.
|
|
|
|
# The link is needed only at build time.
|
|
|
|
# Ghostscript substitutes stripped fonts, full fonts must be embedded in the printout.
|
|
|
|
# Groff only knows how to embed PFA fonts.
|
|
|
|
do %{import_font $fn $fa}
|
2023-10-04 10:48:40 +02:00
|
|
|
done < '%{SOURCE0}'
|
2013-12-28 14:33:08 +01:00
|
|
|
cd devps
|
2023-10-04 10:48:40 +02:00
|
|
|
#ln -s -t. '%{_datadir}/groff/current/font/devps/generate'
|
|
|
|
mkdir output
|
|
|
|
mkdir generate
|
|
|
|
cp -r %{_datadir}/groff/current/font/devps/generate/* ./generate
|
|
|
|
cp %{_datadir}/groff/current/font/devps/DESC .
|
|
|
|
cp %{_datadir}/groff/current/font/devps/text.enc .
|
|
|
|
cp %{_datadir}/groff/current/font/devps/symbolsl.ps .
|
|
|
|
cp ./generate/zapfdr.sed ./generate/apfdr.sed
|
|
|
|
if [ -f %{_datadir}/groff/current/font/devps/symbolsl.afm ]; then
|
|
|
|
cp %{_datadir}/groff/current/font/devps/symbolsl.afm output/
|
|
|
|
cp %{_datadir}/groff/current/font/devps/zapfdr.afm output/
|
|
|
|
fi
|
|
|
|
cp %{_datadir}/groff/current/font/devps/freeeuro.afm .
|
|
|
|
ln -sf output/symbol.afm .
|
|
|
|
make -fgenerate/Makefile afmdir=.. \
|
|
|
|
OUTDIR=output
|
|
|
|
if [ -h symbol.afm ]; then
|
|
|
|
rm symbol.afm
|
|
|
|
for f in output/* ; do
|
|
|
|
cp ${f} .
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
rm -rf output
|
2013-12-28 14:33:08 +01:00
|
|
|
# Register fonts to be embedded
|
|
|
|
cd ..
|
|
|
|
for f in *.afm
|
|
|
|
do pf="$(readlink "${f}")"
|
|
|
|
pf="${pf##*/}"
|
2021-02-01 14:46:16 +01:00
|
|
|
pf="${pf:0:-4}.pfa"
|
2013-12-28 14:33:08 +01:00
|
|
|
read<"devps/${pf}" decl fn ver
|
|
|
|
echo "${fn}" "${pf}"
|
|
|
|
done >>devps/download
|
|
|
|
|
|
|
|
%install
|
2018-04-27 09:03:59 +02:00
|
|
|
%define groff_version %(groff -v | head -n 1 | sed 's/.*\s//')
|
2015-10-29 11:39:24 +01:00
|
|
|
target="%{buildroot}%{_datadir}/groff/%{groff_version}/font/gs"
|
2013-12-28 14:33:08 +01:00
|
|
|
install -d "${target}"
|
|
|
|
mv "-t${target}" devps
|
2023-10-04 10:48:40 +02:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
|
|
|
|
install -c -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d
|
|
|
|
install -c -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d
|
2013-12-28 14:33:08 +01:00
|
|
|
|
|
|
|
%files
|
2023-10-04 10:48:40 +02:00
|
|
|
%license COPYING
|
2013-12-28 14:33:08 +01:00
|
|
|
%{_datadir}/*
|
2023-10-04 10:48:40 +02:00
|
|
|
%config %{_sysconfdir}/profile.d/*
|
2013-12-28 14:33:08 +01:00
|
|
|
|
|
|
|
%changelog
|