Blob Blame History Raw
%{?scl:%scl_package pg_repack}
%{!?scl:%global pkg_name %{name}}

Name:           %{?scl_prefix}pg_repack
Version:        1.4.6
Release:        2%{?dist}
Summary:        Reorganize tables in PostgreSQL databases without any locks

License:        BSD
URL:            http://reorg.github.io/%{pkg_name}/
Source0:        https://github.com/reorg/%{pkg_name}/archive/ver_%{version}.tar.gz

BuildRequires:  make
BuildRequires:  %{?scl_prefix}postgresql, gcc, openssl-devel, %{?scl_prefix}postgresql-server
BuildRequires:  %{?scl_prefix}postgresql-libs, %{?scl_prefix}postgresql-devel
BuildRequires:  readline-devel, zlib-devel, %{?scl_prefix}postgresql-static
BuildRequires:  python-docutils

%description
pg_repack is a PostgreSQL extension which lets you remove
bloat from tables and indexes, and optionally
restore the physical order of clustered indexes.
Unlike CLUSTER and VACUUM FULL it works online,
without holding an exclusive lock on the processed tables during processing.
pg_repack is efficient to boot,
with performance comparable to using CLUSTER directly.

Please check the documentation (in the doc directory or online)
for installation and usage instructions.

%if 0%{?scl:1}
%scl_syspaths_package -d
%endif

%prep
%{?scl:scl enable %{scl} - << \EOF}
set -ex
%setup -n %{pkg_name}-ver_%{version} -q
%{?scl:EOF}


%build

%{?scl:scl enable %{scl} - << \EOF}
set -ex
make %{?_smp_mflags}
cd doc
make
%{?scl:EOF}


%install
%{?scl:scl enable %{scl} - << \EOF}
set -ex
%make_install
%scl_syspaths_install_wrappers -n %{pkg_name} -m script -p bin %{pkg_name}
%{?scl:EOF}

%files
%{_bindir}/%{pkg_name}
%{_libdir}/pgsql/%{pkg_name}.so
%{_datadir}/pgsql/extension/%{pkg_name}.control
%{_datadir}/pgsql/extension/%{pkg_name}--%{version}.sql

%license COPYRIGHT

%doc README.rst
%doc doc/%{pkg_name}.html
%doc doc/%{pkg_name}.rst
%doc doc/%{pkg_name}_jp.html
%doc doc/%{pkg_name}_jp.rst
%doc doc/release.html
%doc doc/release.rst

%if 0%{?scl:1}
%scl_syspaths_files
%endif

%changelog
* Wed Mar 10 2021 Honza Horak <hhorak@redhat.com> - 1.4.6-2
- Convert to SCL package
- Remove llvm-jit fragments as we don't have it in RHSCL package

* Thu Jan 28 2021 Patrik Novotný <panovotn@redhat.com> - 1.4.6-1
- Rebase to upstream release 1.4.6

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Aug 21 2019 Filip Januš <fjanus@redhat.com> 1.4.5-1
- Initial packaging