Including documentation into a Windows installer

I'm trying to get a number of files into the binary package which are considered as documentation. For RPMs, I simply do [bdist_rpm] doc_files = ANNOUNCE,CREDITS,LICENCE,README,README.dom,README.pyexpat,README.sgmlop,doc,demo,test Even though some of these names are actually directories, the RPM building process uses the source distribution to determine which files to include. Specifically, these names get listed as %doc directives, which are then installed into /usr/doc/<package>. Since there is no dedicated documentation directory on Windows, I'd like to put these files into a directory xmldoc next to the _xmlplus directory which is the Python package. I managed to compute the list of file names and directories myself using the FileList class. How can I get a set of files into the Windows installer, while preserving the directory structure? Any help appreciated, Martin

> I'm trying to get a number of files into the binary package which are > considered as documentation. > > For RPMs, I simply do > > [bdist_rpm] > doc_files = ANNOUNCE,CREDITS,LICENCE,README,README.dom,README.pyexpat,README.sgmlop,doc,demo,test > > Even though some of these names are actually directories, the RPM > building process uses the source distribution to determine which files > to include. Specifically, these names get listed as %doc directives, > which are then installed into /usr/doc/<package>. > > Since there is no dedicated documentation directory on Windows, I'd > like to put these files into a directory xmldoc next to the _xmlplus > directory which is the Python package. I managed to compute the list > of file names and directories myself using the FileList class. > > How can I get a set of files into the Windows installer, while > preserving the directory structure? The windows installer is similar to the install command. The install command: 1. Runs build to build everything and install it into build\libxxx directory 2. Copies the build\libxxx directory somewhere into the python path. The bdist_wininst command: 1. Runs build to build everything and install it into build\libxxx directory. 2. Build a zip-file from the build\libxxx directory, and append this to the exe-stub to create the windows installer. The windows installer, on the target system: Simply unpacks everything on the python path. So your only choice is to somehow copy your files into the build directory, and you are done. Maybe you need to write a special install_docs class to do this... Thomas

Maybe you need to write a special install_docs class to do this...
Indeed, that is the solution. Rene Liebscher uses an advanced install_data command for PyOpenGL; I incorporated that into PyXML. Still, I'd prefer if distutils had direct support for documentation files, and would always find the right location for them on the different systems. Regards, Martin

> I'm trying to get a number of files into the binary package which are > considered as documentation. > > For RPMs, I simply do > > [bdist_rpm] > doc_files = ANNOUNCE,CREDITS,LICENCE,README,README.dom,README.pyexpat,README.sgmlop,doc,demo,test > > Even though some of these names are actually directories, the RPM > building process uses the source distribution to determine which files > to include. Specifically, these names get listed as %doc directives, > which are then installed into /usr/doc/<package>. > > Since there is no dedicated documentation directory on Windows, I'd > like to put these files into a directory xmldoc next to the _xmlplus > directory which is the Python package. I managed to compute the list > of file names and directories myself using the FileList class. > > How can I get a set of files into the Windows installer, while > preserving the directory structure? The windows installer is similar to the install command. The install command: 1. Runs build to build everything and install it into build\libxxx directory 2. Copies the build\libxxx directory somewhere into the python path. The bdist_wininst command: 1. Runs build to build everything and install it into build\libxxx directory. 2. Build a zip-file from the build\libxxx directory, and append this to the exe-stub to create the windows installer. The windows installer, on the target system: Simply unpacks everything on the python path. So your only choice is to somehow copy your files into the build directory, and you are done. Maybe you need to write a special install_docs class to do this... Thomas

Maybe you need to write a special install_docs class to do this...
Indeed, that is the solution. Rene Liebscher uses an advanced install_data command for PyOpenGL; I incorporated that into PyXML. Still, I'd prefer if distutils had direct support for documentation files, and would always find the right location for them on the different systems. Regards, Martin
participants (3)
-
Martin v. Loewis
-
Paul Prescod
-
Thomas Heller