f6aeafd
This patch makes several changes to setup.py:
f6aeafd
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
- Update version number
f6aeafd
- Convert tabs to spaces (from original RPM)
f6aeafd
  - http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
f6aeafd
f6aeafd
diff -ruN pycxx-6.2.4.orig/setup.py pycxx-6.2.4/setup.py
f6aeafd
--- pycxx-6.2.4.orig/setup.py	2010-05-02 14:10:27.000000000 -0500
f6aeafd
+++ pycxx-6.2.4/setup.py	2012-06-28 03:26:33.000000000 -0500
f6aeafd
@@ -1,35 +1,70 @@
f6aeafd
 import os, sys
f6aeafd
 from glob import glob
f6aeafd
 from distutils.command.install import install
f6aeafd
+from distutils.command.install_headers import install_headers
f6aeafd
 from distutils.core import setup
f6aeafd
 
f6aeafd
-headers = (glob( os.path.join( "CXX","*.hxx" ) )
f6aeafd
-          +glob( os.path.join( "CXX","*.h" ) ))
f6aeafd
-sources = (glob( os.path.join( "Src", "*.cxx" ) )
f6aeafd
-          +glob( os.path.join( "Src", "*.c" ) ))
f6aeafd
+# either "Python2" or "Python3"
f6aeafd
+PythonVer = "Python" + sys.version[0]
f6aeafd
+
f6aeafd
+headers = [
f6aeafd
+    (None,
f6aeafd
+     glob(os.path.join("CXX","*.hxx")) + \
f6aeafd
+         glob(os.path.join("CXX","*.h"))
f6aeafd
+     ),
f6aeafd
+    (PythonVer,
f6aeafd
+     glob(os.path.join("CXX",PythonVer,"*.hxx"))
f6aeafd
+     )
f6aeafd
+    ]
f6aeafd
+
f6aeafd
+sources = [
f6aeafd
+    ("CXX", 
f6aeafd
+     glob(os.path.join("Src", "*.cxx")) + \
f6aeafd
+         glob(os.path.join("Src", "*.c"))
f6aeafd
+     ),
f6aeafd
+    (os.path.join("CXX",PythonVer), 
f6aeafd
+     glob(os.path.join("Src",PythonVer,"*"))
f6aeafd
+     )
f6aeafd
+    ]
f6aeafd
 
f6aeafd
 
f6aeafd
 class my_install (install):
f6aeafd
 
f6aeafd
     def finalize_options (self):
f6aeafd
-	if not self.install_data or (len(self.install_data) < 8) :
f6aeafd
-	    self.install_data = "$base/share/python$py_version_short"
f6aeafd
+        if not self.install_data or (len(self.install_data) < 8):
f6aeafd
+            self.install_data = "$base/share/python$py_version_short"
f6aeafd
         install.finalize_options (self)
f6aeafd
 
f6aeafd
     def run (self):
f6aeafd
-	self.distribution.data_files = [("CXX", sources)]
f6aeafd
-	self.distribution.headers = headers
f6aeafd
+        self.distribution.data_files = sources
f6aeafd
+        self.distribution.headers = headers
f6aeafd
         install.run (self)
f6aeafd
 
f6aeafd
+class my_install_headers (install_headers):
f6aeafd
+    def run (self):
f6aeafd
+        if not self.distribution.headers:
f6aeafd
+            return
f6aeafd
+
f6aeafd
+        for subdir, headers in self.distribution.headers:
f6aeafd
+            try:
f6aeafd
+                dir = os.path.join(self.install_dir,subdir)
f6aeafd
+            except:
f6aeafd
+                dir = self.install_dir
f6aeafd
+            self.mkpath(dir)
f6aeafd
+            for header in headers:
f6aeafd
+                (out, _) = self.copy_file(header, dir)
f6aeafd
+                self.outfiles.append(out)
f6aeafd
+
f6aeafd
 
f6aeafd
 setup (name             = "CXX",
f6aeafd
-       version          = "6.2.0",
f6aeafd
+       version          = "6.2.4",
f6aeafd
        maintainer       = "Barry Scott",
f6aeafd
        maintainer_email = "barry-scott@users.sourceforge.net",
f6aeafd
        description      = "Facility for extending Python with C++",
f6aeafd
        url              = "http://cxx.sourceforge.net",
f6aeafd
        
f6aeafd
-       cmdclass         = {'install': my_install},
f6aeafd
+       cmdclass         = {'install': my_install,
f6aeafd
+                           'install_headers': my_install_headers},
f6aeafd
        packages         = ['CXX'],
f6aeafd
        package_dir      = {'CXX': 'Lib'}
f6aeafd
       )