Skip to content

Commit

Permalink
Use main conf.py for NOTICE
Browse files Browse the repository at this point in the history
Generate the NOTICE file using the main conf.py, by using a special
tag when invoking sphinx-build.

While here, add notice.txt to the list of files removed by make clean.

(cherry picked from commit 3f7aebe)

ticket: 7433
  • Loading branch information
tlyu committed Nov 16, 2012
1 parent 8d290c2 commit f8ba994
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 115 deletions.
31 changes: 21 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
if 'notice' in tags:
master_doc = 'notice'
else:
master_doc = 'index'

# General information about the project.
project = u'MIT Kerberos'
Expand Down Expand Up @@ -238,19 +241,27 @@
ckeytab = ':ref:`DEFCKTNAME <paths>`'

rst_epilog = '\n'
rst_epilog += '.. |bindir| replace:: %s\n' % bindir
rst_epilog += '.. |sbindir| replace:: %s\n' % sbindir
rst_epilog += '.. |libdir| replace:: %s\n' % libdir
rst_epilog += '.. |kdcdir| replace:: %s\\ ``/krb5kdc``\n' % localstatedir
rst_epilog += '.. |sysconfdir| replace:: %s\n' % sysconfdir
rst_epilog += '.. |ccache| replace:: %s\n' % ccache
rst_epilog += '.. |keytab| replace:: %s\n' % keytab
rst_epilog += '.. |ckeytab| replace:: %s\n' % ckeytab
rst_epilog += '''

if 'notice' in tags:
exclude_patterns = [ 'admins', 'appldev', 'basic', 'build',
'plugindev', 'relay', 'users' ]
exclude_patterns += [ 'index.rst', 'mitK5*.rst', 'resources.rst' ]
rst_epilog += '.. |copy| replace:: \(C\)'
else:
rst_epilog += '.. |bindir| replace:: %s\n' % bindir
rst_epilog += '.. |sbindir| replace:: %s\n' % sbindir
rst_epilog += '.. |libdir| replace:: %s\n' % libdir
rst_epilog += '.. |kdcdir| replace:: %s\\ ``/krb5kdc``\n' % localstatedir
rst_epilog += '.. |sysconfdir| replace:: %s\n' % sysconfdir
rst_epilog += '.. |ccache| replace:: %s\n' % ccache
rst_epilog += '.. |keytab| replace:: %s\n' % keytab
rst_epilog += '.. |ckeytab| replace:: %s\n' % ckeytab
rst_epilog += '''
.. |krb5conf| replace:: ``/etc/krb5.conf``
.. |defkeysalts| replace:: ``aes256-cts-hmac-sha1-96:normal aes128-cts-hmac-sha1-96:normal des3-cbc-sha1:normal arcfour-hmac-md5:normal``
.. |defetypes| replace:: ``aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 des3-cbc-sha1 arcfour-hmac-md5 des-cbc-crc des-cbc-md5 des-cbc-md4``
.. |defmkey| replace:: ``aes256-cts-hmac-sha1-96``
.. |copy| unicode:: U+000A9
'''

# -- Options for manual page output --------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions doc/notice.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. include:: <isonum.txt>

Copyright |copy| 1985-2012 by the Massachusetts Institute of Technology.

All rights reserved.
Expand Down
88 changes: 0 additions & 88 deletions doc/txt_conf.py

This file was deleted.

19 changes: 4 additions & 15 deletions src/doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ RST_SOURCES= _static \
mitK5license.rst \
notice.rst \
relay \
resources.rst \
txt_conf.py
resources.rst

# Create HTML documentation in $(docsrc)/html suitable for a
# release tarball or the web site (that is, without substitutions for
Expand All @@ -48,8 +47,8 @@ substhtml: composite paths.py
$(SPHINX_BUILD) -t pathsubs -q rst_composite html_subst

# Create an ASCII (okay, UTF-8) version of the NOTICE file
notice.txt: rst_notice
$(SPHINX_BUILD) -b text -q rst_notice .
notice.txt: $(docsrc)/conf.py $(docsrc)/notice.rst
$(SPHINX_BUILD) -b text -t notice -q $(docsrc) .

NOTICE: notice.txt
cp notice.txt $(top_srcdir)/../NOTICE
Expand All @@ -72,16 +71,6 @@ composite: Doxyfile $(docsrc)/version.py
cp rst_apiref/macros/*.rst rst_composite/appldev/refs/macros
cp $(docsrc)/version.py rst_composite

# Must use a separate source dir for sphinx text builds, since the text
# engine cannot handle the row spanning cells in fancy tables that we use
rst_notice: $(docsrc)/notice.rst $(docsrc)/txt_conf.py $(docsrc)/version.py
mkdir -p rst_notice
# reST needs backslashes before parens in this macro definition.
sed -e 's/include:: <isonum.txt>/|copy| replace:: \\(C\\)/' \
< $(docsrc)/notice.rst > rst_notice/notice.rst
cp $(docsrc)/txt_conf.py rst_notice/conf.py
cp $(docsrc)/version.py rst_notice

Doxyfile: $(srcdir)/Doxyfile.in
sed -e 's|@SRC@|$(top_srcdir)|g' \
-e 's|@DOC@|$(top_srcdir)/../doc|g' $(srcdir)/Doxyfile.in > $@
Expand All @@ -106,4 +95,4 @@ $(docsrc)/version.py: $(top_srcdir)/patchlevel.h $(srcdir)/version.py.in

clean::
rm -rf doxy rst_apiref rst_composite rst_notice html_subst \
Doxyfile paths.py $(docsrc)/version.py
Doxyfile paths.py $(docsrc)/version.py notice.txt

0 comments on commit f8ba994

Please sign in to comment.