File sourcesanspro-fonts.spec of Package sourcesanspro-fonts
%define realname source-sans-pro
%define srcext tar.bz2
# Common info
Name: sourcesanspro-fonts
Version: 0
Release: %{?extraver:0.}1%{?rhel:.el%{rhel}}%{?fedora:.fc%{fedora}}
License: OFL-1.1
Group: System/X11/Fonts
URL: https://github.com/adobe/source-sans-pro/
Summary: Source Sans Pro fonts by Adobe
# Build-time parameters
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-root
Source: %{realname}-%{version}.%{srcext}
%description
Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments.
%package -n sourcesanspro-ttf-fonts
Group: System/X11/Fonts
Summary: Source Sans Pro fonts by Adobe (TTF format)
Conflicts: adobe-sourcesanspro-fonts
%description -n sourcesanspro-ttf-fonts
Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments.
This package contains font in TTF format.
%package -n sourcesanspro-otf-fonts
Group: System/X11/Fonts
Summary: Source Sans Pro fonts by Adobe (OTF format)
Conflicts: adobe-sourcesanspro-fonts
%description -n sourcesanspro-otf-fonts
Source Sans Pro is a set of OpenType fonts that have been designed to work well
in user interface (UI) environments.
This package contains font in OTF format.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}
%build
%{__chmod} a-x LICENSE.txt README.md
%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 sourcesanspro-ttf-fonts
%defattr(-,root,root)
%doc LICENSE.txt README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/*.ttf
%files -n sourcesanspro-otf-fonts
%defattr(-,root,root)
%doc LICENSE.txt README.md
%dir %{_datadir}/fonts/truetype/
%{_datadir}/fonts/truetype/*.otf
%post -n sourcesanspro-ttf-fonts
if [ -x /usr/bin/fc-cache ]
then
/usr/bin/fc-cache || :
fi
%postun -n sourcesanspro-ttf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
/usr/bin/fc-cache || :
fi
%post -n sourcesanspro-otf-fonts
if [ -x /usr/bin/fc-cache ]
then
/usr/bin/fc-cache || :
fi
%postun -n sourcesanspro-otf-fonts
if [ $1 -eq 0 -a -x /usr/bin/fc-cache ]
then
/usr/bin/fc-cache || :
fi
%changelog