Blob Blame History Raw
%global fontname source-serif-pro
%global fontconf 63-%{fontname}.conf

%global version_roman  2.000
#global version_italic x.yyy

Name:           adobe-source-serif-pro-fonts
Version:        %{version_roman}
Release:        2%{?dist}
Summary:        A set of OpenType fonts designed to complement Source Sans Pro

License:        OFL
URL:            https://github.com/adobe-fonts/source-serif-pro
Source0:        https://github.com/adobe-fonts/source-serif-pro/archive/%{version_roman}R.tar.gz#/SourceSerifPro-%{version_roman}R.tar.gz
Source1:        %{name}-fontconfig.conf
Source2:        %{fontname}.metainfo.xml

BuildArch:      noarch
BuildRequires:  fontpackages-devel
BuildRequires:  libappstream-glib
Requires:       fontpackages-filesystem

%description
Source Serif Pro is a set of OpenType fonts to complement the Source Sans Pro
family.

%prep
%setup -q -n source-serif-pro-%{version_roman}R
sed -i 's/\r//' LICENSE.txt
chmod 644 LICENSE.txt

%build

%install
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0644 -p OTF/*.otf %{buildroot}%{_fontdir}

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

install -m 0644 -p %{SOURCE1} \
        %{buildroot}%{_fontconfig_templatedir}/%{fontconf}
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 --nonet validate-relax \
        %{buildroot}%{_datadir}/appdata/%{fontname}.metainfo.xml

%_font_pkg -f %{fontconf} *.otf
%{_datadir}/appdata/%{fontname}.metainfo.xml

%doc README.md
%license LICENSE.txt

%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.000-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sat Jan 21 2017 Michael Kuhn <suraia@ikkoku.de> - 2.000-1
- Update to 2.000

* Tue Aug 30 2016 Michael Kuhn <suraia@ikkoku.de> - 1.017-2
- Fix AppStream metadata
- Validate AppStream metadata during check

* Tue Jan 26 2016 Michael Kuhn <suraia@ikkoku.de> - 1.017-1
- Initial package.