LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File fira-code.spec of Package fira-code (Project home:aevseev)

%define realname fira-code
%define srcext   tar.bz2

# Common info
Name:          %{realname}
Version:       0
Release:       %{?extraver:0.}1%{?dist}
License:       OFL-1.1
Group:         System/X11/Fonts
URL:           https://github.com/tonsky/FiraCode
Summary:       Monospaced font with programming ligatures

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

%description
Fira Code is an extension of the Fira Mono font containing a set of ligatures
for common programming multi-character combinations. This is just a font
rendering feature: underlying code remains ASCII-compatible. This helps to read
and understand code faster. For some frequent sequences like .. or //, ligatures
allow us to correct spacing.

%package -n fira-code-ttf-font
Group:         System/X11/Fonts
Summary:       Monospaced font with programming ligatures (TTF format)

%description -n fira-code-ttf-font
Fira Code is an extension of the Fira Mono font containing a set of ligatures
for common programming multi-character combinations. This is just a font
rendering feature: underlying code remains ASCII-compatible. This helps to read
and understand code faster. For some frequent sequences like .. or //, ligatures
allow us to correct spacing.

This package contains Fira Code font in TTF format.

%package -n fira-code-otf-font
Group:         System/X11/Fonts
Summary:       Monospaced font with programming ligatures (OTF format)

%description -n fira-code-otf-font
Fira Code is an extension of the Fira Mono font containing a set of ligatures
for common programming multi-character combinations. This is just a font
rendering feature: underlying code remains ASCII-compatible. This helps to read
and understand code faster. For some frequent sequences like .. or //, ligatures
allow us to correct spacing.

This package contains Fira Code font in OTF format.

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

%build

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

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

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

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

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

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

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

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

%changelog