
from distutils.command.install import *
from distutils.command.install import install as old_install

class install(old_install):

    def finalize_options (self):
        old_install.finalize_options(self)
        self.install_lib = self.install_libbase

@@ -1,28 +1,38 @@
+%0Aimport os
 %0Afrom distutils.command.inst
@@ -104,16 +104,59 @@
 _install
+%0Afrom distutils.file_util import write_file
 %0A%0Aclass 
@@ -254,16 +254,16 @@
 s(self)%0A
-
         
@@ -302,8 +302,818 @@
 libbase%0A
+%0A    def run(self):%0A        r = old_install.run(self)%0A        if self.record:%0A            # bdist_rpm fails when INSTALLED_FILES contains%0A            # paths with spaces. Such paths must be enclosed%0A            # with double-quotes.%0A            f = open(self.record,'r')%0A            lines = %5B%5D%0A            need_rewrite = False%0A            for l in f.readlines():%0A                l = l.rstrip()%0A                if ' ' in l:%0A                    need_rewrite = True%0A                    l = '%22%25s%22' %25 (l)%0A                lines.append(l)%0A            f.close()%0A            if need_rewrite:%0A                self.execute(write_file,%0A                             (self.record, lines),%0A                             %22re-writing list of installed files to '%25s'%22 %25%0A                             self.record)%0A        return r%0A

Fix bdist_rpm for path names containing spaces.