Convert this package to new fonts packaging guidelines

Signed-off-by: Parag Nemade <pnemade@fedoraproject.org>
This commit is contained in:
Parag Nemade 2021-11-11 07:30:11 +05:30
parent 66fc83d56a
commit d9e04fd509
No known key found for this signature in database
GPG Key ID: 71932951EB71E972
3 changed files with 28 additions and 65 deletions

View File

@ -1,5 +1,5 @@
<?xml version ="1.0" encoding="UTF-8" ?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>

View File

@ -1,66 +1,47 @@
%global fontname aajohan-comfortaa
%global fontconf 61-%{fontname}.conf
Name: %{fontname}-fonts
Version: 3.101
Release: 2%{?dist}
Summary: Modern style true type font
Release: 3%{?dist}
URL: https://www.deviantart.com/aajohan
License: OFL
URL: http://aajohan.deviantart.com
Source0: https://github.com/googlefonts/comfortaa/archive/%{version}%{?prerelease}/%{name}-%{version}%{?prerelease}.tar.gz
Source1: %{name}-fontconfig.conf
Source2: %{fontname}.metainfo.xml
%global foundry Aajohan
%global fontlicense OFL
%global fontlicenses OFL.txt
%global fontdocs AUTHORS.txt CONTRIBUTORS.txt FONTLOG.txt DESCRIPTION.en_us.html README.md
%global fontdocsex %{fontlicenses}
BuildArch: noarch
BuildRequires: fontpackages-devel
BuildRequires: libappstream-glib
Requires: fontpackages-filesystem
%description
%global fontfamily Comfortaa
%global fontsummary Modern style true type font
%global fonts fonts/OTF/*.otf fonts/TTF/*.ttf
%global fontconfs %{SOURCE1}
%global fontdescription %{expand:
Comfortaa is a sans-serif font comfortable in every aspect with
Bold, Regular, and Thin variants.
It has very good European language coverage and decent Cyrillic coverage.
It has very good European language coverage and decent Cyrillic coverage.}
Source0: https://github.com/googlefonts/comfortaa/archive/%{version}%{?prerelease}/%{name}-%{version}%{?prerelease}.tar.gz
Source1: 61-%{fontpkgname}.conf
%fontpkg
%prep
%autosetup -n comfortaa-%{version}
# Fixing
# wrong-file-end-of-line-encoding issue
# Thanks to Paul Flo Williams
for file in *.txt; do
sed 's/\r//g' "$file" | \
fold -s > "$file.new" && \
touch -r "$file" "$file.new" && \
mv "$file.new" "$file"
done
chmod 644 AUTHORS.txt CONTRIBUTORS.txt
%linuxtext FONTLOG.txt OFL.txt
%build
%fontbuild
%install
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p fonts/OTF/*.otf %{buildroot}%{_fontdir}
install -m 0644 -p fonts/TTF/*.ttf %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
%{buildroot}%{_fontconfig_confdir}
install -m 0644 -p %{SOURCE1} \
%{buildroot}%{_fontconfig_templatedir}/%{fontconf}
%fontinstall
ln -s %{_fontconfig_templatedir}/%{fontconf} \
%{buildroot}%{_fontconfig_confdir}/%{fontconf}
# Add AppStream metadata
install -Dm 0644 -p %{SOURCE2} \
%{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml
%check
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{fontname}.metainfo.xml
%fontcheck
%_font_pkg -f %{fontconf} *.{otf,ttf}
%doc FONTLOG.txt OFL.txt
%{_datadir}/appdata/%{fontname}.metainfo.xml
%fontfiles
%changelog
* Wed Nov 10 2021 Parag Nemade <pnemade@fedoraproject.org> - 3.101-3
- Convert this package to new fonts packaging guidelines
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.101-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Parag Nemade <pnemade AT redhat DOT com> -->
<component type="font">
<id>aajohan-comfortaa</id>
<metadata_license>CC-BY-3.0</metadata_license>
<name>Comfortaa</name>
<summary>Modern style true type font</summary>
<description>
<p>
Comfortaa is a sans-serif font comfortable in every aspect with
Bold, Regular, and Thin variants.
It has very good European language coverage and decent Cyrillic coverage.
</p>
</description>
<updatecontact>pnemade_at_redhat_dot_com</updatecontact>
<url type="homepage">http://aajohan.deviantart.com</url>
</component>