File rust-czkawka.spec of Package rust-czkawka
#
# spec file for package rust-czkawka
#
# Copyright (c) 2021 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: 3.2.0
Release: 0%{?dist}
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.xz
BuildRequires: hicolor-icon-theme
BuildRequires: pkgconfig
BuildRequires: rust >= 1.51
BuildRequires: rust-packaging
BuildRequires: pkgconfig(gdk-3.0) >= 3.22
BuildRequires: pkgconfig(glib-2.0)
ExclusiveArch: %{rust_arches}
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: glibc-all-langpacks
%endif
%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 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 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 LICENSE
%doc README.md
%doc instructions/Instruction.md
%doc Changelog.md
%prep
%setup -q -n %{pkgname}-%{version} -D -a1
%define cargo_registry $(pwd)/vendor
%{cargo_prep}
%build
export CARGO_NET_OFFLINE=true
%{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 pkgs/%{uuid}.desktop %{buildroot}%{_datadir}/applications/%{uuid}.desktop
%if 0%{?suse_version}
%suse_update_desktop_file %{uuid}
%endif
%if %{with check}
%check
%cargo_test
%endif
%changelog