8b2b232
Name:       barman
ed996ce
Version:    2.17
0d0810b
Release:    1%{?dist}
8b2b232
Summary:    Backup and Recovery Manager for PostgreSQL
8b2b232
License:    GPLv3
8b2b232
URL:        http://www.pgbarman.org/
6865da6
BuildArch:  noarch
6865da6
8b2b232
Source0:    https://files.pythonhosted.org/packages/source/b/%{name}/%{name}-%{version}.tar.gz
6865da6
Source1:    %{name}.cron
6865da6
Source2:    %{name}.logrotate
07f1ae7
07f1ae7
BuildRequires:  python3-devel
6abe2d4
BuildRequires:  python3-setuptools
6865da6
8b2b232
# https://docs.fedoraproject.org/en-US/packaging-guidelines/CronFiles/#_cron_job_files_packaging:
5b2d640
Requires:       cronie
8b2b232
Requires:       logrotate
bb35d7b
Requires(pre):  shadow-utils
8b2b232
Requires:       rsync >= 3.0.4
4c30986
Requires:       %{py3_dist argcomplete}
bb35d7b
Requires:       %{py3_dist barman} = %{version}
07f1ae7
07f1ae7
%description
6865da6
Barman (Backup and Recovery Manager) is an open-source administration tool for
6865da6
disaster recovery of PostgreSQL servers written in Python.
6865da6
6865da6
It allows your organization to perform remote backups of multiple servers in
6865da6
business critical environments to reduce risk and help DBAs during the recovery
6865da6
phase.
bb35d7b
6865da6
%package cli
6865da6
Summary:    Client Utilities for Barman
6865da6
Requires:   %{py3_dist barman} = %{version}
bb35d7b
6865da6
%description cli
6865da6
Client utilities for the integration of Barman in PostgreSQL clusters.
bb35d7b
bb35d7b
%package -n python3-barman
4c30986
Summary:    Shared libraries for Barman
4c30986
%{?python_provide:%python_provide python3-%{name}}
4c30986
bb35d7b
%description -n python3-barman
bb35d7b
Python libraries used by Barman.
bb35d7b
07f1ae7
%prep
6865da6
%autosetup
07f1ae7
07f1ae7
# Change shebang in all relevant executable files in this directory and all subdirectories
07f1ae7
find -type f -executable -exec sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +
07f1ae7
07f1ae7
%build
07f1ae7
%py3_build
07f1ae7
07f1ae7
%install
07f1ae7
%py3_install
6865da6
6865da6
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/conf.d
07f1ae7
mkdir -p %{buildroot}%{_sysconfdir}/cron.d/
07f1ae7
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
6865da6
mkdir -p %{buildroot}%{_sharedstatedir}/%{name}
6865da6
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
6865da6
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions/
6865da6
6865da6
install -p -m 644 doc/%{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
6865da6
install -p -m 644 doc/%{name}.d/* %{buildroot}%{_sysconfdir}/%{name}/conf.d
6865da6
install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/cron.d/%{name}
6865da6
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
6865da6
install -p -m 644 scripts/%{name}.bash_completion %{buildroot}%{_datadir}/bash-completion/completions/%{name}
6865da6
6865da6
sed -i 's|/etc/%{name}.d|/etc/%{name}/conf.d|g' %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
07f1ae7
07f1ae7
%files
07f1ae7
%{_bindir}/%{name}
6865da6
%{_datadir}/bash-completion/completions/%{name}
6865da6
%{_mandir}/man1/%{name}.1*
6865da6
%{_mandir}/man5/%{name}.5*
6865da6
%dir %{_sysconfdir}/%{name}/
6865da6
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
6865da6
%config(noreplace) %{_sysconfdir}/%{name}/conf.d/
07f1ae7
%config(noreplace) %{_sysconfdir}/cron.d/%{name}
07f1ae7
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
6865da6
%attr(700,%{name},%{name}) %dir %{_sharedstatedir}/%{name}
6865da6
%attr(755,%{name},%{name}) %dir %{_localstatedir}/log/%{name}
6865da6
6865da6
%files cli
6865da6
%{_bindir}/%{name}-wal-archive
6865da6
%{_bindir}/%{name}-wal-restore
659b580
%{_bindir}/%{name}-cloud-restore
659b580
%{_bindir}/%{name}-cloud-wal-restore
6865da6
%{_bindir}/%{name}-cloud-wal-archive
6865da6
%{_bindir}/%{name}-cloud-backup
659b580
%{_bindir}/%{name}-cloud-backup-list
0d0810b
%{_bindir}/%{name}-cloud-backup-keep
0d0810b
%{_bindir}/%{name}-cloud-backup-delete
0d0810b
%{_bindir}/%{name}-cloud-check-wal-archive
6865da6
%{_mandir}/man1/%{name}-wal-archive.1*
6865da6
%{_mandir}/man1/%{name}-wal-restore.1*
659b580
%{_mandir}/man1/%{name}-cloud-restore.1*
659b580
%{_mandir}/man1/%{name}-cloud-wal-restore.1*
6865da6
%{_mandir}/man1/%{name}-cloud-wal-archive.1*
6865da6
%{_mandir}/man1/%{name}-cloud-backup.1*
659b580
%{_mandir}/man1/%{name}-cloud-backup-list.1*
6865da6
6865da6
%files -n python3-%{name}
6865da6
%license LICENSE
bb35d7b
%doc NEWS README.rst
4c30986
%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info
bb35d7b
%{python3_sitelib}/%{name}/
bb35d7b
07f1ae7
%pre
6865da6
getent group %{name} >/dev/null || groupadd -r %{name}
6865da6
getent passwd %{name} >/dev/null || \
6865da6
    useradd -r -g %{name} -d %{_sharedstatedir}/%{name} -s /bin/bash \
6865da6
    -c "Backup and Recovery Manager for PostgreSQL" %{name}
07f1ae7
exit 0
07f1ae7
07f1ae7
%changelog
ed996ce
* Fri Dec 31 2021 Simone Caronni <negativo17@gmail.com> - 2.17-1
ed996ce
- Update to 2.17.
ed996ce
0d0810b
* Fri Nov 26 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.16-1
0d0810b
- Update to 2.16
0d0810b
d6d30b4
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.12-4
d6d30b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
d6d30b4
79e99bb
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.12-3
79e99bb
- Rebuilt for Python 3.10
79e99bb
a88ce25
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.12-2
a88ce25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
a88ce25
079e804
* Sun Nov 22 2020 Francisco Javier Tsao Santín <tsao@disroot.org> - 2.12-1
079e804
- Update to 2.12.
079e804
659b580
* Tue Aug 18 2020 Simone Caronni <negativo17@gmail.com> - 2.11-1
659b580
- Update to 2.11.
659b580
3a35d04
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.10-6
3a35d04
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
3a35d04
5b2d640
* Thu Jul 02 2020 Simone Caronni <negativo17@gmail.com> - 2.10-5
5b2d640
- Require cronie, not crontabs.
5b2d640
6865da6
* Wed Jul 01 2020 Simone Caronni <negativo17@gmail.com> - 2.10-4
6865da6
- Update SPEC file.
6865da6
- Use macros where possible.
6865da6
- Adjust Python requirements. Generator is already enforced on Fedora &
6865da6
  CentOS/RHEL 8+.
6865da6
- Install license and docs in python libraries, so they are always installed.
6865da6
- Do not remove logs on uninstallation.
6865da6
- Trim changelog.
6865da6
2478250
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.10-3
2478250
- Rebuilt for Python 3.9
2478250
bd51e76
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.10-2
bd51e76
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
bd51e76
4c9bbd7
* Sun Jan 12 2020 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.10-1
4c9bbd7
- RHBZ#1778773 Updated to 2.10 version
4c9bbd7
f88daae
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.9-3
f88daae
- Rebuilt for Python 3.8.0rc1 (#1748018)
f88daae
6f83d72
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.9-2
6f83d72
- Rebuilt for Python 3.8
6f83d72
8b2b232
* Sun Aug 18 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.9-1
11450de
- RHBZ#1742344 Updated to 2.9 version
11450de
90d90eb
* Tue Jul 30 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.8-6
90d90eb
- RHBZ#1734137 fix python_provide macro in the right block of spec file
90d90eb
b9d7adb
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.8-5
b9d7adb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
b9d7adb
0c0a7ed
* Wed Jun 26 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.8-4
0c0a7ed
- RHBZ#1721158 fix typo that breaks config file
0c0a7ed
bb35d7b
* Wed Jun 19 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.8-3
bb35d7b
- RHBZ#1721158 updated spec in order to split package as recommended by upstream
bb35d7b
2333210
* Thu May 16 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.8-2
2333210
- Minor fixes over previous commit
2333210
c25166c
* Thu May 16 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.8-1
c25166c
- Update to 2.8 version (fixes RHBZ#1707150)
c25166c
bbefed8
* Wed Mar 20 2019 Francisco Javier Tsao Santín <tsao@gpul.org> - 2.7-1
bbefed8
- Update to 2.7 version
bbefed8
2333210
* Mon Feb 18 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.5-3
2333210
- Enable python dependency generator
2333210
2333210
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-2
2333210
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild