f85694
%global srcname borgbackup
f85694
cbc662
%if 0%{?fedora} >= 30
cbc662
  %global bundle_msgpack 1
cbc662
%else
cbc662
  %global bundle_msgpack 0
cbc662
%endif
cbc662
f85694
Name:           %{srcname}
045c26
Version:        1.1.10
9495e9
Release:        2%{?dist}
11d629
Summary:        A deduplicating backup program with compression and authenticated encryption
f85694
cbc662
%if %bundle_msgpack
d3d4f1
License:        BSD and ASL 2.0 and zlib
cbc662
%else
d3d4f1
License:        BSD and zlib
cbc662
%endif
cbc662
f85694
URL:            https://borgbackup.readthedocs.org
3db4b3
Source0:        %pypi_source
f85694
045c26
# we don't need the guzzley_sphinx theme for only man page generation
6a39eb
Patch1:         0002-disable-sphinx-man-page-build.patch
cbc662
# ability not to build bundled msgpack
cbc662
Patch2:         0003-ability-to-unbundle-msgpack.patch
3db4b3
f85694
# build
f85694
BuildRequires:  python%{python3_pkgversion}-devel
f85694
BuildRequires:  python%{python3_pkgversion}-setuptools
f85694
BuildRequires:  python%{python3_pkgversion}-setuptools_scm
f85694
BuildRequires:  python%{python3_pkgversion}-Cython
f85694
BuildRequires:  python%{python3_pkgversion}-llfuse
cbc662
cbc662
%if %bundle_msgpack
3db4b3
Provides:       bundled(python%{python3_pkgversion}-msgpack) = 0.5.6
3db4b3
# requirements for bundled msgpack
3db4b3
BuildRequires:  gcc-c++
3db4b3
BuildRequires:  python%{python3_pkgversion}-funcsigs
cbc662
%else
cbc662
BuildRequires:  python%{python3_pkgversion}-msgpack <= 0.5.6
cbc662
%endif
f85694
f85694
# test
f85694
BuildRequires:  python%{python3_pkgversion}-pytest
f85694
ea322a
# doc
f85694
BuildRequires:  python%{python3_pkgversion}-sphinx
f85694
f85694
# no python deps
ea322a
BuildRequires:  gcc
7b9bec
BuildRequires:  openssl-devel >= 1.0.0
f85694
BuildRequires:  fuse-devel
f85694
BuildRequires:  libacl-devel
c430c5
BuildRequires:  libb2-devel
af8f16
BuildRequires:  lz4-devel >= 1.7.0
af8f16
BuildRequires:  libzstd-devel >= 1.3.0
f85694
cbc662
%if ! %bundle_msgpack
cbc662
Requires:       python%{python3_pkgversion}-msgpack <= 0.5.6
cbc662
%endif
b28cac
Requires:       python%{python3_pkgversion}-setuptools
7b9bec
Requires:       python%{python3_pkgversion}-llfuse
d2d88e
Requires:       fuse
7b9bec
d3d4f1
# xxHash: https://github.com/Cyan4973/xxHash
d3d4f1
# license: 2-clause BSD (Fedora: BSD, SPDX: BSD-2-Clause)
d3d4f1
# code was stripped a bit to only contain 64-bit functionality
d3d4f1
# upstream justification for bundling:
d3d4f1
#     https://github.com/borgbackup/borg/pull/2580#issuecomment-305579398
d3d4f1
# upstream won't unbundle this for v1.1.x:
d3d4f1
#     https://github.com/borgbackup/borg/issues/4592#issuecomment-495951573
d3d4f1
Provides:       bundled(xxHash) = 0.6.2
d3d4f1
f85694
%description
f85694
BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it
f85694
supports compression and authenticated encryption.
f85694
f85694
%prep
045c26
%autosetup -p1
f85694
rm -rf %{srcname}.egg-info
d8c34b
c430c5
# remove copies of bundled libraries to ensure these don't end up in our
c430c5
# binaries
c430c5
rm -rf src/borg/algorithms/{blake2,lz4,zstd}
05bb1c
# remove precompiled Cython code to ensure we always built "from source"
05bb1c
find src/ -name '*.pyx' | sed -e 's/.pyx/.c/g' | xargs rm -f
c430c5
cbc662
%if %bundle_msgpack
cbc662
  # bundled msgpack uses C++ for its generated sources
cbc662
  find src/ -name '*.pyx' | sed -e 's/.pyx/.cpp/g' | xargs rm -f
cbc662
cbc662
  # better name for inclusion in %%license
cbc662
  cp -a docs/3rd_party/msgpack/COPYING COPYING.msgpack
cbc662
%else
cbc662
  rm -rf src/borg/algorithms/msgpack
cbc662
cbc662
  # https://bugzilla.redhat.com/show_bug.cgi?id=1630992
cbc662
  sed -i 's/msgpack-python/msgpack/' setup.py
cbc662
%endif
cbc662
3db4b3
f85694
%build
cbc662
%if ! %bundle_msgpack
cbc662
    export BORG_EXTERNAL_MSGPACK=True
cbc662
%endif
f85694
%py3_build
f85694
6a39eb
# MANPAGE GENERATION
aa5c4d
# workaround to dump sphinx_rtd_theme dependency - not needed for manpages
aa5c4d
export READTHEDOCS=True
6a39eb
6a39eb
# workaround to include borg module for usage generation
6a39eb
export PYTHONPATH=$(pwd)/build/$(ls build/ | grep 'lib.')
6a39eb
d2d9de
make -C docs SPHINXBUILD=sphinx-build-%python3_version man
f85694
f85694
%install
f85694
find . -name *.so -type f -exec chmod 0755 {} \;
f85694
f85694
%py3_install
11d629
install -D -m 0644 docs/_build/man/borg*.1* %{buildroot}%{_mandir}/man1/borg.1
f85694
b231c6
# add shell completions
b231c6
#%define bash_compdir %(pkg-config --variable=completionsdir bash-completion)
b231c6
%define bash_compdir %{_prefix}/share/bash-completion/completions
b231c6
%define zsh_compdir %{_prefix}/share/zsh/site-functions
b231c6
%define fish_compdir %{_prefix}/share/fish/completions
b231c6
b231c6
install -d  %{buildroot}%{bash_compdir}
b231c6
install -d  %{buildroot}%{zsh_compdir}
b231c6
install -d  %{buildroot}%{fish_compdir}
b231c6
b231c6
install -D -m 0644 scripts/shell_completions/bash/* %{buildroot}%{bash_compdir}
b231c6
install -D -m 0644 scripts/shell_completions/zsh/* %{buildroot}%{zsh_compdir}
b231c6
install -D -m 0644 scripts/shell_completions/fish/* %{buildroot}%{fish_compdir}
b231c6
f85694
%check
6a39eb
export PYTHONPATH=$(pwd)/build/$(ls build/ | grep 'lib.')
e349ee
e349ee
# workaround to prevent test issues with ascii/utf-8 under rhel 7
2d5c05
%if 0%{?rhel} || 0%{?fedora} == 25
e349ee
export LANG=en_US.UTF-8
e349ee
%endif
e349ee
e349ee
# exclude test_fuse: there is no modprobe in mock for fuse
e349ee
# exclude benchmark: not relevant for package build
251d5f
TEST_SELECTOR="not test_fuse and not benchmark"
78d02f
%if 0%{?rhel}
af8f16
# exclude test_dash_open: pytest stub has a bug and is fixed in 3.0.2 (epel7 uses 2.8.5)
78d02f
TEST_SELECTOR="$TEST_SELECTOR and not test_dash_open"
78d02f
%endif
78d02f
%if 0%{?fedora} == 30
a6f109
# test_corrupted_repository: failures in mock/koji with F30
a6f109
#    upstream: https://github.com/borgbackup/borg/issues/4573
a6f109
#    pytest 3.7.x - 3.9.x fail to run the test suite.
a6f109
#      Fedora 29 has pytest 3.6.4 (good), Fedora 30 uses 3.9.3 (as of 05/2019)
a6f109
#    pytest versions 3.8.x/3.9.x cause test failure in ArchiverTestCase::test_corrupted_repository
a6f109
#    (only when running the full suite).
78d02f
TEST_SELECTOR="$TEST_SELECTOR and not test_corrupted_repository"
78d02f
%endif
78d02f
py.test-3 -x -vk "$TEST_SELECTOR" $PYTHONPATH/borg/testsuite/*.py
f85694
b231c6
%files
f85694
%license LICENSE
cbc662
%if %bundle_msgpack
cbc662
  %license COPYING.msgpack
cbc662
%endif
f85694
%doc README.rst PKG-INFO AUTHORS
f85694
%doc docs/changes.rst
f85694
%{_mandir}/man1/*
f85694
f85694
%{python3_sitearch}/*
d3d4f1
# - files in %%{python3_sitearch}/borg/algorithms/msgpack are licensed under the ASL
d3d4f1
# - %%{python3_sitearch}/borg/algorithms/checksums.*.so contains code licensed
d3d4f1
#   under the zlib license
f85694
%{_bindir}/borg
6a39eb
%{_bindir}/borgfs
b231c6
%{_prefix}/share/bash-completion/completions/*
b231c6
%{_prefix}/share/zsh/site-functions/*
b231c6
%{_prefix}/share/fish/completions/*
f85694
f85694
f85694
%changelog
9495e9
* Tue Jun 04 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-2
9495e9
- declare bundled xxhash correctly and adapt license tag accordingly
9495e9
- bundle python3-msgpack only when necessary (Fedora 30+)
9495e9
- fine-grained test exclusion to run as many tests as possible
9495e9
045c26
* Thu May 16 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-1
045c26
- Upstream Release 1.1.10
045c26
3db4b3
* Thu May 09 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.9-3
3db4b3
- bundle msgpack 0.5.6 (rhbz 1669083)
3db4b3
ea322a
* Sun Mar 10 2019 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.9-2
ea322a
- drop python2-sphinx dependency
ea322a
ebbea8
* Sat Mar 09 2019 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.9-1
ebbea8
- Upstream Release 1.1.9
ebbea8
4a48db
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.8-2
4a48db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4a48db
31e3b9
* Sat Dec 29 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.8-1
31e3b9
- Upstream Release 1.1.8
31e3b9
76db21
* Sun Sep 23 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.7-2
76db21
- Fix entrypoint broken by the msgpack rename (#1630992)
76db21
2d7556
* Mon Sep 03 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.7-1
2d7556
- Upstream Release 1.1.7
2d7556
- Rawhide compliant
2d7556
ee488b
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.5-4
ee488b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ee488b
ca767a
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.5-3
ca767a
- Rebuilt for Python 3.7
ca767a
9d856c
* Wed Apr 11 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.5-2
db0e14
- require python-msgpack >= 0.5.6 (see GH#3753)
db0e14
9d856c
* Tue Apr 10 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.5-1
eb7b92
- upstream version 1.1.5 (see upstream changelog)
eb7b92
- require python-msgpack < 0.5.0
eb7b92
- patch0 not needed anymore - fixed upstream
eb7b92
b884f2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-3
b884f2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b884f2
9d856c
* Mon Jan 1 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.4-2
8630a9
- add testsuite, needed for selftest
8630a9
9d856c
* Mon Jan 1 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.4-1
af8f16
- upstream version 1.1.4 (see upstream changelog)
af8f16
- added zstd compression
af8f16
- removed patch for borg check --repair malfunction
af8f16
- remove testsuite from package
af8f16
9d856c
* Sun Dec 17 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.3-2
3fae08
- fix borg check --repair malfunction (upstream pull #3444)
3fae08
9d856c
* Tue Nov 28 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.3-1
35ef8c
- upstream version 1.1.3
35ef8c
- fixes CVE-2017-15914 (BZ#1517664)
35ef8c
9d856c
* Tue Nov 07 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.2-1
b231c6
- upstream version 1.1.2
b231c6
- added shell completions
b231c6
9d856c
* Wed Nov 01 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.1-1
ea7885
- upstream version 1.1.1
ea7885
9d856c
* Mon Oct 09 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.0-1
d2d88e
- upstream version 1.1.0 (BZ#1499512)
d2d88e
- added missing fuse dependency (BZ#1493434)
d2d88e
3d9563
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.11-4
3d9563
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
3d9563
9d856c
* Sun Jul 30 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.11-3
2570e9
- removed sphinx_rtd_theme dependency
2570e9
9d856c
* Sat Jul 29 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.11-1
08385a
- upstream version 1.0.11 (BZ#1473897)
08385a
- removed setup.py build_api
08385a
912d81
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.10-2
912d81
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
912d81
9d856c
* Mon Feb 13 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.10-1
dbd563
- upstream version 1.0.10 (BZ#1421660)
dbd563
d6e1b9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-2
d6e1b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d6e1b9
9d856c
* Sun Dec 25 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.9-1
962b74
- upstream version 1.0.9 (BZ#1406277)
962b74
- fix manifest spoofing vulnerability - see docs for info
962b74
bd0d68
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.8-3
bd0d68
- Rebuild for Python 3.6
bd0d68
9d856c
* Mon Oct 31 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.8-2
52430a
- upstream version 1.0.8 (BZ#1389986)
52430a
9d856c
* Sun Aug 21 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.7-1
c7493d
- security fix with borg serve and restrict-to-path (BZ#1354371)
c7493d
e0be42
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-2
e0be42
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e0be42
9d856c
* Wed Jul 13 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.6-1
86b672
- upstream version 1.0.6 (BZ#1354371)
86b672
- update source url (now pointing to files.pythonhosted.org)
86b672
- testsuite on XFS is patched upstream
86b672
42eaa6
* Fri Jul 01 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.3-2
42eaa6
- Fix testsuite on XFS (#1331820)
42eaa6
9d856c
* Sun May 22 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.3-1
b28cac
- Added requires for setuptools (BZ#1335325)
b28cac
- upstream version 1.0.3
b28cac
9d856c
* Thu Apr 28 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-2
b28cac
- rebuilt
b28cac
9d856c
* Thu Apr 28 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-2
b28cac
- Missing dependency python-setuptools
b28cac
9d856c
* Sun Apr 17 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-1
d8c34b
- added epel7 specific parts
d8c34b
- make manpage generation work with epel7
95586c
- upstream version 1.0.2
d8c34b
9d856c
* Sat Apr 16 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.1-2
11d629
- simplified specfile
11d629
- removed unneeded dependencies: python3-mock, python3-pytest-cov
11d629
9d856c
* Sun Apr 10 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.1-1
b09601
- Upstream version 1.0.1. see changelog
b09601
9d856c
* Thu Apr 07 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.0-2
7b9bec
- Added requires for python3-llfuse (#1324685)
7b9bec
- Added minversion for openssl
7b9bec
9d856c
* Mon Apr 04 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.0-1
f85694
- Upstream version 1.0.0
f85694
- Rewrote build requirements for EPEL7
f85694
9d856c
* Thu Dec 17 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-3
f85694
- Specified correct project URL
f85694
- Added Buildrequires python3-sphinx_rtd_theme for f23
f85694
9d856c
* Thu Dec 17 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-2
f85694
- Cleanup Spec
f85694
- Rename package to borgbackup
f85694
 
9d856c
* Mon Dec 14 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-1
f85694
- New Upstream Version
f85694
- Added manpage from Upstream
f85694
- Testsuite now functional without benchmark
f85694
9d856c
* Sat Dec 05 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-6
f85694
- Added correct testsuite to check
f85694
- Removed unnessesary statements
f85694
9d856c
* Fri Dec 04 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-5
f85694
- Renamed Specfile to python3 only and remove pre-built egg-info
f85694
9d856c
* Wed Dec 02 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-4
f85694
- Removed double package statement and sum macro
f85694
9d856c
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-3
f85694
- Added dependency python3-msgpack to buildrequires
f85694
9d856c
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-2
f85694
- Added dependency python3-msgpack
f85694
9d856c
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-1
f85694
- Initial Packaging for the BorgBackup Project
f85694