From 68130351af45ac0c896ae739c6c938ef7c769cd9 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Jan 21 2019 18:42:52 +0000 Subject: Update to 7.1.0. --- diff --git a/.gitignore b/.gitignore index f2d0710..feb5e1a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /cxx-code-*-trunk/ /pycxx-7.0.2.tar.gz /pycxx-7.0.3.tar.gz +/pycxx-7.1.0.tar.gz diff --git a/python-pycxx-7.0.3-change-include-paths.patch b/python-pycxx-7.0.3-change-include-paths.patch deleted file mode 100644 index 4bb62d4..0000000 --- a/python-pycxx-7.0.3-change-include-paths.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/Src/cxxextensions.c b/Src/cxxextensions.c -index 28a8e1d..cfab556 100644 ---- a/Src/cxxextensions.c -+++ b/Src/cxxextensions.c -@@ -37,7 +37,7 @@ - #include "CXX/WrapPython.h" - - #if PY_MAJOR_VERSION == 2 --#include "Src/Python2/cxxextensions.c" -+#include "Python2/cxxextensions.c" - #else --#include "Src/Python3/cxxextensions.c" -+#include "Python3/cxxextensions.c" - #endif -diff --git a/Src/cxxsupport.cxx b/Src/cxxsupport.cxx -index 1f2fb43..946e60d 100644 ---- a/Src/cxxsupport.cxx -+++ b/Src/cxxsupport.cxx -@@ -37,7 +37,7 @@ - #include "CXX/WrapPython.h" - - #if PY_MAJOR_VERSION == 2 --#include "Src/Python2/cxxsupport.cxx" -+#include "Python2/cxxsupport.cxx" - #else --#include "Src/Python3/cxxsupport.cxx" -+#include "Python3/cxxsupport.cxx" - #endif diff --git a/python-pycxx-7.0.3-setup.py.patch b/python-pycxx-7.0.3-setup.py.patch deleted file mode 100644 index 9b0d675..0000000 --- a/python-pycxx-7.0.3-setup.py.patch +++ /dev/null @@ -1,85 +0,0 @@ -This patch makes several changes to setup.py: - -- Add omitted headers and sources to install - - Extend install_headers to handle subdirs -- Install only Python v2 or v3 code as appropriate -- Update version number -- Convert tabs to spaces (from original RPM) - - http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces - ---- a/setup.py -+++ b/setup.py -@@ -1,13 +1,31 @@ - import os, sys - from glob import glob - from distutils.command.install import install -+from distutils.command.install_headers import install_headers - from distutils.core import setup - --headers = (glob( os.path.join( "CXX","*.hxx" ) ) -- +glob( os.path.join( "CXX","*.h" ) )) --sources = (glob( os.path.join( "Src", "*.cxx" ) ) -- +glob( os.path.join( "Src", "*.c" ) )) -+# either "Python2" or "Python3" -+PythonVer = "Python" + sys.version[0] - -+headers = [ -+ (None, -+ glob(os.path.join("CXX","*.hxx")) + \ -+ glob(os.path.join("CXX","*.h")) -+ ), -+ (PythonVer, -+ glob(os.path.join("CXX",PythonVer,"*.hxx")) -+ ) -+ ] -+ -+sources = [ -+ ("CXX", -+ glob(os.path.join("Src", "*.cxx")) + \ -+ glob(os.path.join("Src", "*.c")) -+ ), -+ (os.path.join("CXX",PythonVer), -+ glob(os.path.join("Src",PythonVer,"*")) -+ ) -+ ] - - class my_install (install): - -@@ -17,10 +35,26 @@ class my_install (install): - install.finalize_options (self) - - def run (self): -- self.distribution.data_files = [("CXX", sources)] -+ self.distribution.data_files = sources - self.distribution.headers = headers - install.run (self) - -+class my_install_headers (install_headers): -+ def run (self): -+ if not self.distribution.headers: -+ return -+ -+ for subdir, headers in self.distribution.headers: -+ try: -+ dir = os.path.join(self.install_dir,subdir) -+ except: -+ dir = self.install_dir -+ self.mkpath(dir) -+ for header in headers: -+ (out, _) = self.copy_file(header, dir) -+ self.outfiles.append(out) -+ -+ - # read the version from the master file CXX/Version.hxx - v_maj = None - v_min = None -@@ -43,7 +77,8 @@ setup (name = "CXX", - description = "Facility for extending Python with C++", - url = "http://cxx.sourceforge.net", - -- cmdclass = {'install': my_install}, -+ cmdclass = {'install': my_install, -+ 'install_headers': my_install_headers}, - packages = ['CXX'], - package_dir = {'CXX': 'Lib'} - ) diff --git a/python-pycxx-7.1.0-change-include-paths.patch b/python-pycxx-7.1.0-change-include-paths.patch new file mode 100644 index 0000000..4bb62d4 --- /dev/null +++ b/python-pycxx-7.1.0-change-include-paths.patch @@ -0,0 +1,28 @@ +diff --git a/Src/cxxextensions.c b/Src/cxxextensions.c +index 28a8e1d..cfab556 100644 +--- a/Src/cxxextensions.c ++++ b/Src/cxxextensions.c +@@ -37,7 +37,7 @@ + #include "CXX/WrapPython.h" + + #if PY_MAJOR_VERSION == 2 +-#include "Src/Python2/cxxextensions.c" ++#include "Python2/cxxextensions.c" + #else +-#include "Src/Python3/cxxextensions.c" ++#include "Python3/cxxextensions.c" + #endif +diff --git a/Src/cxxsupport.cxx b/Src/cxxsupport.cxx +index 1f2fb43..946e60d 100644 +--- a/Src/cxxsupport.cxx ++++ b/Src/cxxsupport.cxx +@@ -37,7 +37,7 @@ + #include "CXX/WrapPython.h" + + #if PY_MAJOR_VERSION == 2 +-#include "Src/Python2/cxxsupport.cxx" ++#include "Python2/cxxsupport.cxx" + #else +-#include "Src/Python3/cxxsupport.cxx" ++#include "Python3/cxxsupport.cxx" + #endif diff --git a/python-pycxx-7.1.0-setup.py.patch b/python-pycxx-7.1.0-setup.py.patch new file mode 100644 index 0000000..9b0d675 --- /dev/null +++ b/python-pycxx-7.1.0-setup.py.patch @@ -0,0 +1,85 @@ +This patch makes several changes to setup.py: + +- Add omitted headers and sources to install + - Extend install_headers to handle subdirs +- Install only Python v2 or v3 code as appropriate +- Update version number +- Convert tabs to spaces (from original RPM) + - http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces + +--- a/setup.py ++++ b/setup.py +@@ -1,13 +1,31 @@ + import os, sys + from glob import glob + from distutils.command.install import install ++from distutils.command.install_headers import install_headers + from distutils.core import setup + +-headers = (glob( os.path.join( "CXX","*.hxx" ) ) +- +glob( os.path.join( "CXX","*.h" ) )) +-sources = (glob( os.path.join( "Src", "*.cxx" ) ) +- +glob( os.path.join( "Src", "*.c" ) )) ++# either "Python2" or "Python3" ++PythonVer = "Python" + sys.version[0] + ++headers = [ ++ (None, ++ glob(os.path.join("CXX","*.hxx")) + \ ++ glob(os.path.join("CXX","*.h")) ++ ), ++ (PythonVer, ++ glob(os.path.join("CXX",PythonVer,"*.hxx")) ++ ) ++ ] ++ ++sources = [ ++ ("CXX", ++ glob(os.path.join("Src", "*.cxx")) + \ ++ glob(os.path.join("Src", "*.c")) ++ ), ++ (os.path.join("CXX",PythonVer), ++ glob(os.path.join("Src",PythonVer,"*")) ++ ) ++ ] + + class my_install (install): + +@@ -17,10 +35,26 @@ class my_install (install): + install.finalize_options (self) + + def run (self): +- self.distribution.data_files = [("CXX", sources)] ++ self.distribution.data_files = sources + self.distribution.headers = headers + install.run (self) + ++class my_install_headers (install_headers): ++ def run (self): ++ if not self.distribution.headers: ++ return ++ ++ for subdir, headers in self.distribution.headers: ++ try: ++ dir = os.path.join(self.install_dir,subdir) ++ except: ++ dir = self.install_dir ++ self.mkpath(dir) ++ for header in headers: ++ (out, _) = self.copy_file(header, dir) ++ self.outfiles.append(out) ++ ++ + # read the version from the master file CXX/Version.hxx + v_maj = None + v_min = None +@@ -43,7 +77,8 @@ setup (name = "CXX", + description = "Facility for extending Python with C++", + url = "http://cxx.sourceforge.net", + +- cmdclass = {'install': my_install}, ++ cmdclass = {'install': my_install, ++ 'install_headers': my_install_headers}, + packages = ['CXX'], + package_dir = {'CXX': 'Lib'} + ) diff --git a/python-pycxx.spec b/python-pycxx.spec index 10cbd87..093f810 100644 --- a/python-pycxx.spec +++ b/python-pycxx.spec @@ -11,12 +11,8 @@ %global with_python3 %{?_without_python3:0} %{?!_without_python3:1} %endif -%global svn_rev 280 -%global download_date 20130805 -%global vcs_rel %{download_date}svn%{svn_rev} - Name: python-%{modname} -Version: 7.0.3 +Version: 7.1.0 Release: 1%{?dist} Summary: Write Python extensions in C++ @@ -86,15 +82,11 @@ for Python 3. There is no non-devel package needed. %prep -# SVN version .zip file unpacks differently -#setup -q -n cxx-code-%{svn_rev}-trunk/CXX -%setup -q -n %{modname}-%{version} -%patch0 -p1 -b .change-include-paths -%patch1 -p1 -b .setup +%autosetup -p1 -n %{modname}-%{version} %build -python setup.py build +%{py2_build} %install @@ -104,7 +96,7 @@ INSTALL='setup.py install --install-headers=%{_includedir}/CXX --install-data=%{_usrsrc}' -%{__python} $INSTALL +%{__python2} $INSTALL %if %{with_python3} %{__python3} $INSTALL @@ -120,7 +112,7 @@ srcdir=%{_usrsrc}/CXX Name: PyCXX Description: Write Python extensions in C++ -Version: %{version} +Version: 7.1.0 Cflags: -I\${includedir} EOF @@ -161,6 +153,9 @@ test "$(pkg-config --modversion PyCXX)" = "%{version}" %changelog +* Mon Jan 21 2019 Richard Shaw - 7.1.0-1 +- Update to 7.1.0. + * Wed Apr 11 2018 Richard Shaw - 7.0.3-1 - Update to 7.0.3. diff --git a/sources b/sources index 6f40daa..6ba2a9e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pycxx-7.0.3.tar.gz) = 9b6bce80ab5cc12bcacf8e435e043a73f97f843a4eb62c4b8135db912780eef28977beebce9c4f968efa300c60e4e5b293bf22d179e51b5e8b503be5034f3962 +SHA512 (pycxx-7.1.0.tar.gz) = d7d8bdbfb85b9c6b6b3146714b1ebdeef91bdc1456b784825f3d2d3c400123e8d972551c4df93ae5180f8bcd3610327bce39b36d5586fb7611d7802a580f0e3f