File fira-fonts.spec of Package fira-fonts

%define realname fira
%define sansver  4.202
%define monover  3.206
%define srcext   tar.bz2

# Common info
Name:          fira-fonts
Version:       %{sansver}
Release:       %{?extraver:0.}1%{?dist}
License:       OFL-1.1
Group:         System/X11/Fonts
URL:           http://mozilla.github.io/Fira/
Summary:       Mozilla's Fira Type Family

# Build-time parameters
BuildArch:     noarch
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{sansver}.%{srcext}

%description
Mozilla's new typeface, used in Firefox OS

%package -n fira-sans-ttf-fonts
Version:       %{sansver}
Group:         System/X11/Fonts
Summary:       Mozilla's Fira Sans Type Family (TTF format)

%description -n fira-sans-ttf-fonts
Mozilla's new typeface, used in Firefox OS

This package contains Fira Sans Type Family in TTF format.

%package -n fira-sans-otf-fonts
Version:       %{sansver}
Group:         System/X11/Fonts
Summary:       Mozilla's Fira Sans Type Family (OTF format)

%description -n fira-sans-otf-fonts
Mozilla's new typeface, used in Firefox OS

This package contains Fira Sans Type Family in OTF format.

%package -n fira-mono-ttf-fonts
Version:       %{monover}
Group:         System/X11/Fonts
Summary:       Mozilla's Fira Mono Type Family (TTF format)

%description -n fira-mono-ttf-fonts
Mozilla's new typeface, used in Firefox OS

This package contains Fira Mono Type Family in TTF format.

%package -n fira-mono-otf-fonts
Version:       %{sansver}
Group:         System/X11/Fonts
Summary:       Mozilla's Fira Mono Type Family (OTF format)

%description -n fira-mono-otf-fonts
Mozilla's new typeface, used in Firefox OS

This package contains Fira Mono Type Family in OTF format.

# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{sansver}

%build

%install
%{__install} -d -m755           %{buildroot}%{_datadir}/fonts/truetype/
%{__install}    -m644 ttf/*.ttf %{buildroot}%{_datadir}/fonts/truetype/
%{__install}    -m644 otf/*.otf %{buildroot}%{_datadir}/fonts/truetype/

%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%files -n fira-sans-ttf-fonts
%defattr(-,root,root)
%doc LICENSE README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/FiraSans-*.ttf

%files -n fira-sans-otf-fonts
%defattr(-,root,root)
%doc LICENSE README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/FiraSans-*.otf
%{_datadir}/fonts/truetype/FiraSansCondensed-*.otf

%files -n fira-mono-ttf-fonts
%defattr(-,root,root)
%doc LICENSE README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/FiraMono-*.ttf

%files -n fira-mono-otf-fonts
%defattr(-,root,root)
%doc LICENSE README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/FiraMono-*.otf

%post -n fira-sans-ttf-fonts
if [ -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%postun -n fira-sans-ttf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%post -n fira-sans-otf-fonts
if [ -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%postun -n fira-sans-otf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%post -n fira-mono-ttf-fonts
if [ -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%postun -n fira-mono-ttf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%post -n fira-mono-otf-fonts
if [ -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%postun -n fira-mono-otf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
    /usr/bin/fc-cache || :
fi

%changelog