From aa5b0c4ce43ad22693eef8e986063962b6924e71 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 7 Jun 2018 14:26:21 +0200 Subject: [PATCH] Port to python3, and obsolete Python2 subpackage --- libplist.spec | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/libplist.spec b/libplist.spec index 2e652cf..72e601f 100644 --- a/libplist.spec +++ b/libplist.spec @@ -1,4 +1,4 @@ -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%{!?python3_sitearch: %global python_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} Name: libplist Version: 2.0.0 @@ -11,9 +11,10 @@ Source0: http://www.libimobiledevice.org/downloads/%{name}-%{version}.tar.bz2 BuildRequires: chrpath BuildRequires: gcc -BuildRequires: python2-Cython -BuildRequires: python2-devel -BuildRequires: python2-setuptools +BuildRequires: python3-Cython +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: automake autoconf libtool %description libplist is a library for manipulating Apple Binary and XML Property Lists @@ -26,26 +27,32 @@ Requires: pkgconfig %description devel %{name}, development headers and libraries. -%package -n python2-libplist -%{?python_provide:%python_provide python2-libplist} +%package -n python3-libplist +%{?python_provide:%python_provide python3-libplist} # Remove before F30 Provides: %{name}-python = %{version}-%{release} Provides: %{name}-python%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} -Summary: Python2 bindings for libplist +Provides: %{name}-python2 = %{version}-%{release} +Provides: %{name}-python2%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python2 < %{version}-%{release} +Summary: Python3 bindings for libplist %{?python_provide:%python_provide python2-libplist} Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: python2 +Requires: python3 -%description -n python2-libplist +%description -n python3-libplist %{name}, python2 libraries and bindings. %prep %setup -q +sed -i 's/\[cython\]/[cython3]/' m4/ac_pkg_cython.m4 +ACLOCAL="aclocal -I m4" autoreconf -f -i %build export CFLAGS='%optflags -fno-strict-aliasing' export CXXFLAGS='%optflags -fno-strict-aliasing' +export PYTHON='python3' %configure --disable-static make %{?_smp_mflags} V=1 @@ -57,7 +64,7 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -delete chrpath --delete $RPM_BUILD_ROOT%{_bindir}/plistutil chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libplist++.so.3* -chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/plist* +chrpath --delete $RPM_BUILD_ROOT%{python3_sitearch}/plist* %check make check @@ -80,10 +87,13 @@ make check %{_libdir}/libplist++.so %{_includedir}/plist -%files -n python2-libplist -%{python_sitearch}/plist* +%files -n python3-libplist +%{python3_sitearch}/plist* %changelog +* Thu Jun 07 2018 Bastien Nocera - 2.0.0-8 +- Port to python3, and obsolete Python2 subpackage + * Wed Mar 7 2018 Peter Robinson 2.0.0-8 - Add gcc BR