Cleanup conditionals for using python3

Signed-off-by: Merlin Mathesius <mmathesi@redhat.com>
This commit is contained in:
Merlin Mathesius 2020-07-16 13:20:52 -05:00
parent 0df6588295
commit 32a1148775

View File

@ -1,7 +1,11 @@
%if 0%{?fedora} > 27 || 0%{?rhel} >= 9
%global use_python3 1
%endif
Summary: Utilities to convert Outlook .pst files to other formats
Name: libpst
Version: 0.6.75
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2+
URL: http://www.five-ten-sg.com/%{name}/
Source: %{url}/packages/%{name}-%{version}.tar.gz
@ -9,7 +13,7 @@ Source: %{url}/packages/%{name}-%{version}.tar.gz
BuildRequires: libtool gcc-c++
BuildRequires: ImageMagick gd-devel zlib-devel boost-devel libgsf-devel gettext-devel
%if 0%{?fedora} > 27
%if 0%{?use_python3}
BuildRequires: python3 python3-devel boost-python3 boost-python3-devel
Requires: boost-python3
%else
@ -39,7 +43,7 @@ The libpst-libs package contains the shared library used by the pst
utilities.
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%package -n python3-%{name}
Requires: python3
Provides: %{name}-python = %{version}-%{release}
@ -60,7 +64,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%endif
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%description -n python3-%{name}
%else
%description python
@ -108,7 +112,7 @@ libpst utilities.
autoreconf -fiv
%configure --enable-libpst-shared \
--with-boost-python=boost_python%{python3_version_nodots}
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%make_build
%else
make %{?_smp_mflags}
@ -116,7 +120,7 @@ make %{?_smp_mflags}
%install
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%make_install
%else
rm -rf $RPM_BUILD_ROOT
@ -127,7 +131,7 @@ find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f
mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_datadir}/doc/%{name}
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%ldconfig_scriptlets libs
%else
%post libs -p /sbin/ldconfig
@ -145,7 +149,7 @@ mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_datadir}/doc/%{
%doc COPYING
%if 0%{?fedora} > 27
%if 0%{?use_python3}
%files -n python3-%{name}
%defattr(-,root,root,-)
%{python3_sitearch}/_*.so
@ -176,6 +180,9 @@ mv %{buildroot}%{_datadir}/doc/%{name}-%{version} %{buildroot}%{_datadir}/doc/%{
%changelog
* Thu Jul 16 2020 Merlin Mathesius <mmathesi@redhat.com> - 0.6.75-4
- Cleanup conditionals for using python3
* Fri May 29 2020 Jonathan Wakely <jwakely@redhat.com> - 0.6.75-3
- Rebuilt for Boost 1.73