%global fontname julietaula-montserrat
%global fontconf 61-%{fontname}.conf

Name:            julietaula-montserrat-fonts
Version:         7.200
Release:         5
Epoch:           1
Summary:         Sans-serif typeface

License:         OFL
URL:             https://github.com/JulietaUla/Montserrat
Source0:         https://github.com/JulietaUla/Montserrat/archive/v%{version}.tar.gz#/Montserrat-%{version}.tar.gz
Source1:         %{name}-fontconfig.conf

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

Obsoletes:       %{name} < 1:%{version}-%{release}

%description
The Montserrat font project develops a typeface created by Julieta Ulanovsky who 
is inspired by the old posters and signs in the traditional neighborhood of Buenos 
Aires called Montserrat.

%package_help

%prep
%autosetup -c -n %{name}-%{version}

%build

%install
pushd %{buildroot}
install -Dpm 0644 %_builddir/%{name}-%{version}/Montserrat-%{version}/fonts/ttf/*.ttf -t\
     .%{_fontdir}
install -Dpm 0644 %_builddir/%{name}-%{version}/Montserrat-%{version}/fonts/otf/*.otf -t\
     .%{_fontdir}

install -m 0755 -d .%{_fontconfig_templatedir} .%{_fontconfig_confdir}
install -m 0644 -p %{SOURCE1} .%{_fontconfig_templatedir}/%{fontconf}
ln -s %{_fontconfig_templatedir}/%{fontconf} .%{_fontconfig_confdir}/%{fontconf}
popd

%files
%defattr(-,root,root)
%doc Montserrat-%{version}/AUTHOR.txt Montserrat-%{version}/CONTRIBUTORS.txt
%license Montserrat-%{version}/OFL.txt
%{_sysconfdir}/fonts/conf.d/%{fontconf}
%{_datadir}/fontconfig/conf.avail/%{fontconf}
%{_datadir}/fonts/%{fontname}/*.ttf
%{_datadir}/fonts/%{fontname}/*.otf

%files help
%defattr(-,root,root)
%doc Montserrat-%{version}/README.md

%changelog
* Mon Jan 20 2020 Jiangping Hu <hujp1985@foxmail.com> - 1:7.200-5
- Package init
