5ebe4e
#
5ebe4e
# Important notes regarding the package:
5ebe4e
# ======================================
5ebe4e
# This package contains 35 fonts defined as PostScript Level 2 Core Font Set:
5ebe4e
# > https://en.wikipedia.org/wiki/PostScript_fonts#Core_Font_Set
5ebe4e
#
5ebe4e
# This package is the replacement for previous 'urw-fonts' package (obsolete now).
5ebe4e
#
5ebe4e
# However, there are currently several issues that needed to be adressed:
5ebe4e
# 1) This font set is owned by company (URW)++ [https://www.urwpp.de/en/], but
5ebe4e
#    the company Artifex Software [http://www.artifex.com/] has negotiated with
5ebe4e
#    (URW)++ the Open Source release of several fonts that (URW)++ owns, which
5ebe4e
#    can be used as Level 2 Core Font Set.
5ebe4e
#
5ebe4e
#    Artifex Software is the owner/creator of Ghostscript software, and they use
5ebe4e
#    those fonts as part of Ghostscript's resources.
5ebe4e
#
5ebe4e
#    However, (URW++) company does not provide any way to download those fonts.
5ebe4e
#    So right now, we are using the fonts which Artifex Software company uses
5ebe4e
#    in Ghostscript, and made available. They do not officially provide them,
5ebe4e
#    but they have become the 'de facto' standard across Linux distributions.
5ebe4e
#
5ebe4e
#    Therefore, from now on, I will refer to Artifex Software as to 'upstream'.
5ebe4e
#
5ebe4e
# 2) Upstream has its own git repository for Core Font Set Level 2 sources:
5ebe4e
#    > https://github.com/ArtifexSoftware/urw-base35-fonts
5ebe4e
#
5ebe4e
#    Here you can find 4 types of files (regarding the fonts):
5ebe4e
#    *.t1  - https://en.wikipedia.org/wiki/PostScript_fonts#Type_1
5ebe4e
#    *.afm - https://de.wikipedia.org/wiki/Adobe_Font_Metrics
5ebe4e
#    *.ttf - https://en.wikipedia.org/wiki/TrueType
5ebe4e
#    *.otf - https://en.wikipedia.org/wiki/OpenType
5ebe4e
#
5ebe4e
#    According to upstream, Ghostscript needs only Type 1 fonts to work properly.
5ebe4e
#    It can use TTF or OTF fonts as substitutions as well in case the Type 1
5ebe4e
#    fonts are missing, but the substitution is not (and can't be) guaranteed to
5ebe4e
#    be absolutely flawless, unless the fonts use the CFF outlines:
5ebe4e
#    > https://en.wikipedia.org/wiki/PostScript_fonts#Compact_Font_Format
5ebe4e
#
5ebe4e
#    And even though the OTF font files have CFF outlines embedded inside them,
5ebe4e
#    those OTF fonts still cause problems when they are used with Ghostscript's
5ebe4e
#    'pdfwrite' device as substitutions. This can break printing or conversions
5ebe4e
#    for many users out there using Ghostscript. At the moment, upstream does
5ebe4e
#    not have reason/motivation to fix the 'pdfwrite' device in the near future.
5ebe4e
#
5ebe4e
#    The AFM (Adobe Font Metrics) are useful for layout purposes of other
5ebe4e
#    applications, and they contain general font information and font metrics.
5ebe4e
#    These AFM files were distributed in the previous 'urw-fonts' package, so in
5ebe4e
#    order to avoid possible regressions in the future, we need to continue
5ebe4e
#    distributing them.
5ebe4e
#
5ebe4e
#    However, distributing AFM files would not be possible if we would create
5ebe4e
#    this package from Ghostscript source package only. It does not contain
5ebe4e
#    these AFM files, because as stated above - Ghostscript requires only T1
5ebe4e
#    fonts. Therefore, we're using the archive with fonts provided from upstream.
5ebe4e
#
5ebe4e
#
5ebe4e
# 3) The previous package 'urw-fonts' shipped the fonts in different format:
5ebe4e
#    *.pfb - Printer Font Binary (compressed Type 1 fonts, which require an
5ebe4e
#            8-bit transmission method)
5ebe4e
#    *.pfm - Printer Font Metrics (same as *.afm files according to upstream)
5ebe4e
#
5ebe4e
#    These formats were basically replaced with T1 and AFM formats, currently
5ebe4e
#    used by upstream.
5ebe4e
#
5ebe4e
# 4) (URW)++ does not have any sane versioning procedure. After reaching
5ebe4e
#    version 1.10, they returned to version 1.00. That is the reason why
5ebe4e
#    upstream switched to using git snapshot dates for versioning, and we
5ebe4e
#    are sticking to that after discussion at fedora-devel mailing list.
5ebe4e
#
5ebe4e
# 5) The package scheme is this:
5ebe4e
#
5ebe4e
#    * urw-base35-fonts        -- Metapackage which does not contain anything,
5ebe4e
#                                 but requires all its font subpackages. This
5ebe4e
#                                 is a wrapper package to ease-up installation
5ebe4e
#                                 of all fonts.
5ebe4e
#
5ebe4e
#    * urw-base35-fonts-common -- Package that contains only the license file,
5ebe4e
#                                 to avoid duplication of it and to make the
5ebe4e
#                                 font packages size smaller.
5ebe4e
#
5ebe4e
#    * urw-base35-[***]-fonts  -- Subpackage of base35 fonts, containing only
5ebe4e
#                                 one font family, as required by FPG.
5ebe4e
#
5ebe4e
#    * urw-base35-fonts-devel  -- Devel subpackage that provides useful RPM
5ebe4e
#                                 macro(s), so other packages can more easily
5ebe4e
#                                 build against base35 fonts.
5ebe4e
#
5ebe4e
#    ==========================================================================
5ebe4e
#
5ebe4e
#    urw-base35-fonts ----- urw-base35-fonts-common
5ebe4e
#                       |             |
5ebe4e
#                       |             |
5ebe4e
#                       \-- urw-base35-[***]-fonts
5ebe4e
#
5ebe4e
#    ==========================================================================
5ebe4e
#
5ebe4e
#    NOTE: Fedora Packaging Guidelines (FPG) requires to use OTF or TTF format:
5ebe4e
#          https://fedoraproject.org/wiki/Choosing_the_right_font_format_to_package
5ebe4e
#
5ebe4e
#          However, there are several packages in Fedora that still hadn't been
5ebe4e
#          updated to work with OTF/TTF formats, and thus still require the
5ebe4e
#          Type1 font format to work correctly. These packages include e.g.:
5ebe4e
#           * ghostscript
5ebe4e
#           * ImageMagick
5ebe4e
#           * hylafax+
5ebe4e
#
5ebe4e
#          On the other hand, more and more software (e.g. LibreOffice) is
5ebe4e
#          moving away from Type1 format completely and dropping its support.
5ebe4e
#
5ebe4e
#          As a result, we currently need to ship both OTF and Type1/AFM formats.
5ebe4e
#          In case all the packages depending on base35 fonts will finally start
5ebe4e
#          supporting the OTF, then we will make complete switch to OTF only.
5ebe4e
#
5ebe4e
#    ==========================================================================
5ebe4e
5ebe4e
# GLOBAL MACROS:
5ebe4e
# --------------
5ebe4e
%global fontname            urw-base35
5ebe4e
%global fontconfig_prio     61
5ebe4e
%global urw_fonts_vers      3:2.4-25
5ebe4e
%global tmpdir              %{_localstatedir}/lib/rpm-state/urw-base35-fonts
5ebe4e
%global tmpfile             %{tmpdir}/cache-update-needed
5ebe4e
%global legacydir           %{_datadir}/X11/fonts/urw-fonts
5ebe4e
5ebe4e
5ebe4e
# By redefining the '_docdir_fmt' macro we override the default location of
5ebe4e
# documentation or license files. Instead of them being located in
5ebe4e
# 'urw-base35-fonts-common', they are located in 'urw-base35-fonts' folder.
5ebe4e
%global _docdir_fmt         %{name}
5ebe4e
5ebe4e
5ebe4e
# This will create an auxiliary file if it does not exist, to indicate that X11
5ebe4e
# Logical Font Description database and fontconfig cache needs to be updated.
5ebe4e
%global post_scriptlet()    \
5ebe4e
(                           \
5ebe4e
  if ! [[ -x %{tmpfile} ]]; then \
5ebe4e
    rm -rf   %{tmpdir}      \
5ebe4e
    mkdir -p %{tmpdir}      \
5ebe4e
                            \
5ebe4e
    touch    %{tmpfile}     \
5ebe4e
    chmod +x %{tmpfile}     \
5ebe4e
  fi                        \
5ebe4e
)
5ebe4e
5ebe4e
5ebe4e
# NOTE: At the moment, there's no equivalent of 'posttrans' macro for
5ebe4e
#       uninstallation, meaning we can only use the 'posttrans'.
5ebe4e
#
5ebe4e
#       Because of it , we have to use 'postun' instead. That means this
5ebe4e
#       scriptlet will be called for every font family subpackage being
5ebe4e
#       uninstalled...
5ebe4e
%global postun_scriptlet()  \
5ebe4e
(                           \
5ebe4e
  if [[ $1 -eq 0 ]]; then   \
5ebe4e
    # mkfontscale %{_fontdir} &> /dev/null || : \
5ebe4e
    # mkfontdir   %{_fontdir} &> /dev/null || : \
5ebe4e
    # xset fp rehash          &> /dev/null || : \
5ebe4e
    true || :               \
5ebe4e
  fi                        \
5ebe4e
)
5ebe4e
5ebe4e
5ebe4e
# The content of this scriptlet is only run once during install/update.
5ebe4e
#
5ebe4e
# NOTE: 'xset' is an utility requiring X server to be running. Because of it,
5ebe4e
#       the 'xset fp rehash' will fail to udpate its font database, when the
5ebe4e
#       X server is stopped. This has been already reported (and closed):
5ebe4e
#       https://bugzilla.redhat.com/show_bug.cgi?id=1466254
5ebe4e
%global posttrans_scriptlet() \
5ebe4e
(                             \
5ebe4e
  if [[ -x %{tmpfile} ]]; then \
5ebe4e
    # mkfontscale %{_fontdir}   \
5ebe4e
    # mkfontdir   %{_fontdir}   \
5ebe4e
    # export DISPLAY=:0         \
5ebe4e
    # xset fp rehash &> /dev/null || : \
5ebe4e
    #                          \
5ebe4e
    true || :                 \
5ebe4e
    rm -rf %{tmpdir}          \
5ebe4e
  fi                          \
5ebe4e
)
5ebe4e
5ebe4e
5ebe4e
%global common_desc \
5ebe4e
The Level 2 Core Font Set is a PostScript specification of 35 base fonts that \
5ebe4e
can be used with any PostScript file. In Fedora, these fonts are provided freely \
5ebe4e
by (URW)++ company, and are mainly utilized by applications using Ghostscript.
5ebe4e
5ebe4e
# Necessary after removal of *-nimbus-sans-narrow subpackage.
5ebe4e
# Remove this once F27 is EOL.
5ebe4e
%global obsolete_vers     20170801-4
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
Name:             %{fontname}-fonts
5ebe4e
Summary:          Core Font Set containing 35 freely distributable fonts from (URW)++
5ebe4e
Version:          20170801
5ebe4e
Release:          10%{?dist}
5ebe4e
5ebe4e
# NOTE: (URW)++ holds the copyright, but Artifex Software has obtained rights to
5ebe4e
#       release these fonts under GNU Affero General Public License (version 3).
5ebe4e
License:          AGPLv3
5ebe4e
5ebe4e
URL:              https://www.urwpp.de/en/
5ebe4e
Source:           https://github.com/ArtifexSoftware/urw-base35-fonts/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
5ebe4e
Source1:          urw-fonts-1.0.7pre44.tar.bz2
5ebe4e
5ebe4e
BuildArch:        noarch
5ebe4e
5ebe4e
BuildRequires:    fontpackages-devel
5ebe4e
BuildRequires:    libappstream-glib
5ebe4e
5ebe4e
BuildRequires:    git
5ebe4e
BuildRequires:    sed
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
Provides:         urw-fonts = %{urw_fonts_vers}
5ebe4e
Obsoletes:        urw-fonts < %{urw_fonts_vers}
5ebe4e
5ebe4e
# This is metapackage for installation all font subpackages, require them:
5ebe4e
Requires:         %{name}-common = %{version}-%{release}
5ebe4e
Requires:         %{fontname}-bookman-fonts
5ebe4e
Requires:         %{fontname}-c059-fonts
5ebe4e
Requires:         %{fontname}-d050000l-fonts
5ebe4e
Requires:         %{fontname}-gothic-fonts
5ebe4e
Requires:         %{fontname}-nimbus-mono-ps-fonts
5ebe4e
Requires:         %{fontname}-nimbus-roman-fonts
5ebe4e
Requires:         %{fontname}-nimbus-sans-fonts
5ebe4e
Requires:         %{fontname}-p052-fonts
5ebe4e
Requires:         %{fontname}-standard-symbols-ps-fonts
5ebe4e
Requires:         %{fontname}-z003-fonts
5ebe4e
5ebe4e
# Upstream patches -- official upstream patches released by upstream since the
5ebe4e
# ----------------    last rebase that are necessary for any reason:
5ebe4e
Patch000:         urw-base35-fonts-20170801-000-split-urw-fallback.patch
5ebe4e
Patch001:         urw-base35-fonts-20170801-001-appstream-typos-and-syntax-fix.patch
5ebe4e
Patch002:         urw-base35-fonts-20170801-002-BdOblique-renamed.patch
5ebe4e
Patch003:         urw-base35-fonts-20170801-003-merge-Nimbus-Sans-Narrow.patch
5ebe4e
5ebe4e
%description
5ebe4e
%{common_desc}
5ebe4e
5ebe4e
This meta-package will install all the 35 fonts from the %{name}.
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
# Macro for creating a subpackage for a given font family.
5ebe4e
#
5ebe4e
# USAGE: font_subpkg [-c] [-o old_subpackage_name]
5ebe4e
#  -c    Make this subpackage conflict with the previous versions of URW fonts.
5ebe4e
#  -o    Marks this supbackage to obsolete (& provide) other previous subpackage.
5ebe4e
%define fontfamily_subpkg(co:)                                                   \
5ebe4e
                                                                               \
5ebe4e
%define ff_filename   %(echo %{*} | tr --delete " ")                           \
5ebe4e
%define subpkg_name   %(echo %{*} | tr "A-Z " "a-z-" | sed -e 's/urw-//')      \
5ebe4e
                                                                               \
5ebe4e
%package -n       %{fontname}-%{subpkg_name}-fonts                             \
5ebe4e
Summary:          %{*} font family [part of Level 2 Core Font Set]             \
5ebe4e
Requires:         %{name}-common = %{version}-%{release}                       \
5ebe4e
                                                                               \
5ebe4e
Requires(post):   fontconfig                                                   \
5ebe4e
Requires(post):   xorg-x11-font-utils                                          \
5ebe4e
Requires(post):   xorg-x11-server-utils                                        \
5ebe4e
                                                                               \
5ebe4e
Requires(postun): fontconfig                                                   \
5ebe4e
Requires(postun): xorg-x11-font-utils                                          \
5ebe4e
Requires(postun): xorg-x11-server-utils                                        \
5ebe4e
                                                                               \
5ebe4e
# NOTE: Remove the -o section below once F27 is EOL.                           \
5ebe4e
%{-o:                                                                          \
5ebe4e
Obsoletes:        %{fontname}-%{-o*}-fonts < %{obsolete_vers}                  \
5ebe4e
Provides:         %{fontname}-%{-o*}-fonts < %{obsolete_vers} }                \
5ebe4e
                                                                               \
5ebe4e
# The section below will be only added if the '-c' option was specified:       \
5ebe4e
%{-c:                                                                          \
5ebe4e
Conflicts:        urw-fonts < %{urw_fonts_vers} }                              \
5ebe4e
                                                                               \
5ebe4e
%description -n   %{fontname}-%{subpkg_name}-fonts                             \
5ebe4e
This package contains %{*} font family,                                        \
5ebe4e
which is part of Level 2 Core Font Set.                                        \
5ebe4e
                                                                               \
5ebe4e
%{common_desc}                                                                 \
5ebe4e
                                                                               \
5ebe4e
%post -n %{fontname}-%{subpkg_name}-fonts                                      \
5ebe4e
%{post_scriptlet}                                                              \
5ebe4e
                                                                               \
5ebe4e
%postun -n %{fontname}-%{subpkg_name}-fonts                                    \
5ebe4e
%{postun_scriptlet}                                                            \
5ebe4e
                                                                               \
5ebe4e
%posttrans -n %{fontname}-%{subpkg_name}-fonts                                 \
5ebe4e
%{posttrans_scriptlet}                                                         \
5ebe4e
                                                                               \
5ebe4e
%files -n %{fontname}-%{subpkg_name}-fonts                                     \
5ebe4e
%{_fontdir}/%{ff_filename}*.t1                                                 \
5ebe4e
%{_fontdir}/%{ff_filename}*.afm                                                \
5ebe4e
%{_fontdir}/%{ff_filename}*.otf                                                \
5ebe4e
%{_datadir}/appdata/de.urwpp.%{ff_filename}.metainfo.xml                       \
5ebe4e
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-%{subpkg_name}.conf   \
5ebe4e
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-%{subpkg_name}.conf         \
5ebe4e
# Temporary workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1534206:\
5ebe4e
%exclude %{_fontdir}/StandardSymbolsPS.otf                                     \
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
%package common
5ebe4e
Summary:          Common files of the (URW)++ Level 2 Core Font Set
5ebe4e
Requires:         filesystem
5ebe4e
Requires:         fontpackages-filesystem
5ebe4e
5ebe4e
%description common
5ebe4e
%{common_desc}
5ebe4e
5ebe4e
This package contains the necessary license files for this font set.
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
%package devel
5ebe4e
Summary:          RPM macros related to (URW)++ Level 2 Core Font Set
5ebe4e
Requires:         %{name} = %{version}-%{release}
5ebe4e
5ebe4e
%description devel
5ebe4e
%{common_desc}
5ebe4e
5ebe4e
This package is useful for Fedora development purposes only. It installs RPM
5ebe4e
macros useful for building packages against %{name},
5ebe4e
as well as all the fonts contained in this font set.
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
%package legacy
5ebe4e
Summary:          Legacy version of (URW)++ Level 2 Core Font Set
5ebe4e
5ebe4e
%description legacy
5ebe4e
%{common_desc}
5ebe4e
5ebe4e
This package provides previous (legacy) versions of these fonts, which are still
5ebe4e
required by some of the software in Fedora, like e.g. xfig, X11, etc.
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
# NOTE: When making an update, make sure to check if any font families were
5ebe4e
#       added/removed. We always need to pack all the fonts into subpackages.
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
%fontfamily_subpkg C059
5ebe4e
%fontfamily_subpkg D050000L
5ebe4e
%fontfamily_subpkg Nimbus Mono PS -c
5ebe4e
%fontfamily_subpkg Nimbus Roman -c
5ebe4e
%fontfamily_subpkg Nimbus Sans -c -o nimbus-sans-narrow
5ebe4e
%fontfamily_subpkg P052
5ebe4e
%fontfamily_subpkg Standard Symbols PS -c
5ebe4e
%fontfamily_subpkg URW Bookman -c
5ebe4e
%fontfamily_subpkg URW Gothic -c
5ebe4e
%fontfamily_subpkg Z003
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
# We need to ship the legacy fonts for now as well (BZ #1551219):
5ebe4e
%prep
5ebe4e
%autosetup -N -S git
5ebe4e
5ebe4e
mkdir -p legacy
5ebe4e
tar --directory=legacy/ -xf %{SOURCE1}
5ebe4e
rm -f legacy/ChangeLog legacy/README* legacy/fonts*
5ebe4e
5ebe4e
# Amend all the files to the initial commit, and patch the sources:
5ebe4e
git add --all --force
5ebe4e
git commit --all --amend --no-edit > /dev/null
5ebe4e
%autopatch -p1
5ebe4e
5ebe4e
%install
5ebe4e
install -m 0755 -d %{buildroot}%{_fontdir}
5ebe4e
install -m 0755 -d %{buildroot}%{_datadir}/appdata
5ebe4e
install -m 0755 -d %{buildroot}%{_datadir}/fontconfig/conf.avail
5ebe4e
install -m 0755 -d %{buildroot}%{_sysconfdir}/fonts/conf.d
5ebe4e
install -m 0755 -d %{buildroot}%{legacydir}
5ebe4e
install -m 0755 -d %{buildroot}%{_datadir}/licenses/urw-fonts
5ebe4e
5ebe4e
install -m 0644 -p fonts/*.t1  %{buildroot}%{_fontdir}
5ebe4e
install -m 0644 -p fonts/*.afm %{buildroot}%{_fontdir}
5ebe4e
install -m 0644 -p fonts/*.otf %{buildroot}%{_fontdir}
5ebe4e
install -m 0644 -p legacy/*.afm legacy/*.pfm legacy/*.pfb %{buildroot}%{legacydir}
5ebe4e
install -m 0644 -p legacy/COPYING %{buildroot}%{_datadir}/licenses/urw-fonts
5ebe4e
5ebe4e
install -m 0644 -p appstream/*.metainfo.xml %{buildroot}%{_datadir}/appdata/
5ebe4e
5ebe4e
# Install the fontconfig files with correct priority for our distribution:
5ebe4e
for file in fontconfig/*.conf; do
5ebe4e
  DISTRO_FILENAME="%{fontconfig_prio}-$(basename $file)"
5ebe4e
  install -m 0644 -p $file %{buildroot}%{_datadir}/fontconfig/conf.avail/$DISTRO_FILENAME
5ebe4e
  ln -sf %{_datadir}/fontconfig/conf.avail/$DISTRO_FILENAME %{buildroot}%{_sysconfdir}/fonts/conf.d/$DISTRO_FILENAME
5ebe4e
done
5ebe4e
5ebe4e
# Some of the fontconfig files are not to be shipped:
5ebe4e
#  * urw-fallback-specifics.conf - these mappings are already provided by fontconfig
5ebe4e
#  * urw-fallback-generics.conf - no use-cases for this as far as we know
5ebe4e
rm -f %{buildroot}%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-fallback-{specifics,generics}.conf
5ebe4e
rm -f %{buildroot}%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-fallback-{specifics,generics}.conf
5ebe4e
5ebe4e
# We need to touch these files -- otherwise running 'rpm --setperms' would
5ebe4e
# result in these files having incorrect permissions like this: [-------.]
5ebe4e
#touch %{buildroot}%{_fontdir}/fonts.dir
5ebe4e
#touch %{buildroot}%{_fontdir}/fonts.scale
5ebe4e
touch %{buildroot}%{legacydir}/fonts.dir
5ebe4e
touch %{buildroot}%{legacydir}/fonts.scale
5ebe4e
5ebe4e
# Install the symlink for the X11 Logical Font Description to actually work:
5ebe4e
install -m 0755 -d %{buildroot}%{_sysconfdir}/X11/fontpath.d
5ebe4e
#ln -sf %{_fontdir} %{buildroot}%{_sysconfdir}/X11/fontpath.d/%{name}
5ebe4e
ln -sf %{legacydir} %{buildroot}%{_sysconfdir}/X11/fontpath.d/urw-fonts
5ebe4e
5ebe4e
# Generate the macro containing the path to our fonts:
5ebe4e
install -m 0755 -d %{buildroot}%{_rpmconfigdir}/macros.d
5ebe4e
5ebe4e
cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name} << _EOF
5ebe4e
%%urw_base35_fontpath    %{_fontdir}
5ebe4e
_EOF
5ebe4e
5ebe4e
# Check that the AppStream files are valid and safe. Otherwise they might not
5ebe4e
# get used in Gnome Software...
5ebe4e
%check
5ebe4e
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.metainfo.xml
5ebe4e
5ebe4e
%post legacy
5ebe4e
mkfontscale %{legacydir}
5ebe4e
mkfontdir   %{legacydir}
5ebe4e
export DISPLAY=:0
5ebe4e
xset fp rehash &> /dev/null || :
5ebe4e
5ebe4e
%postun legacy
5ebe4e
mkfontscale %{legacydir}
5ebe4e
mkfontdir   %{legacydir}
5ebe4e
export DISPLAY=:0
5ebe4e
xset fp rehash &> /dev/null || :
5ebe4e
5ebe4e
# NOTE: There's no reason to run 'post' and 'postun' scriptlets for the main
5ebe4e
#       metapackage or the *-common subpackage. Everything necessary is handled
5ebe4e
#       by any of the actual font family subpackages.
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
%files
5ebe4e
%{_datadir}/appdata/de.urwpp.URWCoreFontSetLevel2.metainfo.xml
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
%files common
5ebe4e
%license LICENSE COPYING
5ebe4e
5ebe4e
%dir %{_fontdir}
5ebe4e
#%ghost %verify (not md5 size mtime) %{_fontdir}/fonts.dir
5ebe4e
#%ghost %verify (not md5 size mtime) %{_fontdir}/fonts.scale
5ebe4e
5ebe4e
%{_datadir}/fontconfig/conf.avail/%{fontconfig_prio}-urw-fallback-backwards.conf
5ebe4e
%{_sysconfdir}/fonts/conf.d/%{fontconfig_prio}-urw-fallback-backwards.conf
5ebe4e
#%{_sysconfdir}/X11/fontpath.d/%{name}
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
%files devel
5ebe4e
%{_rpmconfigdir}/macros.d/macros.%{name}
5ebe4e
5ebe4e
# ---------------
5ebe4e
5ebe4e
%files legacy
5ebe4e
%license %{_datadir}/licenses/urw-fonts/COPYING
5ebe4e
%ghost %verify (not md5 size mtime) %{legacydir}/fonts.dir
5ebe4e
%ghost %verify (not md5 size mtime) %{legacydir}/fonts.scale
5ebe4e
%{_sysconfdir}/X11/fontpath.d/urw-fonts
5ebe4e
%{legacydir}/*.afm
5ebe4e
%{legacydir}/*.pfm
5ebe4e
%{legacydir}/*.pfb
5ebe4e
5ebe4e
# =============================================================================
5ebe4e
5ebe4e
%changelog
5ebe4e
* Mon Jun 18 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-10
5ebe4e
- fc-cache call dropped (from scriptlets)
5ebe4e
5ebe4e
* Fri Apr 06 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-9
5ebe4e
- *-legacy subpackage introduced (temporary workaround for BZ #1551219)
5ebe4e
5ebe4e
* Wed Feb 28 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-8
5ebe4e
- copy-paste error fixed in de.urwpp.URWCoreFontSetLevel2.metainfo.xml file
5ebe4e
5ebe4e
* Wed Feb 21 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-7
5ebe4e
- added %%check section for validation of AppStream files
5ebe4e
5ebe4e
* Mon Feb 19 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-6
5ebe4e
- temporary workaround for BZ #1534206
5ebe4e
5ebe4e
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170801-5
5ebe4e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
5ebe4e
5ebe4e
* Thu Jan 11 2018 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-4
5ebe4e
- added missing Obsoletes/Provides for *-nimbus-sans-narrow subpackage
5ebe4e
5ebe4e
* Wed Dec 13 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> 20170801-3
5ebe4e
- *-devel subpackage added
5ebe4e
- typos & syntax fixed for AppStream files
5ebe4e
- NimbusSansNarrow-BdOblique.* renamed to *-BoldOblique
5ebe4e
- *-nimbus-sans-narrow subpackage dropped
5ebe4e
- priority/ordering decreased [60->61]
5ebe4e
- ship *.otf format files as well
5ebe4e
5ebe4e
* Mon Sep 25 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-2
5ebe4e
- urw-base35-fonts-20170801-000-split-urw-fallback.patch added
5ebe4e
- decrease the fontconfig priority/ordering value to 60 (bug #1494850)
5ebe4e
- set same priority value for urw-fallback.conf as for other files (bug #1495199)
5ebe4e
5ebe4e
* Fri Sep 22 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20170801-1
5ebe4e
- rebase to 20170801 version
5ebe4e
- removed urw-* string from subpackages
5ebe4e
- fontconfig priority value updated to 35
5ebe4e
- error messages from 'xset fp rehash' suppressed (bug #1466254)
5ebe4e
- AppStream files added into (sub)packages
5ebe4e
- fontconfig files added into (sub)packages
5ebe4e
- fixed fonts path during %%install
5ebe4e
- source location updated to point at github.com
5ebe4e
5ebe4e
* Mon Jun 05 2017 David Kaspar [Dee'Kej] <dkaspar@redhat.com> - 20160926-1
5ebe4e
- %%description line in 'fontfamily_subpkg' macro split
5ebe4e
- requirement for 'fontpackages-filesystem' added
5ebe4e
- mark 'font.dir' and 'font.scale' as %%ghost files
5ebe4e
- fix the upgrading process (for Obsoletes|Provides|Conflicts)
5ebe4e
- simplify creation of the subpackages with auxiliary %%fontfamily_subpkg macro
5ebe4e
- update the fontconfig cache and X11 Logical Font Description database
5ebe4e
  (during install/update/erase)
5ebe4e
- initial version of specfile created
5ebe4e