Revert "Add Platform Python subpackage"

This reverts commit 5fe4e61282.

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
Igor Gnatenko 2017-11-03 22:33:09 +01:00
parent 4230798058
commit a24dcbd460

View File

@ -1,18 +1,12 @@
%bcond_without python2
%if 0%{?rhel} && 0%{?rhel} <= 7 %if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3 %bcond_with python3
%else %else
%bcond_without python3 %bcond_without python3
%endif %endif
%if 0%{?fedora} >= 27 || 0%{?rhel} > 7
%bcond_without platform_python
%else
%bcond_with platform_python
%endif
Name: libcomps Name: libcomps
Version: 0.1.8 Version: 0.1.8
Release: 7%{?dist} Release: 8%{?dist}
Summary: Comps XML file manipulation library Summary: Comps XML file manipulation library
License: GPLv2+ License: GPLv2+
@ -45,7 +39,6 @@ BuildRequires: doxygen
%description doc %description doc
Documentation files for libcomps library. Documentation files for libcomps library.
%if %{with python2}
%package -n python-%{name}-doc %package -n python-%{name}-doc
Summary: Documentation files for python bindings libcomps library Summary: Documentation files for python bindings libcomps library
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
@ -63,7 +56,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python2-%{name} %description -n python2-%{name}
Python 2 bindings for libcomps library. Python 2 bindings for libcomps library.
%endif # with python2
%if %{with python3} %if %{with python3}
%package -n python3-%{name} %package -n python3-%{name}
@ -71,106 +63,56 @@ Summary: Python 3 bindings for libcomps library
BuildRequires: python3-devel BuildRequires: python3-devel
%{?python_provide:%python_provide python3-%{name}} %{?python_provide:%python_provide python3-%{name}}
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: platform-python-%{name} < 0.1.8-8
%description -n python3-%{name} %description -n python3-%{name}
Python3 bindings for libcomps library. Python3 bindings for libcomps library.
%endif # with python3 %endif
%if %{with platform_python}
%package -n platform-python-%{name}
Summary: Platform Python bindings for libcomps library
BuildRequires: platform-python-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n platform-python-%{name}
Platform Python bindings for libcomps library.
%endif # with platform_python
%prep %prep
%autosetup -n %{name}-%{name}-%{version} %autosetup -n %{name}-%{name}-%{version}
%if %{with python2} mkdir build
mkdir build-py2
%endif # with python2
%if %{with python3} %if %{with python3}
mkdir build-py3 mkdir build-py3
%endif # with python3 %endif
%if %{with platform_python}
mkdir build-platform_python
%endif # with platform_python
%build %build
%if %{with python2} pushd build
pushd build-py2
%cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=2
%make_build %make_build
make %{?_smp_mflags} docs make %{?_smp_mflags} docs
make %{?_smp_mflags} pydocs make %{?_smp_mflags} pydocs
popd popd
%endif # with python2
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
%cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3 %cmake ../libcomps/ -DPYTHON_DESIRED:STRING=3
%make_build %make_build
popd popd
%endif # with python3 %endif
%if %{with platform_python}
pushd build-platform_python
export python_so=%{_libdir}/`%{__platform_python} -c 'import sysconfig; print(sysconfig.get_config_var("LDLIBRARY"))'`
export python_include=`%{__platform_python} -c 'import sysconfig; print(sysconfig.get_path("include"))'`
%cmake \
../libcomps/ \
-DPYTHON_EXECUTABLE:FILEPATH=%{__platform_python} \
-DPYTHON_LIBRARY=$python_so \
-DPYTHON_INCLUDE_DIR=$python_include \
-DPYTHON_DESIRED:str=3
%make_build
popd
%endif # with platform_python
%install %install
%if %{with python2} pushd build
pushd build-py2
%make_install %make_install
popd popd
%endif # with python2
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
%make_install %make_install
popd popd
%endif # with python3 %endif
%if %{with platform_python}
pushd build-platform_python
%make_install
popd
%endif # with platform_python
%check %check
%if %{with python2} pushd build
pushd build-py2
make test make test
popd popd
%endif # with python2
%if %{with python3} %if %{with python3}
pushd build-py3 pushd build-py3
make pytest make pytest
popd popd
%endif # with python3 %endif
%if %{with platform_python}
pushd build-platform_python
# Tests are Python 3 incompatible and they are
# skipped internally for Python 3 as well.
#make pytest
popd
%endif # with platform_python
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
@ -184,28 +126,24 @@ popd
%{_libdir}/%{name}.so %{_libdir}/%{name}.so
%{_includedir}/%{name}/ %{_includedir}/%{name}/
%if %{with python2}
%files doc %files doc
%doc build-py2/docs/libcomps-doc/html %doc build/docs/libcomps-doc/html
%files -n python-%{name}-doc %files -n python-%{name}-doc
%doc build-py2/src/python/docs/html %doc build/src/python/docs/html
%files -n python2-%{name} %files -n python2-%{name}
%{python2_sitearch}/%{name}/ %{python2_sitearch}/%{name}/
%endif # with python2
%if %{with python3} %if %{with python3}
%files -n python3-%{name} %files -n python3-%{name}
%{python3_sitearch}/%{name}/ %{python3_sitearch}/%{name}/
%endif # with python3 %endif
%if %{with platform_python}
%files -n platform-python-%{name}
%{platform_python_sitearch}/%{name}/
%endif # with platform_python
%changelog %changelog
* Fri Nov 03 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-8
- Remove platform-python subpackage
* Fri Sep 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-7 * Fri Sep 01 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.1.8-7
- Disable platform python on old releases - Disable platform python on old releases
@ -354,3 +292,4 @@ popd
* Tue Jun 25 2013 Jindrich Luza <jluza@redhat.com> 0.1.1-1 * Tue Jun 25 2013 Jindrich Luza <jluza@redhat.com> 0.1.1-1
- Automatic commit of package [libcomps] release [0.1.1-1]. - Automatic commit of package [libcomps] release [0.1.1-1].