Commit 446e3992 authored by Fred Drake's avatar Fred Drake

- "Mac OS" should always include the space

- comment out documentation for a non-existant feature (--spec-file)
  that the comments indicate isn't clearly needed
- lots of minor markup adjustments to get a more consistent
  presentation
parent 34d9ce34
...@@ -295,9 +295,9 @@ platform-neutral representation into whatever is appropriate on your ...@@ -295,9 +295,9 @@ platform-neutral representation into whatever is appropriate on your
current platform before actually using the pathname. This makes your current platform before actually using the pathname. This makes your
setup script portable across operating systems, which of course is one setup script portable across operating systems, which of course is one
of the major goals of the Distutils. In this spirit, all pathnames in of the major goals of the Distutils. In this spirit, all pathnames in
this document are slash-separated. (MacOS programmers should keep in this document are slash-separated. (Mac OS programmers should keep in
mind that the \emph{absence} of a leading slash indicates a relative mind that the \emph{absence} of a leading slash indicates a relative
path, the opposite of the MacOS convention with colons.) path, the opposite of the Mac OS convention with colons.)
This, of course, only applies to pathnames given to Distutils This, of course, only applies to pathnames given to Distutils
functions. If you, for example, use standard Python functions such as functions. If you, for example, use standard Python functions such as
...@@ -964,7 +964,7 @@ python setup.py sdist ...@@ -964,7 +964,7 @@ python setup.py sdist
script or config file), \command{sdist} creates the archive of the script or config file), \command{sdist} creates the archive of the
default format for the current platform. The default format is a gzip'ed default format for the current platform. The default format is a gzip'ed
tar file (\file{.tar.gz}) on \UNIX, and ZIP file on Windows. tar file (\file{.tar.gz}) on \UNIX, and ZIP file on Windows.
\XXX{no MacOS support here} \XXX{no Mac OS support here}
You can specify as many formats as you like using the You can specify as many formats as you like using the
\longprogramopt{formats} option, for example: \longprogramopt{formats} option, for example:
...@@ -974,6 +974,7 @@ python setup.py sdist --formats=gztar,zip ...@@ -974,6 +974,7 @@ python setup.py sdist --formats=gztar,zip
\end{verbatim} \end{verbatim}
to create a gzipped tarball and a zip file. The available formats are: to create a gzipped tarball and a zip file. The available formats are:
\begin{tableiii}{l|l|c}{code}% \begin{tableiii}{l|l|c}{code}%
{Format}{Description}{Notes} {Format}{Description}{Notes}
\lineiii{zip}{zip file (\file{.zip})}{(1),(3)} \lineiii{zip}{zip file (\file{.zip})}{(1),(3)}
...@@ -1007,7 +1008,7 @@ into the source distribution: ...@@ -1007,7 +1008,7 @@ into the source distribution:
\option{packages} options \option{packages} options
\item all C source files mentioned in the \option{ext\_modules} or \item all C source files mentioned in the \option{ext\_modules} or
\option{libraries} options (\XXX{getting C library sources currently \option{libraries} options (\XXX{getting C library sources currently
broken -- no get\_source\_files() method in build\_clib.py!}) broken---no \method{get_source_files()} method in \file{build_clib.py}!})
\item anything that looks like a test script: \file{test/test*.py} \item anything that looks like a test script: \file{test/test*.py}
(currently, the Distutils don't do anything with test scripts except (currently, the Distutils don't do anything with test scripts except
include them in source distributions, but in the future there will be include them in source distributions, but in the future there will be
...@@ -1219,6 +1220,7 @@ would, when run on a \UNIX{} system, create ...@@ -1219,6 +1220,7 @@ would, when run on a \UNIX{} system, create
unpacked from the root directory to install the Distutils. unpacked from the root directory to install the Distutils.
The available formats for built distributions are: The available formats for built distributions are:
\begin{tableiii}{l|l|c}{code}% \begin{tableiii}{l|l|c}{code}%
{Format}{Description}{Notes} {Format}{Description}{Notes}
\lineiii{gztar}{gzipped tar file (\file{.tar.gz})}{(1),(3)} \lineiii{gztar}{gzipped tar file (\file{.tar.gz})}{(1),(3)}
...@@ -1255,6 +1257,7 @@ the ``dumb'' archive formats (\code{tar}, \code{ztar}, \code{gztar}, and ...@@ -1255,6 +1257,7 @@ the ``dumb'' archive formats (\code{tar}, \code{ztar}, \code{gztar}, and
\code{zip}), and \command{bdist\_rpm} generates both binary and source \code{zip}), and \command{bdist\_rpm} generates both binary and source
RPMs. The \command{bdist} sub-commands, and the formats generated by RPMs. The \command{bdist} sub-commands, and the formats generated by
each, are: each, are:
\begin{tableii}{l|l}{command}% \begin{tableii}{l|l}{command}%
{Command}{Formats} {Command}{Formats}
\lineii{bdist\_dumb}{tar, ztar, gztar, zip} \lineii{bdist\_dumb}{tar, ztar, gztar, zip}
...@@ -1314,6 +1317,7 @@ based on the information you supply in the setup script, on the command ...@@ -1314,6 +1317,7 @@ based on the information you supply in the setup script, on the command
line, and in any Distutils configuration files. Various options and line, and in any Distutils configuration files. Various options and
sections in the \file{.spec} file are derived from options in the setup sections in the \file{.spec} file are derived from options in the setup
script as follows: script as follows:
\begin{tableii}{l|l}{textrm}% \begin{tableii}{l|l}{textrm}%
{RPM \file{.spec} file option or section}{Distutils setup script option} {RPM \file{.spec} file option or section}{Distutils setup script option}
\lineii{Name}{\option{name}} \lineii{Name}{\option{name}}
...@@ -1329,6 +1333,7 @@ script as follows: ...@@ -1329,6 +1333,7 @@ script as follows:
Additionally, there many options in \file{.spec} files that don't have Additionally, there many options in \file{.spec} files that don't have
corresponding options in the setup script. Most of these are handled corresponding options in the setup script. Most of these are handled
through options to the \command{bdist\_rpm} command as follows: through options to the \command{bdist\_rpm} command as follows:
\begin{tableiii}{l|l|l}{textrm}% \begin{tableiii}{l|l|l}{textrm}%
{RPM \file{.spec} file option or section}% {RPM \file{.spec} file option or section}%
{\command{bdist\_rpm} option}% {\command{bdist\_rpm} option}%
...@@ -1345,6 +1350,7 @@ through options to the \command{bdist\_rpm} command as follows: ...@@ -1345,6 +1350,7 @@ through options to the \command{bdist\_rpm} command as follows:
\lineiii{BuildRequires}{\option{build\_requires}}{(none)} \lineiii{BuildRequires}{\option{build\_requires}}{(none)}
\lineiii{Icon}{\option{icon}}{(none)} \lineiii{Icon}{\option{icon}}{(none)}
\end{tableiii} \end{tableiii}
Obviously, supplying even a few of these options on the command-line Obviously, supplying even a few of these options on the command-line
would be tedious and error-prone, so it's usually best to put them in would be tedious and error-prone, so it's usually best to put them in
the setup configuration file, \file{setup.cfg}---see the setup configuration file, \file{setup.cfg}---see
...@@ -1355,6 +1361,7 @@ them in your personal Distutils configuration file ...@@ -1355,6 +1361,7 @@ them in your personal Distutils configuration file
There are three steps to building a binary RPM package, all of which are There are three steps to building a binary RPM package, all of which are
handled automatically by the Distutils: handled automatically by the Distutils:
\begin{enumerate} \begin{enumerate}
\item create a \file{.spec} file, which describes the package (analogous \item create a \file{.spec} file, which describes the package (analogous
to the Distutils setup script; in fact, much of the information in the to the Distutils setup script; in fact, much of the information in the
...@@ -1364,32 +1371,33 @@ handled automatically by the Distutils: ...@@ -1364,32 +1371,33 @@ handled automatically by the Distutils:
code, depending on whether your module distribution contains Python code, depending on whether your module distribution contains Python
extensions) extensions)
\end{enumerate} \end{enumerate}
Normally, RPM bundles the last two steps together; when you use the Normally, RPM bundles the last two steps together; when you use the
Distutils, all three steps are typically bundled together. Distutils, all three steps are typically bundled together.
If you wish, you can separate these three steps. You can use the If you wish, you can separate these three steps. You can use the
\longprogramopt{spec-only} option to make \command{bdist\_rpm} just \longprogramopt{spec-only} option to make \command{bdist_rpm} just
create the \file{.spec} file and exit; in this case, the \file{.spec} create the \file{.spec} file and exit; in this case, the \file{.spec}
file will be written to the ``distribution directory''---normally file will be written to the ``distribution directory''---normally
\file{dist/}, but customizable with the \longprogramopt{dist-dir} \file{dist/}, but customizable with the \longprogramopt{dist-dir}
option. (Normally, the \file{.spec} file winds up deep in the ``build option. (Normally, the \file{.spec} file winds up deep in the ``build
tree,'' in a temporary directory created by \command{bdist\_rpm}.) tree,'' in a temporary directory created by \command{bdist_rpm}.)
\XXX{this isn't implemented yet---is it needed?!} % \XXX{this isn't implemented yet---is it needed?!}
You can also specify a custom \file{.spec} file with the % You can also specify a custom \file{.spec} file with the
\longprogramopt{spec-file} option; used in conjunction with % \longprogramopt{spec-file} option; used in conjunction with
\longprogramopt{spec-only}, this gives you an opportunity to customize % \longprogramopt{spec-only}, this gives you an opportunity to customize
the \file{.spec} file manually: % the \file{.spec} file manually:
%
\begin{verbatim} % \begin{verbatim}
> python setup.py bdist_rpm --spec-only % > python setup.py bdist_rpm --spec-only
# ...edit dist/FooBar-1.0.spec % # ...edit dist/FooBar-1.0.spec
> python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec % > python setup.py bdist_rpm --spec-file=dist/FooBar-1.0.spec
\end{verbatim} % \end{verbatim}
%
(Although a better way to do this is probably to override the standard % (Although a better way to do this is probably to override the standard
\command{bdist\_rpm} command with one that writes whatever else you want % \command{bdist\_rpm} command with one that writes whatever else you want
to the \file{.spec} file.) % to the \file{.spec} file.)
\subsection{Creating Windows Installers} \subsection{Creating Windows Installers}
...@@ -1859,6 +1867,7 @@ This command installs all (Python) scripts in the distribution. ...@@ -1859,6 +1867,7 @@ This command installs all (Python) scripts in the distribution.
\XXX{fragment moved down from above: needs context!} \XXX{fragment moved down from above: needs context!}
The manifest template commands are: The manifest template commands are:
\begin{tableii}{ll}{command}{Command}{Description} \begin{tableii}{ll}{command}{Command}{Description}
\lineii{include \var{pat1} \var{pat2} ... } \lineii{include \var{pat1} \var{pat2} ... }
{include all files matching any of the listed patterns} {include all files matching any of the listed patterns}
...@@ -1877,15 +1886,16 @@ The manifest template commands are: ...@@ -1877,15 +1886,16 @@ The manifest template commands are:
\lineii{prune \var{dir}}{exclude all files under \var{dir}} \lineii{prune \var{dir}}{exclude all files under \var{dir}}
\lineii{graft \var{dir}}{include all files under \var{dir}} \lineii{graft \var{dir}}{include all files under \var{dir}}
\end{tableii} \end{tableii}
The patterns here are \UNIX-style ``glob'' patterns: \code{*} matches any The patterns here are \UNIX-style ``glob'' patterns: \code{*} matches any
sequence of regular filename characters, \code{?} matches any single sequence of regular filename characters, \code{?} matches any single
regular filename character, and \code{[\var{range}]} matches any of the regular filename character, and \code{[\var{range}]} matches any of the
characters in \var{range} (e.g., \code{a-z}, \code{a-zA-Z}, characters in \var{range} (e.g., \code{a-z}, \code{a-zA-Z},
\code{a-f0-9\_.}). The definition of ``regular filename character'' is \code{a-f0-9\_.}). The definition of ``regular filename character'' is
platform-specific: on \UNIX{} it is anything except slash; on Windows platform-specific: on \UNIX{} it is anything except slash; on Windows
anything except backslash or colon; on MacOS anything except colon. anything except backslash or colon; on Mac OS anything except colon.
\XXX{Windows and MacOS support not there yet} \XXX{Windows and Mac OS support not there yet}
%\subsection{Creating a built distribution: the %\subsection{Creating a built distribution: the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment