#1 Convert to new fonts packaging guidelines
Merged 4 years ago by pnemade. Opened 4 years ago by pnemade.
Unknown source master  into  master

30-0-google-arimo-fonts.conf 30-0-google-croscore-arimo-fontconfig.conf
file renamed
file was moved with no change to the file
30-0-google-cousine-fonts.conf 30-0-google-croscore-cousine-fontconfig.conf
file renamed
file was moved with no change to the file
30-0-google-tinos-fonts.conf 30-0-google-croscore-tinos-fontconfig.conf
file renamed
file was moved with no change to the file
62-google-arimo-fonts.conf 62-google-croscore-arimo-fontconfig.conf
file renamed
file was moved with no change to the file
62-google-cousine-fonts.conf 62-google-croscore-cousine-fontconfig.conf
file renamed
file was moved with no change to the file
@@ -1,17 +0,0 @@

- <?xml version="1.0" encoding="UTF-8"?>

- <!DOCTYPE fontconfig SYSTEM "../fonts.dtd">

- <fontconfig>

-   <alias binding="same">

-     <family>Symbol</family>

-     <accept>

-       <family>Symbol Neu</family>

-     </accept>

-   </alias>

-   <alias binding="same">

-     <family>Symbol Neu</family>

-      <default>

-        <family>Symbol</family>

-      </default>

-    </alias>

- </fontconfig>

- 

62-google-tinos-fonts.conf 62-google-croscore-tinos-fontconfig.conf
file renamed
file was moved with no change to the file
@@ -1,20 +0,0 @@

- <?xml version="1.0" encoding="UTF-8"?>

- <!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->

- <component type="font">

-   <id>google-croscore</id>

-   <metadata_license>CC-BY-3.0</metadata_license>

-   <name>Arimo</name>

-   <summary>The croscore Arimo family fonts</summary>

-   <description>

-     <p>

-       Arimo was designed by Steve Matteson as an innovative, refreshing sans serif

-       design that is metrically compatible with Arial. Arimo offers improved

-       on-screen readability characteristics and the pan-European WGL character set

-       and solves the needs of developers looking for width-compatible fonts to

-       address document portability across platforms.

-     </p>

-   </description>

-   <updatecontact>pnemade_at_redhat_dot_com</updatecontact>

-   <url type="homepage"></url>

- </component>

- 

@@ -1,20 +0,0 @@

- <?xml version="1.0" encoding="UTF-8"?>

- <!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->

- <component type="font">

-   <id>google-croscore</id>

-   <metadata_license>CC-BY-3.0</metadata_license>

-   <name>Cousine</name>

-   <summary>The croscore Cousine family fonts</summary>

-   <description>

-     <p>

-       Cousine was designed by Steve Matteson as an innovative, refreshing sans serif

-       design that is metrically compatible with Courier New. Cousine offers improved

-       on-screen readability characteristics and the pan-European WGL character set

-       and solves the needs of developers looking for width-compatible fonts to

-       address document portability across platforms.

-     </p>

-   </description>

-   <updatecontact>pnemade_at_redhat_dot_com</updatecontact>

-   <url type="homepage"></url>

- </component>

- 

file modified
+80 -112
@@ -1,150 +1,118 @@

- %global fontname google-croscore

- %global fontconf62 62-%{fontname}

- %global fontconf30 30-0-%{fontname}

+ BuildArch: noarch

  

- %global common_desc \

- This package contains a collections of fonts that offers improved on-screen \

- readability characteristics and the pan-European WGL character set and solves \

- the needs of developers looking for width-compatible fonts to address document \

- portability across platforms.

- 

- 

- Name:           %{fontname}-fonts

  Version:        1.31.0

- Release:        5%{?dist}

- Summary:        The width-compatible fonts for improved on-screen readability

- 

+ Release:        6%{?dist}

  License:        ASL 2.0

  #URL:            

- Source0:        http://gsdview.appspot.com/chromeos-localmirror/distfiles/croscorefonts-%{version}.tar.bz2

- 

- Source1:        62-%{fontname}-arimo-fontconfig.conf

- Source2:        62-%{fontname}-cousine-fontconfig.conf

- Source3:        62-%{fontname}-tinos-fontconfig.conf

- Source4:        30-0-%{fontname}-arimo-fontconfig.conf

- Source5:        30-0-%{fontname}-cousine-fontconfig.conf

- Source6:        30-0-%{fontname}-tinos-fontconfig.conf

- 

- # Upstream has not provided license text in their tarball release

- # Add ASL2.0 license text in LICENSE-2.0.txt file

- Source8:        LICENSE-2.0.txt

  

- # metainfo files for gnome-software

- Source9:        %{fontname}-arimo.metainfo.xml

- Source10:        %{fontname}-cousine.metainfo.xml

- Source11:        %{fontname}-tinos.metainfo.xml

+ %global foundry           google

+ %global fontlicense       ASL 2.0

+ %global fontlicenses      LICENSE-2.0.txt

  

- BuildArch:      noarch

- BuildRequires:  fontpackages-devel

+ %global common_description %{expand:

+ This package contains a collections of fonts that offers improved on-screen

+ readability characteristics and the pan-European WGL character set and solves

+ the needs of developers looking for width-compatible fonts to address document

+ portability across platforms.}

  

- %description

- %common_desc

- 

- 

- %package common

- Summary:        Common files of %{name}

- Requires:       fontpackages-filesystem

- 

- # As upstream stopped distributing SymbolNeu font, let's obsolete this subpackage.

- Obsoletes:      google-croscore-symbolneu-fonts < 1.31.0-1

+ %global fontsummary The width-compatible fonts for improved on-screen readability

  

- %description common

- This package consists of files used by other %{name} packages.

+ %global archivename croscorefonts-%{version}

  

+ %global fontfamily1       Arimo

+ %global fontsummary1      The croscore Arimo family fonts

+ %global fontpkgheader1    %{expand:

+ Provides:  google-croscore-arimo-fonts = %{version}-%{release}

+ Obsoletes: google-croscore-arimo-fonts < %{version}-%{release}

+ }

+ %global fonts1            Arimo*.ttf

+ %global fontconfs1        %{SOURCE1} %{SOURCE4}

+ %global fontdescription1  %{expand:

+ %{common_description}

  

- %package -n %{fontname}-arimo-fonts

- Summary:       The croscore Arimo family fonts 

- Requires:       %{name}-common = %{version}-%{release}

- 

- %description -n %{fontname}-arimo-fonts

- %common_desc

  Arimo was designed by Steve Matteson as an innovative, refreshing sans serif

  design that is metrically compatible with Arial. Arimo offers improved 

  on-screen readability characteristics and the pan-European WGL character set 

  and solves the needs of developers looking for width-compatible fonts to 

- address document portability across platforms.

- 

- %_font_pkg -n arimo -f *-%{fontname}-arimo.conf Arimo*.ttf

- %{_datadir}/appdata/%{fontname}-arimo.metainfo.xml

+ address document portability across platforms.}

+ 

+ %global fontfamily2       Cousine

+ %global fontsummary2      The croscore Cousine family fonts

+ %global fontpkgheader2    %{expand:

+ Provides:  google-croscore-cousine-fonts = %{version}-%{release}

+ Obsoletes: google-croscore-cousine-fonts < %{version}-%{release}

+ }

+ %global fonts2            Cousine*.ttf

+ %global fontconfs2        %{SOURCE2} %{SOURCE5}

+ %global fontdescription2  %{expand:

+ %{common_description}

  

- %package -n %{fontname}-cousine-fonts

- Summary:       The croscore Cousine family fonts

- Requires:       %{name}-common = %{version}-%{release}

- 

- %description -n %{fontname}-cousine-fonts

- %common_desc

  Cousine was designed by Steve Matteson as an innovative, refreshing sans serif

  design that is metrically compatible with Courier New. Cousine offers improved

  on-screen readability characteristics and the pan-European WGL character set

  and solves the needs of developers looking for width-compatible fonts to 

- address document portability across platforms.

- 

- %_font_pkg -n cousine -f *-%{fontname}-cousine.conf  Cousine*.ttf

- %{_datadir}/appdata/%{fontname}-cousine.metainfo.xml

+ address document portability across platforms.}

+ 

+ %global fontfamily3       Tinos

+ %global fontsummary3      The croscore Tinos family fonts

+ %global fontpkgheader3    %{expand:

+ Provides:  google-croscore-tinos-fonts = %{version}-%{release}

+ Obsoletes: google-croscore-tinos-fonts < %{version}-%{release}

+ }

+ %global fonts3            Tinos*.ttf

+ %global fontconfs3        %{SOURCE3} %{SOURCE6}

+ %global fontdescription3  %{expand:

+ %{common_description}

  

- %package -n %{fontname}-tinos-fonts

- Summary:       The croscore Tinos family fonts

- Requires:       %{name}-common = %{version}-%{release}

- 

- %description -n %{fontname}-tinos-fonts

- %common_desc

  Tinos was designed by Steve Matteson as an innovative, refreshing serif design

  that is metrically compatible with Times New Roman. Tinos offers improved

  on-screen readability characteristics and the pan-European WGL character set

  and solves the needs of developers looking for width-compatible fonts to

- address document portability across platforms.

+ address document portability across platforms.}

+ 

+ 

+ Source0:        http://gsdview.appspot.com/chromeos-localmirror/distfiles/%{archivename}.tar.bz2

+ 

+ Source1:        62-%{fontpkgname1}.conf

+ Source2:        62-%{fontpkgname2}.conf

+ Source3:        62-%{fontpkgname3}.conf

+ Source4:        30-0-%{fontpkgname1}.conf

+ Source5:        30-0-%{fontpkgname2}.conf

+ Source6:        30-0-%{fontpkgname3}.conf

+ 

+ # Upstream has not provided license text in their tarball release

+ # Add ASL2.0 license text in LICENSE-2.0.txt file

+ Source8:        LICENSE-2.0.txt

  

- %_font_pkg -n tinos -f *-%{fontname}-tinos.conf Tinos*.ttf

- %{_datadir}/appdata/%{fontname}-tinos.metainfo.xml

+ Name: google-croscore-fonts

+ Summary: The width-compatible fonts for improved on-screen readability

+ 

+ %description

+ %wordwrap -v common_description

+ 

+ %fontpkg -a

  

  %prep

  %setup -q -n croscorefonts-%{version}

  cp -p %{SOURCE8} .

  

  %build

- 

+ %fontbuild -a

  

  %install

- install -m 0755 -d %{buildroot}%{_fontdir}

- install -m 0644 -p *.ttf %{buildroot}%{_fontdir}

- 

- install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \

-                    %{buildroot}%{_fontconfig_confdir}

- 

- # Repeat for every font family

- install -m 0644 -p %{SOURCE1} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf62}-arimo.conf

- install -m 0644 -p %{SOURCE2} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf62}-cousine.conf

- install -m 0644 -p %{SOURCE3} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf62}-tinos.conf

- install -m 0644 -p %{SOURCE4} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf30}-arimo.conf

- install -m 0644 -p %{SOURCE5} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf30}-cousine.conf

- install -m 0644 -p %{SOURCE6} \

-         %{buildroot}%{_fontconfig_templatedir}/%{fontconf30}-tinos.conf

- 

- for fconf in %{fontconf62}-arimo.conf %{fontconf30}-arimo.conf \

-              %{fontconf62}-cousine.conf %{fontconf30}-cousine.conf \

-              %{fontconf62}-tinos.conf %{fontconf30}-tinos.conf

- do

-   ln -s %{_fontconfig_templatedir}/$fconf \

-         %{buildroot}%{_fontconfig_confdir}/$fconf

- done

- 

- # Add AppStream metadata

- install -Dm 0644 -p %{SOURCE9} \

-         %{buildroot}%{_datadir}/appdata/%{fontname}-arimo.metainfo.xml

- install -Dm 0644 -p %{SOURCE10} \

-         %{buildroot}%{_datadir}/appdata/%{fontname}-cousine.metainfo.xml

- install -Dm 0644 -p %{SOURCE11} \

-         %{buildroot}%{_datadir}/appdata/%{fontname}-tinos.metainfo.xml

- 

- %files common

- %license LICENSE-2.0.txt

+ echo %{fontpkgname}

+ %fontinstall -a

+ 

+ %check

+ %fontcheck -a

+ 

+ %fontfiles -a

  

  %changelog

+ * Tue Mar 10 2020 Parag Nemade <pnemade AT redhat DOT com> - 1.31.0-6

+ - Convert to new fonts packaging guidelines

+ - Dropped Obsoletes: google-croscore-symbolneu-fonts (Added in F29)

+ 

  * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.31.0-5

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

  

@@ -1,20 +0,0 @@

- <?xml version="1.0" encoding="UTF-8"?>

- <!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->

- <component type="font">

-   <id>google-croscore</id>

-   <metadata_license>CC-BY-3.0</metadata_license>

-   <name>Tinos</name>

-   <summary>The croscore Tinos family fonts</summary>

-   <description>

-     <p>

-       Tinos was designed by Steve Matteson as an innovative, refreshing serif design

-       that is metrically compatible with Times New Roman. Tinos offers improved

-       on-screen readability characteristics and the pan-European WGL character set

-       and solves the needs of developers looking for width-compatible fonts to

-       address document portability across platforms.

-     </p>

-   </description>

-   <updatecontact>pnemade_at_redhat_dot_com</updatecontact>

-   <url type="homepage"></url>

- </component>

- 

Few things to note in this conversion
1) Dropped Obsoletes: google-croscore-symbolneu-fonts (Added in F29)
2) binary packages got renamed (dropping croscore word as in cannot be filled anywhere in spec)
3) Added Obsoletes: and Provides: for this renaming of binary packages
4) I did not understand why new guidelines in this spec asked me to fill
Name, Summary and License tags (line 20, 161 and 162)
5) fontconfig files got renamed, as I kept source file name as it is
/etc/fonts/conf.d/62-google-croscore-arimo.conf to /etc/fonts/conf.d/62-google-croscore-arimo-fontconfig.conf

@nim I tried this package to convert to new packaging guidelines.

Can you please review it and also check all above 5 points above looks fine?

Hi @pnemade

  1. ok, old obsoletes, clean up time

  2. ok too, crosscore is not part of the actual family name, we try to generate the same packages regardless of the source package naming now to resist to upstream release mode changes (ie smc IIRC)

  3. ok (the provides are a matter of taste because guidelines ask non-font packages to depend on the font() provides, but probably a good idea for a widely used set of font packages like this one)

  4. you need to fill metadata for the SRPM, because it does not match any of the produced font packages. If the SRPM was named the same way as the first font package, it could inherit all the metadata of this package (and you’d use a %fontfamily0 block).

    The reason License is on top of the spec and not next to Name is to allow people that wish to to reuse %{license} in their %global fontlicense line. The License line sets the %{license} variable

    You can diff the multi and sub spec templates in fonts-rpm-templates, that will show you the exact differences between subpackaging in a srpm named after the first font family, and subpackaging in a completely different srpm (as happens in golang-x-image for example)

  5. sure, name the fontconfig files anyway you wish, as long as it works for you, the pattern in the templates is just easier for new packages.

I hope I answered everything, don’t hesitate to ask if there is something else you do not understand, or that could be improved documentation or automation side.

Apart from that, you cut and pasted the fontpkgheader2 block without changing its suffix number, so only your second package will get obsoletes (and not the ones you want).

Easy mistake to make – unfortunately rpm does not permit declaring structured variables, so everything relies on consistent suffix numbers.

Except for the header part, looks good. I’d have used source 11/12/13 and 21/22/23 to remember which source is supposed to end in which package, but that’s only to compensate my lack of braincells, and because it gets harder the more font families are shipped by a single upstream.

Thank you very much for brief review.

I noticed the difference between multi and sub spec template files.

I have made the changes and I think these changes are good to get merged.

Looks fine to me

You may add a %fontmetapkg after the %fontpkg -a line, that will autogenerate a fonts-all metapackage. But, it’s a matter of maintainer taste, not an obligation.

Otherwise, just merge it and try the result in F33, it’s not as if rawhide has many users right now, with F32 on the finish line. You’ll have plenty of time to adjust things if something does not please you.

Pull-Request has been merged by pnemade

4 years ago

Let's leave the metapackage for now. If needed we can add it later.