f6aeafd
%global modname pycxx
f6aeafd
ca38e20
# Specify '--without=python3' to NOT build the python 3 RPM
778da73
%if 0%{?rhel} && 0%{?rhel} <= 7
ca38e20
# el6 has no python3 packages
ca38e20
%global with_python3 0
ca38e20
%else
ca38e20
%global with_python3 %{?_without_python3:0} %{?!_without_python3:1}
ca38e20
%endif
f6aeafd
f6aeafd
Name:           python-%{modname}
76607dc
Version:        7.1.3
197c3d0
Release:        1%{?dist}
f6aeafd
Summary:        Write Python extensions in C++
f6aeafd
f6aeafd
License:        BSD
f6aeafd
URL:            http://CXX.sourceforge.net/
f6aeafd
f6aeafd
BuildArch:      noarch
f6aeafd
005dac8
Source0:        http://downloads.sourceforge.net/cxx/%{modname}-%{version}.tar.gz
f6aeafd
# Patch0:  remove unnecessary 'Src/' directory from include path in sources
f6aeafd
Patch0:         %{name}-%{version}-change-include-paths.patch
f6aeafd
f6aeafd
BuildRequires:  python2-devel
ca38e20
%if %{with_python3}
f6aeafd
BuildRequires:  python3-devel
f6aeafd
%endif
f6aeafd
724ffc6
%global _description\
724ffc6
PyCXX is a set of classes to help create extensions of Python in the\
724ffc6
C++ language. The first part encapsulates the Python C API taking care\
724ffc6
of exceptions and ref counting. The second part supports the building\
f6aeafd
of Python extension modules in C++.
f6aeafd
724ffc6
%description %_description
724ffc6
724ffc6
%package -n python2-%{modname}-devel
724ffc6
Summary: %summary
724ffc6
%{?python_provide:%python_provide python2-%{modname}-devel}
724ffc6
724ffc6
%description -n python2-%{modname}-devel %_description
f6aeafd
f6aeafd
%package devel
f6aeafd
Summary:        PyCXX header and source files
f6aeafd
Requires:       python2
f6aeafd
f6aeafd
%description devel
f6aeafd
PyCXX is a set of classes to help create extensions of Python in the
f6aeafd
C++ language. The first part encapsulates the Python C API taking care
f6aeafd
of exceptions and ref counting. The second part supports the building
f6aeafd
of Python extension modules in C++.
f6aeafd
f6aeafd
The %{name}-devel package provides the header and source files
f6aeafd
for Python 2.  There is no non-devel package needed.
f6aeafd
f6aeafd
f6aeafd
%package -n python3-%{modname}-devel
f6aeafd
Summary:        PyCXX header and source files
f6aeafd
Requires:       python3
f6aeafd
f6aeafd
%description -n python3-%{modname}-devel
f6aeafd
PyCXX is a set of classes to help create extensions of Python in the
f6aeafd
C++ language. The first part encapsulates the Python C API taking care
f6aeafd
of exceptions and ref counting. The second part supports the building
f6aeafd
of Python extension modules in C++.
f6aeafd
f6aeafd
The python3-%{modname}-devel package provides the header and source files
f6aeafd
for Python 3.  There is no non-devel package needed.
f6aeafd
f6aeafd
f6aeafd
%prep
6813035
%autosetup -p1 -n %{modname}-%{version}
f6aeafd
f6aeafd
f6aeafd
%build
edd96e8
# Nothing to build.
f6aeafd
f6aeafd
f6aeafd
%install
edd96e8
%global py_install_args --prefix=/usr --install-headers=/usr/include/CXX --install-data=/usr/src
edd96e8
%py2_install -- %{py_install_args}
f6aeafd
ca38e20
%if %{with_python3}
edd96e8
%py3_install -- %{py_install_args}
f6aeafd
%endif
f6aeafd
f6aeafd
# Write pkg-config PyCXX.pc file
f6aeafd
mkdir -p %{buildroot}%{_datadir}/pkgconfig
f6aeafd
cat > %{buildroot}%{_datadir}/pkgconfig/PyCXX.pc <
f6aeafd
prefix=%{_prefix}
f6aeafd
exec_prefix=%{_prefix}
f6aeafd
includedir=%{_includedir}
f6aeafd
srcdir=%{_usrsrc}/CXX
f6aeafd
f6aeafd
Name: PyCXX
f6aeafd
Description: Write Python extensions in C++
76607dc
Version: %{version}
f6aeafd
Cflags: -I\${includedir}
f6aeafd
EOF
f6aeafd
f6aeafd
edd96e8
%check
edd96e8
export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig
edd96e8
test "$(pkg-config --modversion PyCXX)" = "%{version}"
edd96e8
edd96e8
724ffc6
%files -n python2-%{modname}-devel
f6aeafd
%doc README.html COPYRIGHT Doc/Python2/ 
f6aeafd
%dir %{_includedir}/CXX
f6aeafd
%{_includedir}/CXX/*.hxx
f6aeafd
%{_includedir}/CXX/*.h
f6aeafd
%{_includedir}/CXX/Python2
4f390aa
%{python2_sitelib}/CXX*
f6aeafd
%dir %{_usrsrc}/CXX
f6aeafd
%{_usrsrc}/CXX/*.cxx
f6aeafd
%{_usrsrc}/CXX/*.c
f6aeafd
%{_usrsrc}/CXX/Python2
f6aeafd
%{_datadir}/pkgconfig/PyCXX.pc
f6aeafd
f6aeafd
ca38e20
%if %{with_python3}
f6aeafd
%files -n python3-%{modname}-devel
f6aeafd
%doc README.html COPYRIGHT Doc/Python3/ 
f6aeafd
%dir %{_includedir}/CXX
f6aeafd
%{_includedir}/CXX/*.hxx
f6aeafd
%{_includedir}/CXX/*.h
f6aeafd
%{_includedir}/CXX/Python3
f6aeafd
%{python3_sitelib}/CXX*
f6aeafd
%dir %{_usrsrc}/CXX
f6aeafd
%{_usrsrc}/CXX/*.cxx
f6aeafd
%{_usrsrc}/CXX/*.c
f6aeafd
%{_usrsrc}/CXX/Python3
f6aeafd
%{_datadir}/pkgconfig/PyCXX.pc
f6aeafd
%endif
f6aeafd
f6aeafd
f6aeafd
%changelog
76607dc
* Mon Jul 08 2019 Barry Scott <barry@barrys-emacs.org> - 7.1.3-1
76607dc
- Update to 7.1.3 which includes mempry leak fix in
76607dc
  python 3 Py::String
76607dc
93c7b58
* Mon Mar 04 2019 Barry Scott <barry@barrys-emacs.org> - 7.1.2-1
93c7b58
- Update to 7.1.2 which includes the setup.py patches
93c7b58
  and the fix for _Py_PackageContext compile error
93c7b58
22eba4a
* Mon Feb 18 2019 Richard Shaw <hobbes1069@gmail.com> - 7.1.1-1
22eba4a
- Update to 7.1.1.
edd96e8
- Clean up python install to be more guidelines compliant.
edd96e8
- Remove gcc-c++ from build requirements as this is a noarch package.
22eba4a
93c7b58
0a29db0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 7.1.0-2
0a29db0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0a29db0
6813035
* Mon Jan 21 2019 Richard Shaw <hobbes1069@gmail.com> - 7.1.0-1
6813035
- Update to 7.1.0.
6813035
7bb62a6
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.3-4
7bb62a6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
7bb62a6
74daf1e
* Fri Jun 29 2018 Miro Hrončok <mhroncok@redhat.com> - 7.0.3-3
74daf1e
- Add Python 3.7 patch to add const
74daf1e
- Invoke python2 with python2, not python
74daf1e
0c8ddf9
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 7.0.3-2
0c8ddf9
- Rebuilt for Python 3.7
0c8ddf9
25e6432
* Wed Apr 11 2018 Richard Shaw <hobbes1069@gmail.com> - 7.0.3-1
25e6432
- Update to 7.0.3.
25e6432
197c3d0
* Wed Apr 11 2018 Richard Shaw <hobbes1069@gmail.com> - 7.0.2-1
197c3d0
- Update to 7.0.2.
197c3d0
fd14fb5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.8-7
fd14fb5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
fd14fb5
724ffc6
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 6.2.8-6
724ffc6
- Python 2 binary package renamed to python2-pycxx
724ffc6
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
724ffc6
e544729
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.8-5
e544729
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e544729
713b812
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.8-4
713b812
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
713b812
2d73aec
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 6.2.8-3
2d73aec
- Rebuild for Python 3.6
2d73aec
e1e36b9
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.8-2
e1e36b9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e1e36b9
005dac8
* Mon May 16 2016 Richard Shaw <hobbes1069@gmail.com> - 6.2.8-1
005dac8
- Update to latest upstream release.
005dac8
eeb0a8e
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.4-12.20130805svn280
eeb0a8e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
eeb0a8e
3735771
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-11.20130805svn280
3735771
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3735771
02a8c71
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-10.20130805svn280
02a8c71
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
02a8c71
2c50454
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-9.20130805svn280
2c50454
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2c50454
923f74d
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 6.2.4-8.20130805svn280
923f74d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
923f74d
7ffdb3c
* Mon Aug  5 2013 John Morris <john@zultron.com> - 6.2.4-7.280svn20130805
7ffdb3c
- Update to SVN r280 for python3 compatibility
7ffdb3c
- Update python-pycxx-6.2.4-setup.py.patch to apply correctly
7ffdb3c
- Fix %%setup for SVN zipball
7ffdb3c
- Add diff extensions to %%patch macros
ca38e20
- Enable python3 pkg by default except for EPEL; see BZ 991342
7ffdb3c
9288d5b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-6
9288d5b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
9288d5b
0410857
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-5
0410857
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
0410857
35c4632
* Tue Oct 16 2012 John Morris <john@zultron.com> - 6.2.4-4
35c4632
- Minor macro fixes for compiling on el6
35c4632
1d31232
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.4-3
1d31232
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
1d31232
f6aeafd
* Fri Jun 29 2012  <john@zultron.com> - 6.2.4-2
f6aeafd
- Fix Source0 URL
f6aeafd
f6aeafd
* Thu Jun 28 2012  <john@zultron.com> - 6.2.4-1
f6aeafd
- Install headers into /usr/include/CXX instead of default
f6aeafd
  /usr/include/python2.7/CXX (setup.py command line option)
f6aeafd
- Install sources into /usr/src/CXX rather than /usr/share/python2.7/CXX
f6aeafd
- setup.py patch:
f6aeafd
  - Update PyCXX version number
f6aeafd
  - Convert tabs to spaces (from original patch)
f6aeafd
  - Add omitted headers and sources to install
f6aeafd
    - Extend install_headers to handle subdirs
f6aeafd
  - Install only Python v2 or v3 code as appropriate
f6aeafd
- Add --with=python3 option to build python3-pycxx-devel RPM
f6aeafd
f6aeafd
* Wed Jun 27 2012  <john@zultron.com> - 6.2.4-0
f6aeafd
- Add a pkg-config PyCXX.pc file
f6aeafd
- Update to 6.2.4
f6aeafd
- Build only a -devel package; no regular package needed
f6aeafd
- Beautify specfile, fix macros
f6aeafd
f6aeafd
* Thu Mar 29 2012  <jman@greaser.zultron.com> - 6.2.3-2
f6aeafd
- rebuild with koji
f6aeafd
f6aeafd
* Wed Feb 22 2012 John Morris <john@zultron.com> - 6.2.3-1
f6aeafd
- update to compile on el5 as well as fc16 (missing python_sitelib macro)
f6aeafd
f6aeafd
* Tue Feb 21 2012  <jman@greaser.zultron.com> - 6.2.3-1
f6aeafd
- changed python_sitearch to python_sitelib in files section, 
f6aeafd
  since package installs in /usr/lib even on x86_64
f6aeafd
f6aeafd
* Tue Nov 03 2009 Steve Huff <shuff@vecna.org> - 6.1.1-1 - 7987/shuff
f6aeafd
- Renamed per RPMforge naming convention.
f6aeafd
f6aeafd
* Thu Oct 08 2009 Steve Huff <shuff@vecna.org> - 6.1.1-1
f6aeafd
- Initial package.
f6aeafd