File pencil2d.spec of Package pencil2d

#
# spec file for package pencil2d
#
# Copyright (c) 2026 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define  _name  org.pencil2d.Pencil2D
Name:           pencil2d
Version:        0.7.1
Release:        0
Summary:        Tool to make 2D hand-drawn animations
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Vector Editors
URL:            https://github.com/pencil2d/pencil
Source0:        %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         001-desktop.patch
BuildRequires:  appstream-glib
BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gcc-c++
BuildRequires:  help2man
BuildRequires:  hicolor-icon-theme
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Gui)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6Multimedia)
BuildRequires:  cmake(Qt6Network)
BuildRequires:  cmake(Qt6Svg)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  cmake(Qt6Xml)
Requires:       %{_bindir}/ffmpeg
%requires_eq    libQt6Svg6

%description
Pencil2D is a free and open source animation/drawing software for Windows,
macOS, Linux, and FreeBSD. It lets you create traditional hand-drawn
animation (cartoon) using both bitmap and vector graphics.

%package        bash-completion
Summary:        Bash completion for %{name}
Group:          System/Shells
Requires:       bash-completion
Supplements:    (%{name} and bash)
BuildArch:      noarch

%description    bash-completion
Bash command line completion support for %{name}.

%package        zsh-completion
Summary:        Zsh Completion for %{name}
Group:          System/Shells
Requires:       zsh
Supplements:    (%{name} and zsh)
BuildArch:      noarch

%description    zsh-completion
ZSH command line completion support for %{name}.

%prep
%autosetup -p1 -n pencil-%{version}

%build
%qmake6 \
    PREFIX=%{_prefix} \
    VERSION=%{version}
%qmake6_build

%install
%qmake6_install
install -dm 0755 %{buildroot}%{_mandir}/man1
help2man --no-info --output=%{buildroot}%{_mandir}/man1/%{name}.1 \
    --name="is an easy, intuitive tool to make 2D hand-drawn animations." \
    --locale=C.UTF-8 "QT_QPA_PLATFORM=offscreen %{buildroot}%{_bindir}/%{name}"
desktop-file-edit --set-key=Categories --set-value="Qt;Graphics;2DGraphics;RasterGraphics;" \
    %{buildroot}%{_datadir}/applications/%{_name}.desktop

%check
export QT_QPA_PLATFORM=offscreen
./tests/tests
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{_name}.metainfo.xml
desktop-file-validate %{buildroot}%{_datadir}/applications/%{_name}.desktop

%files
%doc ChangeLog.md README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{_name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{_name}.??g
%{_datadir}/metainfo/%{_name}.metainfo.xml
%{_datadir}/mime/packages/%{_name}.xml
%{_mandir}/man?/%{name}.?%{?ext_man}
%license LICENSE.TXT

%files bash-completion
%dir %{_datadir}/bash-completion/
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}

%files zsh-completion
%dir %{_datadir}/zsh/
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}

%changelog
openSUSE Build Service is sponsored by