File python-CXX.spec of Package python-CXX
#
# spec file for package python-CXX
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
%bcond_with test
Name: python-CXX
Version: 7.0.3
Release: 0
Summary: Write Python extensions in C++
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://CXX.sourceforge.net/
Source0: pycxx-%{version}.tar.gz
Source99: python-CXX-rpmlintrc
Patch0: python-CXX-6.2.3-change-include-paths.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%ifpython2
Obsoletes: %{oldpython}-cxx < %{version}
Provides: %{oldpython}-cxx = %{version}
%endif
%ifpython3
Obsoletes: python3-cxx < %{version}
Provides: python3-cxx = %{version}
%endif
BuildArch: noarch
%python_subpackages
%description
PyCXX is a set of classes to help create extensions of Python in the C
language. The first part encapsulates the Python C API taking care of
exceptions and ref counting. The second part supports the building of Python
extension modules in C++.
%package devel
Summary: Development files for %{name}
Group: Development/Languages/Python
Requires: %{name} = %{version}
%ifpython2
Obsoletes: %{oldpython}-cxx-devel < %{version}
Provides: %{oldpython}-cxx-devel = %{version}
%endif
%ifpython3
Obsoletes: python3-cxx-devel < %{version}
Provides: python3-cxx-devel = %{version}
%endif
%description devel
Header files and documentation for %{name} development.
%prep
%setup -q -n pycxx-%{version}
%patch0 -p1
%build
%python_build
%install
%python_install
%{python_expand %fdupes %{buildroot}%{$python_sitelib}
CURPY=`echo "%{$python_version}" | head -c 1`
INCDIR=%{$python_sysconfig_path include}
mkdir -p %{buildroot}/%{_datadir}/python%{$python_bin_suffix}/CXX/Python${CURPY}/
mkdir -p %{buildroot}/${INCDIR}/CXX/Python${CURPY}/
install -m 644 Src/*.* %{buildroot}/%{_datadir}/python%{$python_bin_suffix}/CXX/
install -m 644 CXX/*.* %{buildroot}/${INCDIR}/CXX/
install -m 644 Src/Python${CURPY}/*.* %{buildroot}/%{_datadir}/python%{$python_bin_suffix}/CXX/Python${CURPY}/
install -m 644 CXX/Python${CURPY}/*.* %{buildroot}/${INCDIR}/CXX/Python${CURPY}/
%fdupes %{buildroot}/%{_datadir}/python%{$python_bin_suffix}
%fdupes %{buildroot}/${INCDIR}/
}
%if %{with test}
%check
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root)
%doc README.html COPYRIGHT
%{python_sitelib}/CXX/
%{python_sitelib}/CXX-%{version}-py*.egg-info
%files %{python_files devel}
%defattr(-,root,root)
%python2_only %doc Doc/Python2/
%python2_only %doc Doc/Python3/
%python3_only %doc Demo/Python2/
%python3_only %doc Demo/Python3/
%dir %{_datadir}/python%{python_bin_suffix}
%dir %{_includedir}/python%{python_bin_suffix}*
%{_datadir}/python%{python_bin_suffix}/CXX/
%{_includedir}/python%{python_bin_suffix}*/CXX/
%changelog