Ticket #10823: trac-10823-doc.patch

File trac-10823-doc.patch, 3.3 KB (added by jason, 8 years ago)
  • doc/en/developer/producing_spkgs.rst

    # HG changeset patch
    # User Jason Grout <jason.grout@drake.edu>
    # Date 1298425582 21600
    # Node ID 6bb336f62bf12e41244c917efbcb22b04da2a7d1
    # Parent  b36b2cd0d322cd5c5b4f6642857158e899d310df
    #10823: Add SAGE_SPKG_INSTALL_DOCS support to build and install docs in $SAGE_ROOT/local/share/doc/
    
    diff -r b36b2cd0d322 -r 6bb336f62bf1 doc/en/developer/producing_spkgs.rst
    a b  
    184184
    185185       #!/usr/bin/env bash
    186186
    187        if [ "$SAGE_LOCAL" = "" ]; then
    188           echo "SAGE_LOCAL undefined ... exiting";
     187       if [ "x$SAGE_LOCAL" = x ]; then
     188          echo "SAGE_LOCAL undefined ... exiting"
    189189          echo "Maybe run 'sage -sh'?"
    190190          exit 1
    191191       fi
     
    198198          exit 1
    199199       fi
    200200
    201        make
     201       $MAKE
    202202       if [ $? -ne 0 ]; then
    203203          echo "Error building PACKAGE_NAME."
    204204          exit 1
    205205       fi
    206206
    207        make install
     207       $MAKE install
    208208       if [ $? -ne 0 ]; then
    209209          echo "Error installing PACKAGE_NAME."
    210210          exit 1
    211211       fi
    212212
     213       if [ "x$SAGE_SPKG_INSTALL_DOCS" = xyes ] ; then
     214          # Before trying to build the documentation, check if any
     215          # needed programs are present. In the example below, we
     216          # check for 'latex', but this will depend on the package.
     217          # Some packages may need no extra tools installed, others
     218          # may require some.  We use 'command -v' for testing this,
     219          # and not 'which' since 'which' is not portable, whereas
     220          # 'command -v' is defined by POSIX.
     221
     222          # if [ `command -v latex` ] ; then
     223          #    echo "Good, latex was found, so building the documentation"
     224          # else
     225          #    echo "Sorry, can't build the documentation for PACKAGE_NAME as latex is not installed"
     226          #    exit 1
     227          # fi
     228
     229
     230          # make the documentation in a package-specific way
     231          # for example, we might have
     232          # cd doc
     233          # $MAKE html
     234
     235          if [ $? -ne 0 ]; then
     236             echo "Error building PACKAGE_NAME docs."
     237             exit 1
     238          fi
     239          mkdir -p $SAGE_ROOT/local/share/doc/PACKAGE_NAME
     240          # assuming the docs are in doc/*
     241          cp -r doc/* $SAGE_ROOT/local/share/doc/PACKAGE_NAME/
     242       fi
     243
     244
    213245Note that the first line is ``/usr/bin/env bash``; this is important
    214246for portability.  Next, the script checks that ``SAGE_LOCAL`` is
    215247defined to make sure that the Sage environment has been set.  After
  • doc/en/installation/source.rst

    diff -r b36b2cd0d322 -r 6bb336f62bf1 doc/en/installation/source.rst
    a b  
    541541  (and ``sage -upgrade``) as well as the manual installation of
    542542  individual spkgs with e.g. ``sage -i``.
    543543
     544- :envvar:`SAGE_SPKG_INSTALL_DOCS` - Set this to "yes" to install
     545  package-specific documentation to
     546  :file:`$SAGE_ROOT/local/share/doc/PACKAGE_NAME/` when an spkg is
     547  installed.  This option may not be supported by all spkgs.  Some
     548  spkgs might also assume that certain programs are available on the
     549  system (for example, ``latex`` or ``pdflatex``).
     550
    544551- :envvar:`SAGE_FAT_BINARY` - to prepare a binary distribution that
    545552  will run on the widest range of target machines, set this variable
    546553  to "yes" before building Sage::