File dupeguru.spec of Package dupeguru
#
# spec file for package dupeguru
#
# Copyright (c) 2021 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/
#
Name: dupeguru
Version: 4.3.1
Release: 0
Summary: Duplicate Files Finder
License: GPL-3.0-only
Group: Productivity/File utilities
URL: https://dupeguru.voltaicideas.net/
Source0: https://github.com/arsenetar/dupeguru/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: ImageMagick
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: python311
#/ REQUIREMENTS BEGIN
BuildRequires: python311-Send2Trash >= 1.3.0
BuildRequires: python311-Sphinx >= 3.0.0
####BuildRequires: python311-Sphinx < 3.2.0
BuildRequires: libqt5-dxcbplugin
BuildRequires: python311-polib >= 1.1.0
BuildRequires: python311-mutagen >= 1.44.0
BuildRequires: python311-distro >= 1.5.0
BuildRequires: python311-qt5-devel >= 5.14.1
BuildRequires: python311-xxhash >= 3.0.0
#/ REQUIREMENTS END
#/ REQUIREMENTS EXTRA BEGIN
BuildRequires: python311-pytest
BuildRequires: python311-flake8
BuildRequires: python311-black
#/ REQUIREMENTS EXTRA END
#BuildRequires: python311-hsaudiotag3k
#BuildRequires: python311-pytest-monkeyplus
Requires: libqt5-dxcbplugin
Requires: python311-Send2Trash >= 1.3.0
#Requires: python311-hsaudiotag3k
#Requires: python311-jobprogress
Requires: python311-mutagen >= 1.44.0
Requires: python311-polib >= 1.1.0
Requires: python311-qt5 >= 5.14.1
Requires: python311-semantic_version >= 2.0.0
Requires: python311-xxhash >= 3.0.0
Requires: python311-xml
Provides: dupeguru-me = %{version}
Provides: dupeguru-pe = %{version}
Obsoletes: dupeguru-me < 4.0.3
Obsoletes: dupeguru-pe < 4.0.3
%description
dupeGuru is a tool to find duplicate files on your computer. It can scan
either filenames or contents. The filename scan features a fuzzy matching
algorithm that can find duplicate filenames even when they are not exactly
the same.
dupeGuru is good with music. It has a special Music mode that can scan tags
and shows music-specific information in the duplicate results window.
dupeGuru is good with pictures. It has a special Picture mode that can scan
pictures fuzzily, allowing you to find pictures that are similar, but not
exactly the same.
%prep
%setup -q
#%%setup -T -D -a 1
sed -i -e 's|PYTHON ?= python3|PYTHON ?= python3.11|g' Makefile
%build
export NO_VENV=true PREFIX=%{_prefix} PYTHON=python3.11
%make_build
%install
# Create a correct desktop file.
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=dupeGuru
GenericName=Duplicate Files Finder
GenericName[ru]=Поиск одинаковых файлов
Comment=Find duplicate files
Comment[ru]=Поиск одинаковых файлов
Type=Application
Exec=dupeguru
Icon=dupeguru
Categories=System;Utility;Filesystem;
Terminal=false
StartupNotify=true
EOF
# Main install.
install -dm 0755 %{buildroot}{%{_bindir}/,%{python311_sitearch}/%{name}/}
cp -R {core,hscommon,locale,qt} \
%{buildroot}%{python311_sitearch}/%{name}/
install -m0755 run.py %{buildroot}%{python311_sitearch}/%{name}/
# Create a link in bindir.
ln -s %{python311_sitearch}/%{name}/run.py %{buildroot}%{_bindir}/%{name}
# Remove unneeded.
rm -rf %{buildroot}%{python311_sitearch}/%{name}/qtlib/.tx/
rm -rf %{buildroot}%{python311_sitearch}/%{name}/qtlib/locale/
find %{buildroot}%{python311_sitearch}/%{name}/ -type f -name ".gitignore" -delete
find %{buildroot}%{python311_sitearch}/%{name}/ -type f -name "*.c" -delete
find %{buildroot}%{python311_sitearch}/%{name}/ -type f -name "*.h" -delete
find %{buildroot}%{python311_sitearch}/%{name}/ -type f -name "*.po" -delete
find %{buildroot}%{python311_sitearch}/%{name}/ -type f -name "*.pot" -delete
# Python byte compile.
pushd %{buildroot}%{python311_sitearch}/%{name}/
%py3_compile .
popd
# Install icons of various sizes.
install -Dm 644 images/dgse_logo_128.png \
%{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
for size in 96x96 64x64 48x48 32x32 22x22 16x16 ; do
install -dm 0755 \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps
convert -strip -resize ${size} images/dgse_logo_128.png \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
# Install a desktop file.
install -Dm 644 %{name}.desktop \
%{buildroot}%{_datadir}/applications/%{name}.desktop
# Find duplicate files.
%fdupes -s %{buildroot}
# Find locales.
%find_lang columns
%find_lang core
%find_lang ui
%if 0%{?suse_version} && 0%{?suse_version} < 1330
%post
%icon_theme_cache_post
%postun
%icon_theme_cache_postun
%endif
%files -f columns.lang -f core.lang -f ui.lang
%license LICENSE
%doc CREDITS README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*
%{python311_sitearch}/%{name}/
%changelog