Blob Blame History Raw
Name:          diffoscope
Version:       62
Release:       1%{?dist}
Summary:       In-depth comparison of files, archives, and directories
License:       GPLv3+
URL:           https://diffoscope.org/
Source0:       http://ftp.debian.org/debian/pool/main/d/diffoscope/diffoscope_%{version}.tar.xz

BuildArch:     noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-magic
BuildRequires: python3-libguestfs
BuildRequires: python3-libarchive-c
BuildRequires: python3-docutils
BuildRequires: /usr/bin/rst2man
# for tests
BuildRequires: python3-pytest
BuildRequires: cpio
BuildRequires: llvm, llvm-devel
BuildRequires: binutils
BuildRequires: unzip
BuildRequires: bzip2
BuildRequires: xz
BuildRequires: genisoimage
BuildRequires: squashfs-tools
BuildRequires: java-devel
BuildRequires: /usr/bin/rpm2cpio
BuildRequires: /usr/bin/msgunfmt
BuildRequires: /usr/bin/ps2ascii
BuildRequires: /usr/bin/qemu-img
BuildRequires: /usr/bin/sqlite3
BuildRequires: /usr/bin/xxd
BuildRequires: /usr/bin/ghc
BuildRequires: /usr/bin/cd-iccdump
%ifnarch ppc64 ppc64le
# We'll have to skip some tests if we happen to hit an ppc builder
BuildRequires: coreboot-utils
BuildRequires: mono-devel
%endif

Requires:      python3-magic
Requires:      python3-tlsh
Requires:      python3-libarchive-c

%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. 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".

%prep
%autosetup -n diffoscope
sed -i '1{\@/usr/bin/env@d}' diffoscope/main.py
sed -i '1s|/usr/bin/env.*|%{__python3} -s|' bin/trydiffoscope

%build
%py3_build
rst2man debian/diffoscope.1.rst > build/diffoscope.1
rst2man debian/trydiffoscope.1.rst > build/trydiffoscope.1

%install
%py3_install
install bin/trydiffoscope %buildroot%{_bindir}
echo %{buildroot}%{python3_sitelib}
rm %{buildroot}%{python3_sitelib}/*/requires.txt
install -Dm0644 -t %{buildroot}%{_mandir}/man1/ build/diffoscope.1
install -Dm0644 -t %{buildroot}%{_mandir}/man1/ build/trydiffoscope.1

%check
# disable some tests crudely
# (https://github.com/pytest-dev/pytest/issues/1442#issuecomment-194259675)
# http://bugs.debian.org/817193
sed -i s/test_listing/_disabled_/ tests/comparators/test_cbfs.py
sed -i s/test_diff/_disabled_/ tests/comparators/test_icc.py
sed -i s/test_identification/_disabled_/ tests/comparators/test_ppu.py
sed -i s/test_diff/_disabled_/ tests/comparators/test_ppu.py
sed -i s/test_compare_non_existing/_disabled_/ tests/comparators/test_ppu.py
%if 0%{?fedora} <= 23
sed -i s/test_differences/_disabled_/ tests/comparators/test_fsimage.py
%endif

export LC_CTYPE=en_US.utf8
export TZ=UTC
export PYTHONPATH=build/lib/
py.test-%{python3_version} tests/ -vv

%files
%doc README.rst
%license COPYING
%{python3_sitelib}/diffoscope*
%{_bindir}/diffoscope
%{_bindir}/trydiffoscope
%doc %{_mandir}/man1/diffoscope.1*
%doc %{_mandir}/man1/trydiffoscope.1*

%changelog
* Tue Nov 15 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 62-1
- Update to latest version

* Mon Aug 15 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 59-1
- Update to latest version
- Require python-libarchive-c (#1367034)

* Mon Aug 15 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 58-1
- Update to latest version

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 54-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Fri Jun 10 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 54-1
- Update to latest version

* Thu Mar 10 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 51-3
- Change License to GPLv3+

* Thu Mar 10 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 51-2
- Require python3-tlsh

* Wed Mar  9 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 51-1
- Update to v 51
- Add man page

* Tue Mar  8 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 48-1
- Update to v 48, simplify packaging

* Sat Dec 05 2015 Dhiru Kholia <dhiru@openwall.com> - 42-1
- Initial version