File qtaskwarrior.spec of Package qtaskwarrior
#
# spec file for package qtaskwarrior
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: qtaskwarrior
Version: 0
Release: 0%{?dist}
Summary: Qt interface for taskwarrior
License: SUSE-Public-Domain
Group: Productivity/Office/Organizers
Url: https://qtaskwarrior.sourceforge.io/
Source: %{name}-%{version}.tar.xz
Patch: fix_plasmoid_desktop_file.patch
BuildRequires: cmake >= 3.5
BuildRequires: cmake(KF6CoreAddons)
BuildRequires: cmake(Plasma)
BuildRequires: cmake(KF6XmlGui)
BuildRequires: cmake(KF6WidgetsAddons)
BuildRequires: cmake(Qt6Core)
BuildRequires: cmake(Qt6Gui)
BuildRequires: cmake(Qt6LinguistTools)
BuildRequires: cmake(Qt6Widgets)
BuildRequires: cmake(Qt6Qml)
BuildRequires: extra-cmake-modules
BuildRequires: desktop-file-utils
BuildRequires: fdupes
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%else
BuildRequires: kf6-rpm-macros
%endif
Requires: taskwarrior > 2.0
Recommends: %{name}-lang = %{version}
Recommends: %{name}-plasma = %{version}
%description
Graphical interface for the taskwarrior program using the Qt framework.
%define app_id io.sourceforge.%{name}
%define plasmoid_id %{app_id}.plasmoid
%{!?_kf6_sharedir: %define _kf6_sharedir %{_datadir}}
%{!?_kf6_iconsdir: %define _kf6_iconsdir %{_kf6_sharedir}/icons}
%{!?_kf6_appstreamdir: %define _kf6_appstreamdir %{_kf6_sharedir}/metainfo}
%{!?_kf6_plasmadir: %define _kf6_plasmadir %{_kf6_sharedir}/plasma}
%{!?_kf6_servicesdir: %define _kf6_servicesdir %{_kf6_sharedir}/kservices6}
%if 0%{?suse_version}
%lang_package
%else
%package lang
Summary: Translation data for %{name}
Requires: %{name} = %{version}-%{release}
Supplements: %{name} = %{version}-%{release}
%description lang
Translation data for %{name}
%endif
%package -n lib%{name}
Summary: %{name} library
%description -n lib%{name}
Library for %{name}
%package imports
Summary: QML imports for %{name}
%description imports
This package provides a QML module that exposes some of the %{name} classes
as QML value types.
%package plasma
Summary: Plasma componentes for qtaskwarrior
Requires: plasma6-framework-components
BuildArch: noarch
%description plasma
Plasmoid for qtaskwarrior
%prep
%autosetup -p1
%build
%cmake_kf6 \
-DQTASKWARRIOR_VERSION=%{version} \
-DQTASKWARRIOR_PLASMOID=ON
%kf6_build
%install
%kf6_install
%find_lang %name --with-qt --all-name --without-mo %{?suse_version: --without-kde }
%if 0%{?suse_version}
%suse_update_desktop_file %{app_id}
%else
desktop-file-install %{buildroot}/%{_datadir}/applications/%{app_id}.desktop
%endif
%fdupes %{buildroot}/%{_datadir}
%files
%{_bindir}/%{name}
%license LICENSES
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/translations/
%{_datadir}/applications/%{app_id}.desktop
%{_kf6_iconsdir}/hicolor/
%{_kf6_appstreamdir}/%{app_id}.appdata.xml
%files lang -f %{name}.lang
%defattr(-,root,root)
%dir %{_datadir}/%{name}/translations
%files -n lib%{name}
%{_libdir}/lib%{name}.so
%files imports
%dir %{_kf6_qmldir}/io
%dir %{_kf6_qmldir}/io/sourceforge
%dir %{_kf6_qmldir}/io/sourceforge/qtaskwarrior
%{_kf6_qmldir}/io/sourceforge/qtaskwarrior
%files plasma
%dir %{_kf6_plasmadir}/plasmoids
%dir %{_kf6_plasmadir}/plasmoids/%{plasmoid_id}
%{_kf6_plasmadir}/plasmoids/%{plasmoid_id}
%{_kf6_appstreamdir}/%{plasmoid_id}.appdata.xml
%changelog