2017-01-25 23:17:42 +01:00
#
# spec file for package diffoscope
#
2023-01-18 11:18:13 +01:00
# Copyright (c) 2023 SUSE LLC
2017-01-25 23:17:42 +01:00
#
# 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.
2018-11-26 10:22:02 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-01-25 23:17:42 +01:00
#
Name : diffoscope
2023-08-05 10:02:12 +02:00
Version : 242
2017-01-25 23:17:42 +01:00
Release : 0
Summary : In-depth comparison of files, archives, and directories
2018-11-26 10:22:02 +01:00
License : GPL-3.0-or-later
2017-01-25 23:17:42 +01:00
Group : Development/Languages/Python
2019-04-05 12:30:19 +02:00
URL : https://diffoscope.org/
2019-04-05 12:07:39 +02:00
Source0 : https://diffoscope.org/archive/diffoscope-%{version} .tar.bz2
Source1 : https://diffoscope.org/archive/diffoscope-%{version} .tar.bz2.asc
2019-04-05 12:30:19 +02:00
Source2 : diffoscope.keyring
2023-08-05 10:02:12 +02:00
# PATCH-FIX-UPSTREAM fix-file-5.45.patch -- fix compatibility with file version 5.45, see https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/346
Patch0 : https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/435a8fe9a201a7e74e705e06cc56b66fa6cb4af9.patch#/fix-file-5.45.patch
2019-04-05 12:30:19 +02:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2021-03-08 09:36:01 +01:00
BuildRequires : python3-base >= 3.7
BuildRequires : python3-curses
2017-01-25 23:17:42 +01:00
BuildRequires : python3-libarchive-c
BuildRequires : python3-pytest
BuildRequires : python3-python-magic
BuildRequires : python3-setuptools
2021-03-08 09:36:01 +01:00
Requires : python3-curses
2017-01-25 23:17:42 +01:00
Requires : python3-libarchive-c
Requires : python3-python-magic
Requires : python3-setuptools
2019-04-05 12:30:19 +02:00
Requires(post) : update-alternatives
2021-05-02 10:45:58 +02:00
Requires(postun) : update-alternatives
2017-01-25 23:17:42 +01:00
# Tools required for proper function of this program
2021-03-08 09:36:01 +01:00
# in extras_require
Recommends: python3-distro
Recommends: python3-argcomplete
Recommends: python3-defusedxml
Recommends: python3-jsondiff
2021-05-02 10:45:58 +02:00
Recommends: python3-progressbar
2017-01-25 23:17:42 +01:00
# for getfacl
Suggests : acl
# for ar, readelf, objcopy and objdump
Suggests : binutils
Suggests : bzip2
# for img2txt
Suggests : caca-utils
# for isoinfo
Suggests : cdrkit-cdrtools-compat
# for cbfstool
Suggests : coreboot-utils
# for stat
Suggests : coreutils
Suggests : cpio
# for cmp and diff
Suggests : diffutils
# for lsattr
Suggests : e2fsprogs
# for ppudump
Suggests : fpc
# for msgunfmt
Suggests : gettext-tools
# for ghc
Suggests : ghc-compiler
Suggests : gzip
# for pedump
Suggests : mono-devel
Suggests : pdftk
# for pdftotext
Suggests : poppler-tools
# for RPM unpacking
Suggests : python3-rpm
Suggests : sqlite3
# for unsquashfs
Suggests : squashfs
# for zipinfo
Suggests : unzip
# for xxd
Suggests : vim
Suggests : xz
# currently missing:
# enjarify, javap, lipo, otool, showttf, sng
BuildArch : noarch
%description
diffoscope will try to get to the bottom of what makes files or
directories different. It will recursively unpack archives of many kinds
and transform various binary formats into more human readable form to
compare them. It can compare two tarballs, ISO images, or PDF just as
easily.
It can be scripted through error codes, and a report can be produced
with the detected differences. The report can be text or HTML.
When no type of report has been selected, diffoscope defaults
to write a text report on the standard output.
diffoscope is developed as part of the `“reproducible builds” Debian
project <https://wiki.debian.org/ReproducibleBuilds>`_.
It is meant to be able to quickly understand why two builds of the same
package produce different outputs. diffoscope was previously named
debbindiff.
%prep
%setup -q
2023-08-05 10:02:12 +02:00
%patch0 -p1
2021-03-08 09:36:01 +01:00
sed -i '0,/#!\/usr\/bin\/env/ d' diffoscope/main.py
2017-01-25 23:17:42 +01:00
%build
2019-04-05 12:30:19 +02:00
%python3_build
2017-01-25 23:17:42 +01:00
%install
2019-04-05 12:30:19 +02:00
%python3_install
%fdupes %{buildroot} %{python3_sitelib} /
2017-01-25 23:17:42 +01:00
mv %{buildroot} %{_bindir} /diffoscope %{buildroot} %{_bindir} /diffoscope-%{py3_ver}
mkdir -p %{buildroot} %{_sysconfdir} /alternatives
ln -s -f %{_sysconfdir} /alternatives/diffoscope %{buildroot} %{_bindir} /diffoscope
touch %{buildroot} %{_sysconfdir} /alternatives/diffoscope
%post
2019-04-05 12:30:19 +02:00
%{_sbindir} /update-alternatives --install \
2017-01-25 23:17:42 +01:00
%{_bindir} /diffoscope diffoscope %{_bindir} /diffoscope-%{py3_ver} 10
%postun
if [ " $ 1 " = 0 ] ; then
2019-04-05 12:30:19 +02:00
%{_sbindir} /update-alternatives --remove diffoscope %{_bindir} /diffoscope-%{py3_ver}
2017-01-25 23:17:42 +01:00
fi
2019-04-05 12:30:19 +02:00
%check
2021-03-12 09:04:12 +01:00
# test_identification https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/98
2022-09-22 19:04:54 +02:00
# comparators/test_python/test_diff https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/284#note_280561
py.test-%{python3_bin_suffix} -k 'not ((test_python and test_diff) or test_identification)'
2017-01-25 23:17:42 +01:00
%files
2018-11-26 10:22:02 +01:00
%doc README.rst
2019-04-05 12:30:19 +02:00
%license COPYING
2017-01-25 23:17:42 +01:00
%{_bindir} /diffoscope
%{_bindir} /diffoscope-%{py3_ver}
2023-01-18 11:18:13 +01:00
%{python3_sitelib} /diffoscope
%{python3_sitelib} /diffoscope-%{version} *-info
2017-01-25 23:17:42 +01:00
%ghost %{_sysconfdir} /alternatives/diffoscope
%changelog