## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 8;
    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

%global appname com.github.danrabbit.harvey

Name:           harvey
Summary:        The hero that Gotham needs right now
Version:        1.0.2
Release:        %autorelease
# The entire source is GPL-3.0-or-later:
#
#   The COPYING file is GPLv3, and while the phrase “or any later version” does
#   not appear, data/com.github.danrabbit.harvey.appdata.xml.in,
#   debian/copyright, and the SPDX headers of the Vala sources, src/*.vala,
#   indicate GPLv3+ is intended. For example, from the AppData file:
#
#     <project_license>GPL-3.0+</project_license>
#
# …except:
#   - data/Application.css is GPL-2.0-or-later
#   - data/com.github.danrabbit.harvey.appdata.xml.in is CC0-1.0, which is only
#   allowed for content
License:        GPL-3.0-or-later AND GPL-2.0-or-later AND CC0-1.0

URL:            https://github.com/danrabbit/%{name}
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch:    %{ix86}

BuildRequires:  desktop-file-utils
BuildRequires:  gettext

# Still required by guidelines for now
# (https://pagure.io/packaging-committee/issue/1053):
BuildRequires:  libappstream-glib
# Matches what gnome-software and others use:
BuildRequires:  appstream

BuildRequires:  meson
BuildRequires:  vala
BuildRequires:  gcc

BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(granite)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(libhandy-1)

Requires:       hicolor-icon-theme

Summary(fr):    Le héro dont Gotham a besoin dès à présent
Summary(es):    El héroe que Gotham estaba necesitando
Summary(en_AU): The hero that Gotham needs right now
Summary(en_CA): The hero that Gotham needs right now
Summary(en_GB): The hero that Gotham needs right now

%description
Calculate and visualize color contrast. Harvey checks a given set of colors for
WCAG contrast compliance.

%description -l fr
Calculez et visualisez les contrastes de couleur. Harvey vérifie qu’un jeu de
couleur est conforme aux recommandation de contraste WCAG.

%description -l es
Calcule y visualice el contraste de color, Harvey comprueba un conjunto
determinado de colores para el cumplimiento del contraste WCAG.

%description -l en_AU
Calculate and visualize colour contrast. Harvey checks a given set of colours
for WCAG contrast compliance.

%description -l en_CA
Calculate and visualize colour contrast. Harvey checks a given set of colours
for WCAG contrast compliance.

%description -l en_GB
Calculate and visualize colour contrast. Harvey checks a given set of colours
for WCAG contrast compliance.


%prep
%autosetup


%build
%meson
%meson_build


%install
%meson_install

%find_lang %{appname}


%check
desktop-file-validate \
    %{buildroot}/%{_datadir}/applications/%{appname}.desktop

# Still required by guidelines for now
# (https://pagure.io/packaging-committee/issue/1053):
appstream-util validate-relax --nonet \
    %{buildroot}/%{_metainfodir}/%{appname}.appdata.xml
# Matches what gnome-software and others use:
appstreamcli validate --nonet \
    %{buildroot}/%{_metainfodir}/%{appname}.appdata.xml


%files -f %{appname}.lang
%doc README.md
%license LICENSE

%{_bindir}/%{appname}

%{_datadir}/applications/%{appname}.desktop
%{_datadir}/glib-2.0/schemas/%{appname}.gschema.xml
%{_datadir}/icons/hicolor/*/apps/%{appname}.svg
%{_metainfodir}/%{appname}.appdata.xml


%changelog
* Tue Dec 20 2022 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-8
- Leaf package: remove i686 support

* Fri Aug 05 2022 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-7
- Update License to SPDX

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

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

* Thu Jan 13 2022 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-4
- Add BR on gcc

* Wed Jan 05 2022 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-3
- Also validate AppData with appstreamcli

* Fri Sep 24 2021 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-2
- Use %%%%{_metainfodir} macro in spec file

* Thu Jul 22 2021 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.2-1
- Update to 1.0.2 (closes RHBZ#1984911)

* Wed Jul 21 2021 Benjamin A. Beasley <code@musicinmybrain.net> 1.0.1-4
- Add GPLv3 license text from upstream development version

* Fri Jul 09 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.1-2
- Switch License field to “effective license” of GPLv3+

* Thu May 13 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.1-1
- Update to 1.0.1
- New dependency on libhandy

* Sat Mar 20 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.0-12
- Fix some small typos in the upstream localized descriptions

* Tue Mar 09 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.0-11
- Localize summary and description where translations are available upstream

* Fri Feb 19 2021 Fabio Valentini <decathorpe@gmail.com> - 1.0.0-10
- Rebuilt for granite 6 soname bump.

* Wed Feb 10 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.0-9
- Correct License from “GPLv3” to “GPLv3+ and GPLv2+ and CC0”

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

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

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Nov 08 2019 Fabio Valentini <decathorpe@gmail.com> - 1.0.0-5
- Drop superfluous dependency on appstream.

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sat Jul 07 2018 Fabio Valentini <decathorpe@gmail.com> - 1.0.0-1
- Update to version 1.0.0.

* Wed Jun 13 2018 Fabio Valentini <decathorpe@gmail.com> - 0.1.8-3
- Rebuild for granite5 soname bump.

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Jan 15 2018 Fabio Valentini <decathorpe@gmail.com> - 0.1.8-1
- Initial package.