fontpackages

The fontpackages project is an effort to streamline font packaging, helping font packagers to produce clean, consistent and sane packages.

PR#1 Merged Update the spec file templates

Proposed 7 months ago by pnemade
Modified 7 months ago
From forks/pnemade/fontpackages master  into fontpackages master

Here I have tried to update the fonts spec file templates according to current packaging guidelines.

file changed

@@ -87,8 +87,6 @@ 

  \

  \

  %files -n %{spn} \

- %defattr(0644,root,root,0755) \

- \

  %dir %{_fontdir} \

  %{lua: \

  for arg=1,rpm.expand("%#") do \

@@ -12,14 +12,15 @@ 

  Release:        1%{?dist}

  Summary:        

  

- Group:          User Interface/X

  License:        

  URL:            

  Source0:        

- Source1:        %{name}-fontconfig.conf

+ Source1:        %{name}-<FAMILYX>-fontconfig.conf

+ Source2:        %{fontname}-<FAMILYX>.metainfo.xml

  

  BuildArch:      noarch

  BuildRequires:  fontpackages-devel

+ BuildRequires:  libappstream-glib

  

  %description

  %common_desc

@@ -35,28 +36,26 @@

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

  

  # Repeat for every font family ➅

- %package -n %{fontname}-<FAMILY>-fonts

+ %package -n %{fontname}-<FAMILYX>-fonts

  Summary:        

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

  

- %description -n %{fontname}-<FAMILY>-fonts

+ %description -n %{fontname}-<FAMILYX>-fonts

  %common_desc

  

- <FAMILY DESCRIPTION>

- 

- %_font_pkg -n <FAMILY> -f %{fontconf}-<FAMILY>.conf <NAME>*.ttf

+ <FAMILYX DESCRIPTION>

  

+ %_font_pkg -n <FAMILYX> -f %{fontconf}-<FAMILYX>.conf <NAME>*.ttf

+ %{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

  

  %prep

- %setup -q

+ %autosetup

  

  

  %build

  

  

  %install

- rm -fr %{buildroot}

- 

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

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

  

@@ -74,14 +73,18 @@

          %{buildroot}%{_fontconfig_confdir}/$fconf

  done

  

+ # Add AppStream metadata file, Repeat for every font family

+ install -Dm 0644 -p %{SOURCEX} \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

  

- %clean

- rm -fr %{buildroot}

- 

+ %check

+ # Repeat for every font family

+ appstream-util validate-relax --nonet \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

  

  %files common

- %defattr(0644,root,root,0755)

- %doc 

+ %license add-license-file-here

+ %doc add-docs-here

  

  

  %changelog

@@ -5,10 +5,12 @@ 

  %global common_font_desc \

  <FONT COLLECTION DESCRIPTION: ②>

  

- Source1:        %{name}-<FAMILY>-fontconfig.conf

+ Source1:        %{name}-<FAMILYX>-fontconfig.conf

+ Source2:        %{fontname}-<FAMILYX>.metainfo.xml

  # …

  

  BuildRequires:  fontpackages-devel

+ BuildRequires:  libappstream-glib

  

  %description

  %common_font_desc

@@ -16,7 +18,6 @@

  

  %package fonts-common

  Summary:        Common files of <NAME>

- Group:          User Interface/X

  BuildArch:      noarch

  Requires:       fontpackages-filesystem

  

@@ -27,25 +28,25 @@

  

  

  # Repeat for every font family ③

- %package <FAMILY>-fonts

+ %package <FAMILYX>-fonts

  Summary:        

- Group:          User Interface/X

  BuildArch:      noarch

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

  

- %description -n %{fontname}-<FAMILY>-fonts

+ %description -n %{fontname}-<FAMILYX>-fonts

  %common_font_desc

  

- <FAMILY DESCRIPTION>

+ <FAMILYX DESCRIPTION>

  

- %_font_pkg -n <FAMILY> -f %{fontconf}-<FAMILY>.conf <NAME>*.ttf

+ %_font_pkg -n <FAMILYX> -f %{fontconf}-<FAMILYX>.conf <NAME>*.ttf

  

  %doc <FONT DOCUMENTATION>

+ %license add-license-file-here

+ %{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

  

  # …

  

  %install

- rm -fr %{buildroot}

  

  # …

  

@@ -66,11 +67,22 @@

          %{buildroot}%{_fontconfig_confdir}/$fconf

  done

  

+ # Add AppStream metadata file, Repeat for every font family

+ install -Dm 0644 -p %{SOURCEX} \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

+ 

+ # …

+ 

+ %check

+ # Repeat for every font family

+ appstream-util validate-relax --nonet \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}-<FAMILYX>.metainfo.xml

+ 

  # …

  

  %files common

- %defattr(0644,root,root,0755)

  %doc <FONT DOCUMENTATION>

+ %license add-license-file-here

  

  # …

  

@@ -3,15 +3,16 @@ 

  # …

  

  Source1:        %{name}-<FAMILY>-fontconfig.conf

+ Source2:        %{fontname}.metainfo.xml

  # …

  

  BuildRequires:  fontpackages-devel

+ BuildRequires:  libappstream-glib

  

  # …

  

  %package <FAMILY>-fonts

  Summary:        

- Group:          User Interface/X

  BuildArch:      noarch

  Requires:       fontpackages-filesystem

  

@@ -22,11 +23,12 @@

  %_font_pkg -n <FAMILY> -f %{fontconf} <NAME>*.ttf

  

  %doc <FONT DOCUMENTATION>

+ %license add-license-file-here

+ %{_datadir}/metainfo/%{fontname}.metainfo.xml

  

  # …

  

  %install

- rm -fr %{buildroot}

  

  # …

  

@@ -41,6 +43,14 @@

  ln -s %{_fontconfig_templatedir}/%{fontconf} \

        %{buildroot}%{_fontconfig_confdir}/%{fontconf}

  

+ # Add AppStream metadata file

+ install -Dm 0644 -p %{SOURCE2} \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}.metainfo.xml

+ 

+ %check

+ appstream-util validate-relax --nonet \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}.metainfo.xml

+ 

  # …

  

  

@@ -8,29 +8,29 @@ 

  Release:        1%{?dist}

  Summary:        

  

- Group:          User Interface/X

  License:        

  URL:            

  Source0:        

  Source1:        %{name}-fontconfig.conf

+ Source2:        %{fontname}.metainfo.xml

  

  BuildArch:      noarch

  BuildRequires:  fontpackages-devel

+ BuildRequires:  libappstream-glib

+ 

  Requires:       fontpackages-filesystem

  

  %description

  

  

  %prep

- %setup -q

+ %autosetup

  

  

  %build

  

  

  %install

- rm -fr %{buildroot}

- 

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

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

  

@@ -42,15 +42,19 @@

  ln -s %{_fontconfig_templatedir}/%{fontconf} \

        %{buildroot}%{_fontconfig_confdir}/%{fontconf}

  

+ # Add AppStream metadata file

+ install -Dm 0644 -p %{SOURCE2} \

+         %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml

  

- %clean

- rm -fr %{buildroot}

- 

+ %check

+ appstream-util validate-relax --nonet \

+         %{buildroot}%{_datadir}/metainfo/%{fontname}.metainfo.xml

  

  %_font_pkg -f %{fontconf} *.ttf

  

- %doc

- 

+ %license add-license-file-here

+ %doc add-docs-here

+ %{_datadir}/metainfo/%{fontname}.metainfo.xml

  

  %changelog

  

I guess it's good to have metadata of appstream there too?

7 months ago

1 new commit added

I have tried to add appstream files support here. Please review this PR :)

tagoh commented on line 10 of spec-templates/spectemplate-fonts-multi.spec.
7 months ago
(Hide)
maybe nice to keep consistency with the following example. I meant %{fontname}-%{FAMILYX}.metainfo.xml instead and add a comment here to have for all of fonts. also nice to update for fontconfig one as well?
tagoh commented on line 23 of spec-templates/spectemplate-fonts-multi.spec.
7 months ago
(Hide)
likewise
tagoh commented on line 5 of spec-templates/spectemplate-fonts-partial-multi.spec.
7 months ago
(Hide)
likewise
tagoh commented on line 34 of spec-templates/spectemplate-fonts-partial-multi.spec.
7 months ago
(Hide)
likewise
7 months ago

8 new commits added

tagoh commented on line 38 of spec-templates/spectemplate-fonts-multi.spec.
7 months ago
(Hide)
trivial things though, missing -<FAMILYX> stuff here.
tagoh commented on line 7 of spec-templates/spectemplate-fonts-partial-multi.spec.
7 months ago
(Hide)
maybe %{fontname}-<FAMILYX>.metainfo.xml? because we have the metadata per sub-packages?
7 months ago

8 new commits added

tagoh commented on line 46 of spec-templates/spectemplate-fonts-partial-multi.spec.
7 months ago
(Hide)
missing -<FAMILYX> here?
7 months ago

8 new commits added

Updated Please check. Hopefully I have not missed anything now :)

Everything looks good to me now :)

7 months ago

Pull-Request has been merged by tagoh