File rust-czkawka.spec of Package rust-czkawka

#
# spec file for package rust-czkawka
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2020 sp1rit
#
# 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/
#


%global uuid com.github.qarmin.czkawka
%global pkgname czkawka
%global guiapp gui
%global cliapp cli
Name:           rust-%{pkgname}
Version:        8.0.0
Release:        0
Summary:        Multi functional app to find duplicates, empty folders, similar images
License:        MIT
URL:            https://github.com/qarmin/czkawka
Source:         %{pkgname}-%{version}.tar
Source1:        vendor.tar.zst
BuildRequires:  c++_compiler
BuildRequires:  cargo-packaging
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  rust >= 1.79.0
BuildRequires:  pkgconfig(dav1d)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gtk4) >= 4.6
BuildRequires:  pkgconfig(libavif)
BuildRequires:  pkgconfig(libheif)
BuildRequires:  pkgconfig(libraw)
ExclusiveArch:  %{rust_arches}

%description
Czkawka is a simple, fast and free app to remove unnecessary files from your computer.

%package     -n %{pkgname}-%{cliapp}
Summary:        CLI frontend of Czkawka

%description -n %{pkgname}-%{cliapp}
CLI frontent of Czkawka

%files -n %{pkgname}-%{cliapp}
%license czkawka_cli/LICENSE
%{_bindir}/%{pkgname}_%{cliapp}
%{_bindir}/%{pkgname}

%package     -n %{pkgname}-%{guiapp}
Summary:        GTK frontend of Czkawka
Provides:       %{pkgname}

%description -n %{pkgname}-%{guiapp}
GTK frontent of Czkawka

%files -n %{pkgname}-%{guiapp}
%license czkawka_gui/LICENSE
%{_bindir}/%{pkgname}_%{guiapp}
%{_datadir}/icons/hicolor/scalable/apps/%{uuid}.svg
%{_datadir}/applications/%{uuid}.desktop

%package     -n %{pkgname}-doc
Summary:        Documentation of Czkawka
BuildArch:      noarch

%description -n %{pkgname}-doc
Documentation of Czkawka

%files -n %{pkgname}-doc
%license czkawka_core/LICENSE
%doc README.md
%doc instructions/Instruction.md
%doc Changelog.md

%prep
%setup -q -n %{pkgname}-%{version} -D -a1

%build
%define __cargo_common_opts %{?_smp_mflags} --bin czkawka_gui --bin czkawka_cli --features "heif,libraw,libavif"
%cargo_build

%install
mkdir -p %{buildroot}%{_bindir}
install -Dm755 target/release/%{pkgname}_%{cliapp} %{buildroot}%{_bindir}/%{pkgname}_%{cliapp}
install -Dm755 target/release/%{pkgname}_%{guiapp} %{buildroot}%{_bindir}/%{pkgname}_%{guiapp}
ln -s %{_bindir}/%{pkgname}_%{guiapp} %{buildroot}%{_bindir}/%{pkgname}
install -Dm644 data/icons/%{uuid}.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{uuid}.svg
install -Dm644 data/%{uuid}.desktop %{buildroot}%{_datadir}/applications/%{uuid}.desktop
%if 0%{?suse_version}
%endif

%if %{with check}
%check
%cargo_test
%endif

%changelog
openSUSE Build Service is sponsored by