f856948
%global srcname borgbackup
f856948
59232e9
%if 0%{?fedora} || 0%{?rhel} == 8
cbc662f
  %global bundle_msgpack 1
cbc662f
%else
cbc662f
  %global bundle_msgpack 0
cbc662f
%endif
cbc662f
f856948
Name:           %{srcname}
dc1906d
Version:        1.1.14
dc1906d
Release:        1%{?dist}
11d6296
Summary:        A deduplicating backup program with compression and authenticated encryption
f856948
cbc662f
%if %bundle_msgpack
d3d4f11
License:        BSD and ASL 2.0 and zlib
cbc662f
%else
d3d4f11
License:        BSD and zlib
cbc662f
%endif
cbc662f
f856948
URL:            https://borgbackup.readthedocs.org
3db4b35
Source0:        %pypi_source
8ca5890
Source1:        %pypi_source.asc
8ca5890
# upstream publishes only key ids:
8ca5890
#    https://borgbackup.readthedocs.io/en/stable/support.html#verifying-signed-releases
8ca5890
# gpg2 --export --export-options export-minimal "6D5B EF9A DD20 7580 5747 B70F 9F88 FB52 FAF7 B393" > gpgkey-6D5B_EF9A_DD20_7580_5747_B70F_9F88_FB52_FAF7_B393.gpg
8ca5890
Source2:        gpgkey-6D5B_EF9A_DD20_7580_5747_B70F_9F88_FB52_FAF7_B393.gpg
f856948
045c269
# we don't need the guzzley_sphinx theme for only man page generation
6a39eb7
Patch1:         0002-disable-sphinx-man-page-build.patch
cbc662f
# ability not to build bundled msgpack
cbc662f
Patch2:         0003-ability-to-unbundle-msgpack.patch
dc1906d
# https://mail.python.org/pipermail/borgbackup/2020q4/001699.html
dc1906d
Patch3:         borgbackup-strip-llfuse-versions.patch
3db4b35
8ca5890
BuildRequires:  gnupg2
f856948
# build
f856948
BuildRequires:  python%{python3_pkgversion}-devel
f856948
BuildRequires:  python%{python3_pkgversion}-setuptools
f856948
BuildRequires:  python%{python3_pkgversion}-setuptools_scm
f856948
BuildRequires:  python%{python3_pkgversion}-Cython
dc1906d
BuildRequires:  python%{python3_pkgversion}-llfuse >= 1.3.4
cbc662f
cbc662f
%if %bundle_msgpack
3db4b35
Provides:       bundled(python%{python3_pkgversion}-msgpack) = 0.5.6
3db4b35
# requirements for bundled msgpack
3db4b35
BuildRequires:  gcc-c++
cbc662f
%else
cbc662f
BuildRequires:  python%{python3_pkgversion}-msgpack <= 0.5.6
cbc662f
%endif
f856948
f856948
# test
f856948
BuildRequires:  python%{python3_pkgversion}-pytest
f856948
ea322a8
# doc
f856948
BuildRequires:  python%{python3_pkgversion}-sphinx
f856948
f856948
# no python deps
ea322a8
BuildRequires:  gcc
7b9bec2
BuildRequires:  openssl-devel >= 1.0.0
f856948
BuildRequires:  fuse-devel
f856948
BuildRequires:  libacl-devel
c430c57
BuildRequires:  libb2-devel
af8f169
BuildRequires:  lz4-devel >= 1.7.0
af8f169
BuildRequires:  libzstd-devel >= 1.3.0
f856948
cbc662f
%if ! %bundle_msgpack
cbc662f
Requires:       python%{python3_pkgversion}-msgpack <= 0.5.6
cbc662f
%endif
b28cac8
Requires:       python%{python3_pkgversion}-setuptools
dc1906d
Requires:       python%{python3_pkgversion}-llfuse >= 1.3.4
d2d88ee
Requires:       fuse
7b9bec2
d3d4f11
# xxHash: https://github.com/Cyan4973/xxHash
d3d4f11
# license: 2-clause BSD (Fedora: BSD, SPDX: BSD-2-Clause)
d3d4f11
# code was stripped a bit to only contain 64-bit functionality
d3d4f11
# upstream justification for bundling:
d3d4f11
#     https://github.com/borgbackup/borg/pull/2580#issuecomment-305579398
d3d4f11
# upstream won't unbundle this for v1.1.x:
d3d4f11
#     https://github.com/borgbackup/borg/issues/4592#issuecomment-495951573
0fdfa36
# since borgbackup 1.1.11 the code needs at least xxHash >= 0.7.2
dc1906d
Provides:       bundled(xxHash) = 0.7.4
d3d4f11
f856948
%description
f856948
BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it
f856948
supports compression and authenticated encryption.
f856948
f856948
%prep
8ca5890
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
045c269
%autosetup -p1
f856948
rm -rf %{srcname}.egg-info
d8c34ba
c430c57
# remove copies of bundled libraries to ensure these don't end up in our
c430c57
# binaries
c430c57
rm -rf src/borg/algorithms/{blake2,lz4,zstd}
05bb1c6
# remove precompiled Cython code to ensure we always built "from source"
05bb1c6
find src/ -name '*.pyx' | sed -e 's/.pyx/.c/g' | xargs rm -f
c430c57
cbc662f
%if %bundle_msgpack
cbc662f
  # bundled msgpack uses C++ for its generated sources
cbc662f
  find src/ -name '*.pyx' | sed -e 's/.pyx/.cpp/g' | xargs rm -f
cbc662f
cbc662f
  # better name for inclusion in %%license
cbc662f
  cp -a docs/3rd_party/msgpack/COPYING COPYING.msgpack
cbc662f
%else
cbc662f
  rm -rf src/borg/algorithms/msgpack
cbc662f
cbc662f
  # https://bugzilla.redhat.com/show_bug.cgi?id=1630992
cbc662f
  sed -i 's/msgpack-python/msgpack/' setup.py
cbc662f
%endif
cbc662f
3db4b35
f856948
%build
cbc662f
%if ! %bundle_msgpack
cbc662f
    export BORG_EXTERNAL_MSGPACK=True
cbc662f
%endif
f856948
%py3_build
f856948
6a39eb7
# MANPAGE GENERATION
aa5c4d0
# workaround to dump sphinx_rtd_theme dependency - not needed for manpages
aa5c4d0
export READTHEDOCS=True
6a39eb7
6a39eb7
# workaround to include borg module for usage generation
6a39eb7
export PYTHONPATH=$(pwd)/build/$(ls build/ | grep 'lib.')
6a39eb7
d2d9de3
make -C docs SPHINXBUILD=sphinx-build-%python3_version man
f856948
f856948
%install
f856948
find . -name *.so -type f -exec chmod 0755 {} \;
f856948
f856948
%py3_install
11d6296
install -D -m 0644 docs/_build/man/borg*.1* %{buildroot}%{_mandir}/man1/borg.1
f856948
b231c6c
# add shell completions
b231c6c
#%define bash_compdir %(pkg-config --variable=completionsdir bash-completion)
b231c6c
%define bash_compdir %{_prefix}/share/bash-completion/completions
b231c6c
%define zsh_compdir %{_prefix}/share/zsh/site-functions
b231c6c
%define fish_compdir %{_prefix}/share/fish/completions
b231c6c
b231c6c
install -d  %{buildroot}%{bash_compdir}
b231c6c
install -d  %{buildroot}%{zsh_compdir}
b231c6c
install -d  %{buildroot}%{fish_compdir}
b231c6c
b231c6c
install -D -m 0644 scripts/shell_completions/bash/* %{buildroot}%{bash_compdir}
b231c6c
install -D -m 0644 scripts/shell_completions/zsh/* %{buildroot}%{zsh_compdir}
b231c6c
install -D -m 0644 scripts/shell_completions/fish/* %{buildroot}%{fish_compdir}
b231c6c
f856948
%check
6a39eb7
export PYTHONPATH=$(pwd)/build/$(ls build/ | grep 'lib.')
e349ee9
e349ee9
# workaround to prevent test issues with ascii/utf-8 under rhel 7
59232e9
%if 0%{?rhel} == 7
e349ee9
export LANG=en_US.UTF-8
e349ee9
%endif
e349ee9
e349ee9
# exclude test_fuse: there is no modprobe in mock for fuse
df1807b
# test_readonly_mount: needs fuse mount
e349ee9
# exclude benchmark: not relevant for package build
df1807b
TEST_SELECTOR="not test_fuse and not test_readonly_mount and not benchmark"
0c53deb
%if 0%{?rhel} == 7
2291569
# exclude test_dash_open: pytest stub has a bug and is fixed in 3.0.2 (epel7 uses 2.9.2)
78d02f3
TEST_SELECTOR="$TEST_SELECTOR and not test_dash_open"
78d02f3
%endif
78d02f3
py.test-3 -x -vk "$TEST_SELECTOR" $PYTHONPATH/borg/testsuite/*.py
f856948
b231c6c
%files
f856948
%license LICENSE
cbc662f
%if %bundle_msgpack
cbc662f
  %license COPYING.msgpack
cbc662f
%endif
f856948
%doc README.rst PKG-INFO AUTHORS
f856948
%doc docs/changes.rst
f856948
%{_mandir}/man1/*
f856948
8be4855
%{python3_sitearch}/borg
8be4855
%{python3_sitearch}/borgbackup-%{version}-py%{python3_version}.egg-info
d3d4f11
# - files in %%{python3_sitearch}/borg/algorithms/msgpack are licensed under the ASL
d3d4f11
# - %%{python3_sitearch}/borg/algorithms/checksums.*.so contains code licensed
d3d4f11
#   under the zlib license
f856948
%{_bindir}/borg
6a39eb7
%{_bindir}/borgfs
b231c6c
%{_prefix}/share/bash-completion/completions/*
b231c6c
%{_prefix}/share/zsh/site-functions/*
b231c6c
%{_prefix}/share/fish/completions/*
f856948
f856948
f856948
%changelog
dc1906d
* Thu Oct 08 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.14-1
dc1906d
- update to 1.1.14
dc1906d
1cc78f8
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.13-2
1cc78f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
1cc78f8
df1807b
* Sun Jun 07 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.13-1
df1807b
- update to 1.1.13
df1807b
aa30869
* Thu Jun 04 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.11-3
aa30869
- add patch to prevent sporadic test failures (see F31 rebuild attempts)
aa30869
a1becdd
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.1.11-2
a1becdd
- Rebuilt for Python 3.9
a1becdd
0fdfa36
* Sun Mar 08 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.11-1
0fdfa36
- update to 1.1.11
0fdfa36
55f5db7
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.10-7
55f5db7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
55f5db7
8ca5890
* Thu Nov 28 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-6
8ca5890
- enable GPG source file verification
8ca5890
baf5dc9
* Mon Sep 23 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-5
baf5dc9
- Rebuilt for libb2 0.98.1
baf5dc9
df5ce36
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.10-4
df5ce36
- Rebuilt for Python 3.8
df5ce36
7d69f0f
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.10-3
7d69f0f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
7d69f0f
9495e98
* Tue Jun 04 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-2
9495e98
- declare bundled xxhash correctly and adapt license tag accordingly
9495e98
- bundle python3-msgpack only when necessary (Fedora 30+)
9495e98
- fine-grained test exclusion to run as many tests as possible
9495e98
045c269
* Thu May 16 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.10-1
045c269
- Upstream Release 1.1.10
045c269
3db4b35
* Thu May 09 2019 Felix Schwarz <fschwarz@fedoraproject.org> - 1.1.9-3
3db4b35
- bundle msgpack 0.5.6 (rhbz 1669083)
3db4b35
ea322a8
* Sun Mar 10 2019 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.9-2
ea322a8
- drop python2-sphinx dependency
ea322a8
ebbea88
* Sat Mar 09 2019 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.9-1
ebbea88
- Upstream Release 1.1.9
ebbea88
4a48db5
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.8-2
4a48db5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4a48db5
31e3b95
* Sat Dec 29 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.8-1
31e3b95
- Upstream Release 1.1.8
31e3b95
76db21c
* Sun Sep 23 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.7-2
76db21c
- Fix entrypoint broken by the msgpack rename (#1630992)
76db21c
2d75561
* Mon Sep 03 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.7-1
2d75561
- Upstream Release 1.1.7
2d75561
- Rawhide compliant
2d75561
ee488b6
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.5-4
ee488b6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ee488b6
ca767a5
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.5-3
ca767a5
- Rebuilt for Python 3.7
ca767a5
9d856c4
* Wed Apr 11 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.5-2
db0e141
- require python-msgpack >= 0.5.6 (see GH#3753)
db0e141
9d856c4
* Tue Apr 10 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.5-1
eb7b925
- upstream version 1.1.5 (see upstream changelog)
eb7b925
- require python-msgpack < 0.5.0
eb7b925
- patch0 not needed anymore - fixed upstream
eb7b925
b884f2c
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-3
b884f2c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b884f2c
9d856c4
* Mon Jan 1 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.4-2
8630a98
- add testsuite, needed for selftest
8630a98
9d856c4
* Mon Jan 1 2018 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.4-1
af8f169
- upstream version 1.1.4 (see upstream changelog)
af8f169
- added zstd compression
af8f169
- removed patch for borg check --repair malfunction
af8f169
- remove testsuite from package
af8f169
9d856c4
* Sun Dec 17 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.3-2
3fae087
- fix borg check --repair malfunction (upstream pull #3444)
3fae087
9d856c4
* Tue Nov 28 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.3-1
35ef8cc
- upstream version 1.1.3
35ef8cc
- fixes CVE-2017-15914 (BZ#1517664)
35ef8cc
9d856c4
* Tue Nov 07 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.2-1
b231c6c
- upstream version 1.1.2
b231c6c
- added shell completions
b231c6c
9d856c4
* Wed Nov 01 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.1-1
ea7885b
- upstream version 1.1.1
ea7885b
9d856c4
* Mon Oct 09 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.1.0-1
d2d88ee
- upstream version 1.1.0 (BZ#1499512)
d2d88ee
- added missing fuse dependency (BZ#1493434)
d2d88ee
3d95631
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.11-4
3d95631
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
3d95631
9d856c4
* Sun Jul 30 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.11-3
2570e9c
- removed sphinx_rtd_theme dependency
2570e9c
9d856c4
* Sat Jul 29 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.11-1
08385af
- upstream version 1.0.11 (BZ#1473897)
08385af
- removed setup.py build_api
08385af
912d815
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.10-2
912d815
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
912d815
9d856c4
* Mon Feb 13 2017 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.10-1
dbd5637
- upstream version 1.0.10 (BZ#1421660)
dbd5637
d6e1b94
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.9-2
d6e1b94
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d6e1b94
9d856c4
* Sun Dec 25 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.9-1
962b741
- upstream version 1.0.9 (BZ#1406277)
962b741
- fix manifest spoofing vulnerability - see docs for info
962b741
bd0d681
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.0.8-3
bd0d681
- Rebuild for Python 3.6
bd0d681
9d856c4
* Mon Oct 31 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.8-2
52430ad
- upstream version 1.0.8 (BZ#1389986)
52430ad
9d856c4
* Sun Aug 21 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.7-1
c7493dd
- security fix with borg serve and restrict-to-path (BZ#1354371)
c7493dd
e0be428
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-2
e0be428
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e0be428
9d856c4
* Wed Jul 13 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.6-1
86b6729
- upstream version 1.0.6 (BZ#1354371)
86b6729
- update source url (now pointing to files.pythonhosted.org)
86b6729
- testsuite on XFS is patched upstream
86b6729
42eaa6d
* Fri Jul 01 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 1.0.3-2
42eaa6d
- Fix testsuite on XFS (#1331820)
42eaa6d
9d856c4
* Sun May 22 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.3-1
b28cac8
- Added requires for setuptools (BZ#1335325)
b28cac8
- upstream version 1.0.3
b28cac8
9d856c4
* Thu Apr 28 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-2
b28cac8
- rebuilt
b28cac8
9d856c4
* Thu Apr 28 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-2
b28cac8
- Missing dependency python-setuptools
b28cac8
9d856c4
* Sun Apr 17 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.2-1
d8c34ba
- added epel7 specific parts
d8c34ba
- make manpage generation work with epel7
95586c3
- upstream version 1.0.2
d8c34ba
9d856c4
* Sat Apr 16 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.1-2
11d6296
- simplified specfile
11d6296
- removed unneeded dependencies: python3-mock, python3-pytest-cov
11d6296
9d856c4
* Sun Apr 10 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.1-1
b09601f
- Upstream version 1.0.1. see changelog
b09601f
9d856c4
* Thu Apr 07 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.0-2
7b9bec2
- Added requires for python3-llfuse (#1324685)
7b9bec2
- Added minversion for openssl
7b9bec2
9d856c4
* Mon Apr 04 2016 Benjamin Pereto <bpereto@fedoraproject.org> - 1.0.0-1
f856948
- Upstream version 1.0.0
f856948
- Rewrote build requirements for EPEL7
f856948
9d856c4
* Thu Dec 17 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-3
f856948
- Specified correct project URL
f856948
- Added Buildrequires python3-sphinx_rtd_theme for f23
f856948
9d856c4
* Thu Dec 17 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-2
f856948
- Cleanup Spec
f856948
- Rename package to borgbackup
f856948
 
9d856c4
* Mon Dec 14 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.29.0-1
f856948
- New Upstream Version
f856948
- Added manpage from Upstream
f856948
- Testsuite now functional without benchmark
f856948
9d856c4
* Sat Dec 05 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-6
f856948
- Added correct testsuite to check
f856948
- Removed unnessesary statements
f856948
9d856c4
* Fri Dec 04 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-5
f856948
- Renamed Specfile to python3 only and remove pre-built egg-info
f856948
9d856c4
* Wed Dec 02 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-4
f856948
- Removed double package statement and sum macro
f856948
9d856c4
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-3
f856948
- Added dependency python3-msgpack to buildrequires
f856948
9d856c4
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-2
f856948
- Added dependency python3-msgpack
f856948
9d856c4
* Tue Dec 01 2015 Benjamin Pereto <bpereto@fedoraproject.org> - 0.28.2-1
f856948
- Initial Packaging for the BorgBackup Project
f856948