pyconfigure

(Brandon Invergo)
2012-11-25: update manual to mention setup.py.in and PKG-INFO.in

update manual to mention setup.py.in and PKG-INFO.in

diff --git a/doc/pyconfigure.texi b/doc/pyconfigure.texi
--- a/doc/pyconfigure.texi
+++ b/doc/pyconfigure.texi
@@ -37,6 +37,7 @@ Documentation License.''
 @insertcopying
 @end titlepage
 
+@c *******************************************************************
 @contents
 
 @ifnottex
@@ -74,6 +75,7 @@ Appendix
 @end detailmenu
 @end menu
 
+@c *******************************************************************
 @node Introduction, Using pyconfigure, Top, Top
 @chapter Introduction
 
@@ -105,6 +107,7 @@ power of Autoconf for compiled languages
 * Configuring Python packages::
 @end menu
 
+@c *******************************************************************
 @node Configuring Python packages, , Introduction, Introduction
 @section Configuring Python packages
 
@@ -157,6 +160,8 @@ However, as the developer is expected to
 final @file{configure} script may take many more arguments. The
 developer is expected to provide proper documentation in this case.
 
+
+@c *******************************************************************
 @node Using pyconfigure, Appendix, Introduction, Top
 @chapter Using pyconfigure
 
@@ -172,6 +177,27 @@ provided them by the user. When the user
 uses @file{Makefile.in} as a template to create the Make recipe
 @file{Makefile}.
 
+There are some minimum modifications that should be made. In
+@file{configure.ac} you will see a macro called @code{AC_INIT}. You
+should enter your project's name as the first argument to this macro,
+its current version as the second argument and, optionally, an email
+address in the third argument. These three values are used extensively
+in the files modified by the configure script, so it is important that
+you modify them. 
+
+You will probably also want to provide package metadata, which will be
+used by Python packaging-related tools. You can do that in two files:
+@file{PKG-INFO.in} and @file{setup.py.in}. @file{setup.py.in} provides
+a skeleton @file{setup.py} which should be sufficient for most
+packages. @file{PKG-INFO} is a file used in Python packaging to
+express package metadata and must be included in any source
+distribution of a package. You may also use it to register a project
+on PyPI (the Python Package Index; http://pypi.python.org). In both
+@file{PKG-INFO.in} and @file{setup.py.in}, you can see that some
+values will be automatically filled in by @file{configure}. You should
+fill in the rest yourself. See the Python distutils documentation for
+more information.
+
 Several Autoconf macros are provided in the pyconfigure file
 @file{src/m4/python.m4} to allow the developer to write robust tests
 @xref{Autoconf macros}. Note that when you distribute your software,
@@ -184,8 +210,8 @@ regenerate your @file{configure} script 
 $ autoreconf -fvi
 @end example
 
-A full explanation of the use of Autoconf macros is beyond the scope
-of this document, however it is worth presenting some examples.
+A full explanation of the general use of Autoconf macros is beyond the
+scope of this document, however it is worth presenting some examples.
 
 @menu
 * Required macros::
@@ -195,6 +221,7 @@ of this document, however it is worth pr
 * Using Sphinxbuild to build documentation::
 @end menu
 
+@c *******************************************************************
 @node Required macros, Verifying the Python version, Using pyconfigure, Using pyconfigure
 @section Required macros
 
@@ -241,6 +268,8 @@ installed (i.e. @file{/usr/lib/python2.7
 them in the variables @code{pkgpythondir} and @code{pkgpyexecdir},
 respectively, for use in @file{Makefile.in}
 
+
+@c *******************************************************************
 @node Verifying the Python version, Checking for a module or function, Required macros, Using pyconfigure
 @section Verifying the Python version
 
@@ -272,21 +301,14 @@ slightly less straight-forward, but one 
 follows:
 
 @example
-PC_PYTHON_VERIFY_VERSION([$PYTHON], 3.0,
-                          py3k=true,
-                          py3k=false)
-# If a Python 3 interpreter was found, look specifically for a Python 2 one
-if test "$py3k" = "true" ; then
-   m4_define_default([_PYTHON2_BINS], [python2 python2.7 python2.6])
-   AC_PATH_PROGS(PYTHON, [_PYTHON2_BINS])				 
-else
-# otherwise check that the Python 2 version is sufficient
-   PC_PYTHON_VERIFY_VERSION([$PYTHON], python_min_ver, ,
-                            [AC_MSG_ERROR(Python interpreter too old)])
+AC_PROG_PYTHON([python2])
+if [[ "x$PYTHON" == "x" ]]; then
+   AC_PROG_PYTHON
+   PC_PYTHON_VERIFY_VERSION(3.0, ,
+	AC_MSG_ERROR(Python 2 (python_min_ver+) is required))
 fi
-if test -z "$PYTHON"; then
-   AC_MSG_ERROR(No Python 2 interpreter found)
-fi
+PC_PYTHON_VERIFY_VERSION(python_min_ver, ,
+	AC_MSG_ERROR(Python 2 (python_min_ver+) is required))
 @end example
 
 We first check to see if Python is version 3.0 or greater. If it is,
@@ -297,6 +319,8 @@ otherwise @file{configure} will halt wit
 appropriate interpreter was found, an error message will be printed
 and @file{configure} will stop.
 
+
+@c *******************************************************************
 @node Checking for a module or function, Writing test programs, Verifying the Python version, Using pyconfigure
 @section Checking for a module or function
 
@@ -334,6 +358,8 @@ macro:
 PC_PYTHON_CHECK_FUNC([foo], [bar])
 @end example
 
+
+@c *******************************************************************
 @node Writing test programs, Using Sphinxbuild to build documentation, Checking for a module or function, Using pyconfigure
 @section Writing test programs
 
@@ -386,6 +412,8 @@ ifneq ($(SPHINXBUILD),no)
 endif
 @end example
 
+
+@c *******************************************************************
 @node Appendix, GNU Free Documentation License, Using pyconfigure, Top
 @chapter Appendix
 
@@ -393,6 +421,8 @@ endif
 * Autoconf macros::
 @end menu
 
+
+@c *******************************************************************
 @node Autoconf macros, , , Appendix
 @section Autoconf macros