## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# SPDX-License-Identifier: LGPL-3.0-or-later

Version: 15.0.0
Release: %autorelease
URL: https://openmoji.org/

# OpenMoji graphics are licensed under the Creative Commons Share Alike License 4.0
# Code licensed under the GNU Lesser General Public License v3
License: CC-BY-SA-4.0 AND LGPL-3.0-only

%global fontfamilybase    OpenMoji
%global fontfamilybaselc  openmoji
%global fontsummarybase   Emojis with a line-drawn style
%global foundry           hfg-gmuend
%global fontlicenses      LICENSE.txt
%global fontdocs          *.md
%global fontdocsex        %{fontlicenses}

%global common_description %{expand:
A project of students and professors of the HfG Schwäbisch Gmünd.

OpenMoji uses visual guidelines that are not linked to a specific
branding.  The emojis are designed to integrate well in combination with
text.
}

# Extra "black" to work around https://pagure.io/fonts-rpm-macros/issue/10
%global fontfamily1       %{fontfamilybase} Black
%global fontpkgname1      %{foundry}-%{fontfamilybaselc}-black-fonts
%global fontsummary1      %{fontsummarybase} (black and white)
%global fonts1            font/%{fontfamilybase}-black-glyf/%{fontfamilybase}-black-glyf.ttf
%global fontconfs1        %{SOURCE11}
%global fontappstreams1   %{SOURCE21}
%global fontdescription1  %{expand: %{common_description}
This package provides a black and white font.}

%global fontfamily2       %{fontfamilybase} Color
%global fontsummary2      %{fontsummarybase} (color, scalable)
%global fonts2            font/%{fontfamilybase}-color-glyf_colr_1/%{fontfamilybase}-color-glyf_colr_1.ttf
%global fontconfs2        %{SOURCE12}
%global fontappstreams2   %{SOURCE22}
%global fontdescription2  %{expand: %{common_description}
This package provides a color font in the scalable COLRv1 format.}

Source0:  https://github.com/%{foundry}/%{fontfamilybaselc}/archive/%{version}.tar.gz#/%{fontfamilybaselc}-%{version}.tar.gz
Source11: 66-%{fontpkgname1}.conf
Source12: 66-%{fontpkgname2}.conf
Source21: org.openmoji.black.metainfo.xml
Source22: org.openmoji.color.metainfo.xml

Name:     %{foundry}-%{fontfamilybaselc}-fonts
Summary:  %{fontsummarybase}
BuildArch: noarch
BuildRequires: fontpackages-devel
BuildRequires: libappstream-glib

%description
%wordwrap -v common_description


%fontpkg -a
%fontmetapkg


%prep
%autosetup -n %{fontfamilybaselc}-%{version}


%build
# FIXME: Build the TTFs ourselves rather than relying on the ones in the
# source package.  To do that, first we need to package nanoemoji and
# its dependencies.  https://release-monitoring.org/project/96050/

%fontbuild -a


%install
%fontinstall -a


%check
%fontcheck -a


%fontfiles -a


%changelog
* Sun Dec 24 2023 Peter Oliver <git@mavit.org.uk> - 15.0.0-1
- Update to version 15.0.0

* Mon Apr 24 2023 Peter Oliver <git@mavit.org.uk> - 14.0.0-4
- SPDX migration.

* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 14.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 14.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Sun Jul 17 2022 Peter Oliver <git@mavit.org.uk> - 14.0.0-1
- Update to version 14.0.0.

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 13.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 13.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jun 29 2021 Peter Oliver <rpm@mavit.org.uk> - 13.1.0-1
- Update to version 13.1.

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 13.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Nov 13 2020 Peter Oliver <rpm@mavit.org.uk> - 13.0.0-1
- Update to version 13.0.0.

* Wed Jul 29 2020 Peter Oliver <rpm@mavit.org.uk> - 12.4.0-1
- Update to version 12.4.0.

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 12.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jun 26 2020 Peter Oliver <rpm@mavit.org.uk> - 12.3.0-1
- Initial release.