## START: Set by rpmautospec
## (rpmautospec version 0.7.2)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 3;
    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         __cmake_in_source_build 0
%global         with_cppunit 1
%global	        gtest 1
%global         profiling 1

Name:           xournalpp
Version:        1.2.3
Release:        %autorelease
Summary:        Handwriting note-taking software with PDF annotation support
# Automatically converted from old format: GPLv2+ - review is highly recommended.
License:	GPL-2.0-or-later
URL:            https://github.com/%{name}/%{name}
Source:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires:  cmake >= 3.10
BuildRequires:  desktop-file-utils
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gettext
BuildRequires:  help2man
BuildRequires:  libappstream-glib
%if 0%{?with_cppunit}
BuildRequires:  pkgconfig(cppunit) >= 1.12-0
%endif
BuildRequires:  pkgconfig(glib-2.0) >= 2.32.0
%if 0%{?gtest}
BuildRequires:  pkgconfig(gtest)
%endif
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.19.9
BuildRequires:  pkgconfig(gtksourceview-4) >= 4.0.0
BuildRequires:  pkgconfig(librsvg-2.0)
%if 0%{?profiling}
BuildRequires:  pkgconfig(libprofiler) >= 2.5
BuildRequires:  pkgconfig(libtcmalloc) >= 2.5
%endif
BuildRequires:  pkgconfig(libxml-2.0) >= 2.0.0
BuildRequires:  pkgconfig(libzip) >= 1.0.1
BuildRequires:  pkgconfig(lua) >= 5.3
BuildRequires:  pkgconfig(poppler-glib) >= 0.41.0
BuildRequires:  pkgconfig(portaudiocpp) >= 12
BuildRequires:  pkgconfig(sndfile) >= 1.0.25
Recommends:     texlive-latex-bin
Requires:       hicolor-icon-theme
Requires:       %{name}-plugins = %{version}-%{release}
Requires:       %{name}-ui = %{version}-%{release}

%description
Xournal++ is a handwriting note-taking software with PDF annotation support.
Supports Pen input like Wacom Tablets

%package	plugins
Summary:        Default plugin for %{name}
BuildArch:      noarch

%description	plugins
The %{name}-plugins package contains sample plugins for  %{name}.

%package	ui
Summary:        User interface for %{name}
BuildArch:      noarch

%description	ui
The %{name}-ui package contains a graphical user interface for  %{name}.


%prep
%autosetup -p1

%build
%cmake \
        -DDISTRO_CODENAME="Fedora Linux" \
        -DENABLE_GTEST=%{gtest} \
        -DENABLE_PROFILING=%{profiling}

%cmake_build

%install
%cmake_install

%find_lang %{name}

# REMOVE UNNECESSARY SCRIPTS
find %{buildroot}%{_datadir}/%{name} -name update-icon-cache.sh -delete -print
%fdupes %{buildroot}%{_datadir}

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/com.github.%{name}.%{name}.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/com.github.%{name}.%{name}.appdata.xml

%files -f %{name}.lang
%license LICENSE
%doc README.md AUTHORS
%{_bindir}/%{name}-thumbnailer
%{_bindir}/%{name}
%{_datadir}/applications/com.github.%{name}.%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/com.github.%{name}.%{name}.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/*
%{_datadir}/mime/packages/com.github.%{name}.%{name}.xml
%{_datadir}/thumbnailers/com.github.%{name}.%{name}.thumbnailer
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/resources/*_template.tex
%{_mandir}/man1/%{name}*.gz
%{_metainfodir}/com.github.%{name}.%{name}.appdata.xml

%files plugins
%{_datadir}/%{name}/plugins

%files ui
%{_datadir}/%{name}/ui

%changelog
## START: Generated by rpmautospec
* Fri Jul 26 2024 Miroslav Suchý <msuchy@redhat.com> - 1.2.3-3
- convert GPLv2+ license to SPDX

* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sun Mar 03 2024 Luya Tshimbalanga <luya@fedoraproject.org> - 1.2.3-1
- Update to 1.2.3 (#2267430) ... - Clean up spec file

* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Sat Oct 14 2023 Luya Tshimbalanga <luya@fedoraproject.org> - 1.2.2-1
- Update to 1.2.2 (rhbz#2244196)

* Sun Aug 27 2023 Luya Tshimbalanga <luya@fedoraproject.org> - 1.2.1-1
- Update to 1.2.1 (rhbz#2234873)

* Sun Jul 30 2023 Luya Tshimbalanga <luya@fedoraproject.org> - 1.2.0-1
- Update to 1.2.0

* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Sun Jan 22 2023 Orion Poplawski <orion@nwra.com> - 1.1.3-4
- Add patch for missing include with gcc 13

* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Mon Jan 16 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 1.1.3-2
- Remove obsolete desktop file modification

* Mon Nov 28 2022 Luya Tshimbalanga <luya@fedoraproject.org> - 1.1.3-1
- Update to 1.1.3

* Sun Oct 30 2022 Luya Tshimbalanga <luya@fedoraproject.org> - 1.1.2-1
- Update to 1.1.2 (#2136012)

* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Mar 16 2022 Luya Tshimbalanga <luya@fedoraproject.org> - 1.1.1-1
- Update to 1.1.1 (#1983495)

* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Mon Jul 19 2021 Luya Tshimbalanga <luya@fedoraproject.org> - 1.1.0-1
- Update to 1.1.0 (#1983495)

* Sun Feb 28 2021 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-7
- Enable math tex support Add fdupes for build requirement Simplify summary

* Sun Feb 28 2021 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-6
- Enable math tex support Add fdupes for build requirement Simplify summary

* Sun Feb 28 2021 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-5
- Enable math tex support Add fduples for build requirement Simplify
  summary

* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.20-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Sat Dec 19 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-3
- Update to 1.0.20 (#1908932) Work around firefox carrying bogus Provides

* Fri Dec 18 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-2
- Update to 1.0.20 (#1908932)

* Fri Dec 18 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.20-1
- Update to 1.0.20 (#1908932)

* Sat Oct 24 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.19-2
- Replace old xournal thumbnail with xournalpp version

* Fri Oct 23 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.19-1
- Update to 1.0.19 (#1890463)

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.18-5
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.18-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Sun Jul 05 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.0.18-3
- Improve compatibility with new CMake macro

* Wed Apr 22 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.18-2
- Set value key on desktop file associated with application (#1826395)

* Sun Apr 19 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.18-1
- Update to 1.0.18 (#1824351)

* Sat Apr 11 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.17-3
- Update to 1.0.17 (#1798239) Drop unneeded texlive dependencies Fix build
  with translations parameter

* Sat Apr 11 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.17-2
- Update to 1.0.17 (#1798239) Drop unneeded texlive dependencies Fix build
  with translations parameter

* Tue Feb 04 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.17-1
- Update to 1.0.17 Drop unneeded texlive dependencies Fix build with
  translations parameter

* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.16-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Jan 17 2020 Marek Kasik <mkasik@redhat.com> - 1.0.16-6
- Rebuild for poppler-0.84.0

* Sun Jan 12 2020 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.16-5
- Remove depreciate key in desktop file

* Tue Dec 17 2019 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.16-4
- Remove architecture requirement for plugins and ui

* Tue Dec 17 2019 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.16-3
- Fix typos

* Tue Dec 17 2019 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.16-2
- Fix architecture requirement for ui

* Mon Dec 16 2019 Luya Tshimbalanga <luya@fedoraproject.org> - 1.0.16-1
- Review fixes
## END: Generated by rpmautospec