Blob Blame History Raw
Name:          diffoscope
Version:       258
Release:       %autorelease
Summary:       In-depth comparison of files, archives, and directories
License:       GPL-3.0-or-later


# The package is arched due to architecture-dependent BR’s and Recommends;
# however, there is no compiled code, so no debug package will be generated.
%global debug_package %{nil}

ExcludeArch:  %{ix86}

%global tools \
    acl \
    abootimg \
    black \
    e2fsprogs \
    cpio \
    llvm, llvm-devel \
    binutils \
    binwalk \
    diffutils \
    gzip \
    unzip \
    bzip2 \
    xz \
    tar \
    zip \
    p7zip \
    sng >= 1.1.0-2 \
    openssl \
    openssh \
    openssh-clients \
    radare2 \
    sqlite \
    genisoimage \
    squashfs-tools \
    /usr/bin/img2txt \
    /usr/bin/rpm2cpio \
    /usr/bin/msgunfmt \
    /usr/bin/ps2ascii \
    /usr/bin/qemu-img \
    /usr/bin/xxd \
    /usr/bin/ghc \
    /usr/bin/cd-iccdump \
    /usr/bin/oggDump \
    /usr/bin/Rscript \
    /usr/bin/fdtdump \
    /usr/bin/gifbuild \
    /usr/bin/dumppdf \
    /usr/bin/h5dump \
    gnupg \
    pgpdump \
    findutils \
    file \
    ImageMagick \
    poppler-utils \
    python3-argcomplete \
    python3-debian \
    python3-h5py \
    python3-magic \
    python3-pdfminer \
    python3-tlsh \
    python3-libarchive-c \
    python3-libguestfs \
    python3-rpm \
    gnumeric \
    odt2txt \

# missing:
# aapt
# apktool
# js-beautify
# /usr/bin/dumpxsb from xmlbeans-scripts, xmlbeans
# docx2txt
# dexdump

# Does not work with python3-PyPDF2-1.26.0
# python3-pypdf >= 3.0

%ifnarch ppc64 ppc64le
%global tools2 \
%ifarch x86_64 i686 armv7hl
%global tools3 \
%ifnarch s390x
%global tools4 \
%ifarch %{java_arches}
%global tools5 \

%global toolz %(echo "%tools %?tools2 %?tools3 %?tools4 %?tools5" | grep . | tr '\\n' ', ')

BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-docutils
# for tests
BuildRequires: python3-pytest
BuildRequires: %toolz
BuildRequires: help2man
BuildRequires: make
BuildRequires: git
%ifarch %{java_arches}
BuildRequires: java-devel

Recommends:    %toolz

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. The differences can
be shown in a text or HTML report.

diffoscope is developed as part of the "reproducible builds" Debian project and
was formerly known as "debbindiff".

%autosetup -p1 -Sgit
sed -i '1{\@/usr/bin/env@d}' diffoscope/

# We use the python3-file-magic module instead of the python3-magic module.
# They conflict, and python3-file-magic is required by rpmlint.
sed -i s/python-magic/file-magic/

make -C doc

echo %{buildroot}%{python3_sitelib}
install -Dm0644 -t %{buildroot}%{_mandir}/man1/ doc/diffoscope.1
install -Dm0644 -t %{buildroot}/usr/share/zsh/site-functions/ debian/zsh-completion/_diffoscope

  # s390x specific issue?

  # What exactly is the point of those tests?

  # Those fail on rawhide. Not reported upstream yet.

  # Those seem to depend on the 'file' implementation, ignore.

LC_CTYPE=C.utf8 \
PYTHONPATH=build/lib/ \
%python3 -m pytest tests/ -vv "${DESELECT[@]}"

%doc README.rst debian/changelog
%license COPYING
%doc %{_mandir}/man1/diffoscope.1*