12 Star 0 Fork 5

src-openEuler / urw-base35-fonts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
urw-base35-fonts.spec 43.00 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
#
# Important notes regarding the package:
# ======================================
# This package contains 35 fonts defined as PostScript Level 2 Core Font Set:
# > https://en.wikipedia.org/wiki/PostScript_fonts#Core_Font_Set
#
# This package is the replacement for previous 'urw-fonts' package (obsolete now).
#
# However, there are currently several issues that needed to be adressed:
# 1) This font set is owned by company (URW)++ [https://www.urwpp.de/en/], but
# the company Artifex Software [http://www.artifex.com/] has negotiated with
# (URW)++ the Open Source release of several fonts that (URW)++ owns, which
# can be used as Level 2 Core Font Set.
#
# Artifex Software is the owner/creator of Ghostscript software, and they use
# those fonts as part of Ghostscript's resources.
#
# However, (URW++) company does not provide any way to download those fonts.
# So right now, we are using the fonts which Artifex Software company uses
# in Ghostscript, and made available. They do not officially provide them,
# but they have become the 'de facto' standard across Linux distributions.
#
# Therefore, from now on, I will refer to Artifex Software as to 'upstream'.
#
# 2) Upstream has its own git repository for Core Font Set Level 2 sources:
# > https://github.com/ArtifexSoftware/urw-base35-fonts
#
# Here you can find 4 types of files (regarding the fonts):
# *.t1 - https://en.wikipedia.org/wiki/PostScript_fonts#Type_1
# *.afm - https://de.wikipedia.org/wiki/Adobe_Font_Metrics
# *.ttf - https://en.wikipedia.org/wiki/TrueType
# *.otf - https://en.wikipedia.org/wiki/OpenType
#
# According to upstream, Ghostscript needs only Type 1 fonts to work properly.
# It can use TTF or OTF fonts as substitutions as well in case the Type 1
# fonts are missing, but the substitution is not (and can't be) guaranteed to
# be absolutely flawless, unless the fonts use the CFF outlines:
# > https://en.wikipedia.org/wiki/PostScript_fonts#Compact_Font_Format
#
# And even though the OTF font files have CFF outlines embedded inside them,
# those OTF fonts still cause problems when they are used with Ghostscript's
# 'pdfwrite' device as substitutions. This can break printing or conversions
# for many users out there using Ghostscript. At the moment, upstream does
# not have reason/motivation to fix the 'pdfwrite' device in the near future.
#
# The AFM (Adobe Font Metrics) are useful for layout purposes of other
# applications, and they contain general font information and font metrics.
# These AFM files were distributed in the previous 'urw-fonts' package, so in
# order to avoid possible regressions in the future, we need to continue
# distributing them.
#
# However, distributing AFM files would not be possible if we would create
# this package from Ghostscript source package only. It does not contain
# these AFM files, because as stated above - Ghostscript requires only T1
# fonts. Therefore, we're using the archive with fonts provided from upstream.
#
#
# 3) The previous package 'urw-fonts' shipped the fonts in different format:
# *.pfb - Printer Font Binary (compressed Type 1 fonts, which require an
# 8-bit transmission method)
# *.pfm - Printer Font Metrics (same as *.afm files according to upstream)
#
# These formats were basically replaced with T1 and AFM formats, currently
# used by upstream.
#
# 4) The package scheme is this:
#
# * urw-base35-fonts -- Metapackage which does not contain anything,
# but requires all its font subpackages. This
# is a wrapper package to ease-up installation
# of all fonts.
#
# * urw-base35-fonts-common -- Package that contains only the license file,
# to avoid duplication of it and to make the
# font packages size smaller.
#
# * urw-base35-[***]-fonts -- Subpackage of base35 fonts, containing only
# one font family, as required by FPG.
#
# * urw-base35-fonts-devel -- Devel subpackage that provides useful RPM
# macro(s), so other packages can more easily
# build against base35 fonts.
#
# ==========================================================================
#
# urw-base35-fonts ----- urw-base35-fonts-common
# | |
# | |
# \-- urw-base35-[***]-fonts
#
# ==========================================================================
# GLOBAL MACROS:
# --------------
%global fontname urw-base35
%global fontconfig_prio 61
%global urw_fonts_vers 3:2.4-25
%global tmpdir %{_localstatedir}/lib/rpm-state/urw-base35-fonts
%global tmpfile %{tmpdir}/cache-update-needed
%global legacydir %{_datadir}/X11/fonts/urw-fonts
# By redefining the '_docdir_fmt' macro we override the default location of
# documentation or license files. Instead of them being located in
# 'urw-base35-fonts-common', they are located in 'urw-base35-fonts' folder.
%global _docdir_fmt %{name}
# This will create an auxiliary file if it does not exist, to indicate that X11
# Logical Font Description database and fontconfig cache needs to be updated.
%global post_scriptlet() \
( \
if ! [[ -x %{tmpfile} ]]; then \
rm -rf %{tmpdir} \
mkdir -p %{tmpdir} \
\
touch %{tmpfile} \
chmod +x %{tmpfile} \
fi \
)
# NOTE: At the moment, there's no equivalent of 'posttrans' macro for
# uninstallation, meaning we can only use the 'posttrans'.
#
# Because of it , we have to use 'postun' instead. That means this
# scriptlet will be called for every font family subpackage being
# uninstalled...
%global postun_scriptlet() \
( \
if [[ $1 -eq 0 ]]; then \
# mkfontscale %{_fontdir} &> /dev/null || : \
# mkfontdir %{_fontdir} &> /dev/null || : \
# xset fp rehash &> /dev/null || : \
true || : \
fi \
)
# The content of this scriptlet is only run once during install/update.
#
# NOTE: 'xset' is an utility requiring X server to be running. Because of it,
# the 'xset fp rehash' will fail to udpate its font database, when the
# X server is stopped. This has been already reported (and closed):
%global posttrans_scriptlet() \
( \
if [[ -x %{tmpfile} ]]; then \
# mkfontscale %{_fontdir} \
# mkfontdir %{_fontdir} \
# export DISPLAY=:0 \
# xset fp rehash &> /dev/null || : \
# \
true || : \
rm -rf %{tmpdir} \
fi \
)
%global common_desc \
The Level 2 Core Font Set is a PostScript specification of 35 base fonts that \
can be used with any PostScript file.
# Necessary after removal of *-nimbus-sans-narrow subpackage.
# Remove this once F27 is EOL.
%global obsolete_vers 20170801-4
# =============================================================================
Name: %{fontname}-fonts
Summary: Core Font Set containing 35 freely distributable fonts from (URW)++
Version: 20170801
Release: 12
# NOTE: (URW)++ holds the copyright, but Artifex Software has obtained rights to
# release these fonts under GNU Affero General Public License (version 3).
License: AGPLv3
URL: https://www.urwpp.de/en/
Source: https://github.com/ArtifexSoftware/urw-base35-fonts/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: urw-fonts-1.0.7pre44.tar.bz2
BuildArch: noarch
BuildRequires: fontpackages-devel
BuildRequires: libappstream-glib
BuildRequires: git
BuildRequires: sed
# ---------------
Provides: urw-fonts = %{urw_fonts_vers}
Obsoletes: urw-fonts < %{urw_fonts_vers}
# This is metapackage for installation all font subpackages, require them:
Requires: %{name}-common = %{version}-%{release}
Requires: %{fontname}-bookman-fonts %{fontname}-c059-fonts %{fontname}-d050000l-fonts
Requires: %{fontname}-gothic-fonts %{fontname}-nimbus-mono-ps-fonts %{fontname}-nimbus-roman-fonts %{fontname}-nimbus-sans-fonts
Requires: %{fontname}-p052-fonts %{fontname}-standard-symbols-ps-fonts %{fontname}-z003-fonts
# Upstream patches -- official upstream patches released by upstream since the
# ---------------- last rebase that are necessary for any reason:
Patch000: urw-base35-fonts-20170801-000-split-urw-fallback.patch
Patch001: urw-base35-fonts-20170801-001-appstream-typos-and-syntax-fix.patch
Patch002: urw-base35-fonts-20170801-002-BdOblique-renamed.patch
Patch003: urw-base35-fonts-20170801-003-merge-Nimbus-Sans-Narrow.patch
%description
%{common_desc}
This meta-package will install all the 35 fonts from the %{name}.
%package common
Summary: Common files of the (URW)++ Level 2 Core Font Set
Requires: filesystem
Requires: fontpackages-filesystem
%description common
%{common_desc}
This package contains the necessary license files for this font set.
# ---------------
%package devel
Summary: RPM macros related to (URW)++ Level 2 Core Font Set
Requires: %{name} = %{version}-%{release}
%description devel
%{common_desc}
This package is installs RPM
macros useful for building packages against %{name},
as well as all the fonts contained in this font set.
# ---------------
%package legacy
Summary: Legacy version of (URW)++ Level 2 Core Font Set
Requires(post): xorg-x11-font-utils
Requires(postun): xorg-x11-font-utils
%description legacy
%{common_desc}
This package provides previous (legacy) versions of these fonts
# =============================================================================
# NOTE: When making an update, make sure to check if any font families were
# added/removed. We always need to pack all the fonts into subpackages.
# =============================================================================
%define fontfamily_subpkg C059
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg D050000L
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg Nimbus Mono PS
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg Nimbus Roman
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg Nimbus Sans
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg P052
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg Standard Symbols PS
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg URW Bookman
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg URW Gothic
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
%define fontfamily_subpkg Z003
%define ff_filename %(echo %{fontfamily_subpkg} | tr --delete " ")
%define subpkg_name %(echo %{fontfamily_subpkg} | tr "A-Z " "a-z-" | sed -e 's/urw-//')
%package -n %{fontname}-%{subpkg_name}-fonts
Summary: %{*} font family [part of Level 2 Core Font Set]
Requires: %{name}-common = %{version}-%{release}
Requires(post): fontconfig xorg-x11-font-utils xorg-x11-server-utils
Requires(postun): fontconfig xorg-x11-font-utils xorg-x11-server-utils
%description -n %{fontname}-%{subpkg_name}-fonts
This package contains %{*} font family,
which is part of Level 2 Core Font Set.
%{common_desc}
%post -n %{fontname}-%{subpkg_name}-fonts
%{post_scriptlet}
%postun -n %{fontname}-%{subpkg_name}-fonts
%{postun_scriptlet}
%posttrans -n %{fontname}-%{subpkg_name}-fonts
%{posttrans_scriptlet}
%files -n %{fontname}-%{subpkg_name}-fonts
%{_fontdir}/%{ff_filename}*.t1
%{_fontdir}/%{ff_filename}*.afm
%{_fontdir}/%{ff_filename}*.otf
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf
%exclude %{_fontdir}/StandardSymbolsPS.otf
# =============================================================================
# We need to ship the legacy fonts for now as well (BZ #1551219):
%prep
%autosetup -N -S git
mkdir -p legacy
tar --directory=legacy/ -xf %{SOURCE1}
rm -f legacy/ChangeLog legacy/README* legacy/fonts*
# Amend all the files to the initial commit, and patch the sources:
git add --all --force
git commit --all --amend --no-edit > /dev/null
%autopatch -p1
%install
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_datadir}/appdata
install -m 0755 -d %{buildroot}%{_datadir}/fontconfig/conf.avail
install -m 0755 -d %{buildroot}%{_sysconfdir}/fonts/conf.d
install -m 0755 -d %{buildroot}%{legacydir}
install -m 0755 -d %{buildroot}%{_datadir}/licenses/urw-fonts
install -m 0644 -p fonts/*.t1 %{buildroot}%{_fontdir}
install -m 0644 -p fonts/*.afm %{buildroot}%{_fontdir}
install -m 0644 -p fonts/*.otf %{buildroot}%{_fontdir}
install -m 0644 -p legacy/*.afm legacy/*.pfm legacy/*.pfb %{buildroot}%{legacydir}
install -m 0644 -p legacy/COPYING %{buildroot}%{_datadir}/licenses/urw-fonts
install -m 0644 -p appstream/*.metainfo.xml %{buildroot}%{_datadir}/appdata/
# Install the fontconfig files with correct priority for our distribution:
for file in fontconfig/*.conf; do
DISTRO_FILENAME="%{fontconfig_prio}-$(basename $file)"
install -m 0644 -p $file %{buildroot}%{_datadir}/fontconfig/conf.avail/$DISTRO_FILENAME
ln -sf %{_datadir}/fontconfig/conf.avail/$DISTRO_FILENAME %{buildroot}%{_sysconfdir}/fonts/conf.d/$DISTRO_FILENAME
done
# Some of the fontconfig files are not to be shipped:
# * urw-fallback-specifics.conf - these mappings are already provided by fontconfig
# * urw-fallback-generics.conf - no use-cases for this as far as we know
rm -f %{buildroot}%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-fallback-{specifics,generics}.conf
rm -f %{buildroot}%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-fallback-{specifics,generics}.conf
# We need to touch these files -- otherwise running 'rpm --setperms' would
# result in these files having incorrect permissions like this: [-------.]
#touch %{buildroot}%{_fontdir}/fonts.dir
#touch %{buildroot}%{_fontdir}/fonts.scale
touch %{buildroot}%{legacydir}/fonts.dir
touch %{buildroot}%{legacydir}/fonts.scale
# Install the symlink for the X11 Logical Font Description to actually work:
install -m 0755 -d %{buildroot}%{_sysconfdir}/X11/fontpath.d
#ln -sf %{_fontdir} %{buildroot}%{_sysconfdir}/X11/fontpath.d/%{name}
ln -sf %{legacydir} %{buildroot}%{_sysconfdir}/X11/fontpath.d/urw-fonts
# Generate the macro containing the path to our fonts:
install -m 0755 -d %{buildroot}%{_rpmconfigdir}/macros.d
cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name} << _EOF
%%urw_base35_fontpath %{_fontdir}
_EOF
# Check that the AppStream files are valid and safe. Otherwise they might not
# get used in Gnome Software...
%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.metainfo.xml
%post legacy
mkfontscale %{legacydir}
mkfontdir %{legacydir}
export DISPLAY=:0
xset fp rehash &> /dev/null || :
%postun legacy
mkfontscale %{legacydir}
mkfontdir %{legacydir}
export DISPLAY=:0
xset fp rehash &> /dev/null || :
# NOTE: There's no reason to run 'post' and 'postun' scriptlets for the main
# metapackage or the *-common subpackage. Everything necessary is handled
# by any of the actual font family subpackages.
# =============================================================================
%files
%{_datadir}/appdata/de.urwpp.URWCoreFontSetLevel2.metainfo.xml
# ---------------
%files common
%license LICENSE COPYING
%dir %{_fontdir}
#%ghost %verify (not md5 size mtime) %{_fontdir}/fonts.dir
#%ghost %verify (not md5 size mtime) %{_fontdir}/fonts.scale
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-fallback-backwards.conf
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-fallback-backwards.conf
#%{_sysconfdir}/X11/fontpath.d/%{name}
# ---------------
%files devel
%{_rpmconfigdir}/macros.d/macros.%{name}
# ---------------
%files legacy
%license %{_datadir}/licenses/urw-fonts/COPYING
%ghost %verify (not md5 size mtime) %{legacydir}/fonts.dir
%ghost %verify (not md5 size mtime) %{legacydir}/fonts.scale
%{_sysconfdir}/X11/fontpath.d/urw-fonts
%{legacydir}/*.afm
%{legacydir}/*.pfm
%{legacydir}/*.pfb
# =============================================================================
%changelog
* Mon Aug 2 2021 yangcheng <yangcheng87@huawei.com> - 20170801-12
- Fix the problem that the mkfontscale command and mkfontdir command were not found during installation
1
https://gitee.com/src-openeuler/urw-base35-fonts.git
git@gitee.com:src-openeuler/urw-base35-fonts.git
src-openeuler
urw-base35-fonts
urw-base35-fonts
openEuler-20.03-LTS

搜索帮助