# File: sourcefoundry-hack-fonts.spec

# Do the magic:
Source1000:                 vdb.lua
%include                    %{S:1000}

%Global Foundry             SourceFoundry
%Global Family              Hack
%global ver                 3.003
%global rel                 0.vdb.12

Version:                    %{ver}
Release:                    %{rel}%{?dist}
URL:                        https://%{foundry}.org/%{family}/

%global fontorg             org.%{foundry}
%global fontfamily          %{Family}
%global fontlicense         Bitstream-Vera AND MIT
%global fontsummary         A typeface designed for source code
%global fontdescription     %{text -- \
    No frills. No gimmicks. Hack is hand groomed and optically balanced to be a workhorse face for
    code.

    It has deep roots in the libre, open source typeface community and expands upon the
    contributions of the Bitstream Vera & DejaVu projects. The face has been re-designed with a
    larger glyph set, modifications of the original glyph shapes (including distinct point styles
    and semi-bold punctuation weight in the regular set to make non-alphabetic characters less
    transparent), and meticulous attention to metrics (including numerous spacing adjustments to
    improve the rhythm of the face and the legibility of code at small text sizes). The large
    x-height + wide aperture + low contrast design combined with PostScript hinting/hint
    replacement programs and a TrueType instruction set make it highly legible at commonly used
    source code text sizes with a sweet spot that runs in the 8px—12px range on modern desktop and
    laptop monitors. Combine it with an HD monitor and you can comfortably work at 6 or 7px sizes.
}
%global fonts               build/ttf/*.ttf
%global fontconfs           65-%{family}.conf
%global fontlicenses        LICENSE.md
%global fontdocs            CHANGELOG.md README.md
%global fontdocsex          %{fontlicenses}
%global fontcontact         van.de.bugger@gmail.com
    %{rem: Inspite the macro name, it's packager contact, not font author contact. }

Source0:                    https://github.com/source-foundry/%{family}/archive/v%{ver}.tar.gz#/%{Family}-%{ver}.tar.gz
Source1:                    %{foundry}-%{family}-fonts.conf

BuildRequires:              coreutils
BuildRequires:              fonts-rpm-macros
BuildRequires:              fonts-srpm-macros
BuildRequires:              %{__m4}

Requires:                   filesystem
    # ${_datadir}/appdata
    # ${_datadir}/doc
Requires:                   fontpackages-filesystem
    # ${_datadir}/fonts

%fontpkg

%prep
%setup -q -n %{Family}-%{ver}
%{__cp} %{S:1} ./65-%{family}.conf
%linuxtext *.md

%build
%fontbuild

%check
%fontcheck
    # It actually checks nothing, see <https://bugzilla.redhat.com/show_bug.cgi?id=1884066>,
    # so let's disable it temporarily.

%install
%fontinstall

%fontfiles

%changelog
* Sat May 06 2023 Van de Bugger - 3.003-0.vdb.12
- Minor changed in spec.

* Tue May 02 2023 Van de Bugger - 3.003-0.vdb.11
- F38 rebuild.

* Wed Nov 23 2022 Van de Bugger - 3.003-0.vdb.10
- F37 rebuild.

* Thu May  5 2022 Van de Bugger - 3.003-0.vdb.9
- F36 rebuild.

* Thu May  5 2022 Van de Bugger - 3.003-0.vdb.8
- fontconfig conf file added.
- `Obsolete` tag dropped.
- Fedora fontbuild and fontcheck macros used.
- F35 rebuild.

* Thu May  6 2021 Van de Bugger - 3.003-0.vdb.7
- F34 rebuild.

* Tue Nov 03 2020 Van de Bugger - 3.003-0.vdb.6
- Fedora's `fonts-rpm-macros` used.
- Package renamed to `sourcefoundry-hack-fonts`.
- F33.

* Wed Nov 06 2019 Van de Bugger - 3.003-0.vdb.5
- metainfo.xml files are checked only if SPEC_AUTHOR_CHECK env var is set.
  It allows Mageia and OpenSuse builds.
- Application ID changed to make `appstreamcli validate` happy.
- URL uses https protocol.
- libappstream-glib is not required for build.
- Name of metainfo file changed to use app id, not just font name.
- Checks are run only if SPEC_AUTHOR_CHECK env var is set.
- _metainfodir macro used.

* Thu Oct 31 2019 Van de Bugger - 3.003-0.vdb.4
- vdb.lua updated.
- spec slightly fixed to work on epel.
- release number changed.

* Sun Mar 24 2019 Van de Bugger - 3.003-0.4.vdb
- vdb.lua updated, _install_D macro used.
- epel-7 build enabled.

* Sat Mar 23 2019 Van de Bugger - 3.003-0.3.vdb
- Rebuilt for F30.
- vdb.lua updated.
- NOTE: Release changed in non-backward-compatible way. Sorry.

* Wed Jan 16 2019 Van de Bugger - 3.003-2.vdb
- New vdb.lua used.

* Mon Aug 20 2018 Van de Bugger - 3.003-1.vdb
- Updated to v3.003.

* Mon Aug 20 2018 Van de Bugger - 3.002-1.vdb
- Updated to v3.002.

* Mon Aug 20 2018 Van de Bugger - 3.001-1.vdb
- Updated to v3.001.

* Mon Oct 30 2017 Van de Bugger - 3.000-1.vdb
- Updated to 3.000.
- vdb.lua used.

* Mon Nov 28 2016 Van de Bugger - 2.020-3.vdb
- F22 dropped, F25 added, ppc64le enabled.

* Thu Jun 30 2016 Van de Bugger - 2.020-2.vdb
- Building rpm does not use remote git repo any more.
- Few doc files added to the package.
- Minor changes in the spec.
- Dropped RHEL support.
- vdb tag added to release number.

* Mon Jun 27 2016 Van de Bugger - 2.020-1
- Updated to 2.020.

* Sat Jan 23 2016 Van de Bugger - 2.019-1
- Updated to 2.019.
- Fixed typo in description.
- Requirements added.

* Wed Jan 6 2016 Van de Bugger - 2.018-2
- Implemented check for metainfo.xml.
- --single-branch git option dropped to let the package build on RHEL 6.
- Second paragraph added to desctription.
- update_contact added to metainfo.xml.

* Wed Jan 6 2016 Van de Bugger - 2.018-1
- First release.