xref: /curl/packages/OS400/make-docs.sh (revision d14149e3)
1#!/bin/sh
2#***************************************************************************
3#                                  _   _ ____  _
4#  Project                     ___| | | |  _ \| |
5#                             / __| | | | |_) | |
6#                            | (__| |_| |  _ <| |___
7#                             \___|\___/|_| \_\_____|
8#
9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22# SPDX-License-Identifier: curl
23#
24###########################################################################
25#
26#       Documentation build script for the OS/400.
27#
28
29
30SCRIPTDIR=$(dirname "${0}")
31. "${SCRIPTDIR}/initscript.sh"
32
33[ -n "${PASEPERL}" ] || exit 0  # Perl needed for doc build.
34cd "${TOPDIR}/docs" || exit 1
35[ -d "${IFSDIR}/docs" ] || mkdir "${IFSDIR}/docs"
36
37
38#       Command line options.
39
40(
41        cd cmdline-opts || exit 1
42        MANPAGE=curl.1
43        TEXTPAGE=curl.txt
44        get_make_vars Makefile.inc
45        rm -f "${IFSDIR}/docs/${MANPAGE}" "${IFSDIR}/docs/${TEXTPAGE}"
46
47        #       Prepare online manual.
48        # shellcheck disable=SC2086
49        ${PASEPERL} "${TOPDIR}/scripts/managen" -c 75                   \
50                listhelp ${DPAGES} > "${TOPDIR}/src/tool_listhelp.c"
51
52        #       Generate text manual and copy it to DB2.
53        # shellcheck disable=SC2086
54        ${PASEPERL} "${TOPDIR}/scripts/managen" -I "${TOPDIR}/include"  \
55               -c 75 ascii ${DPAGES} > "${IFSDIR}/docs/${TEXTPAGE}"
56        MEMBER="${LIBIFSNAME}/DOCS.FILE/MANUAL.MBR"
57        CMD="CPY OBJ('${IFSDIR}/docs/${TEXTPAGE}') TOOBJ('${MEMBER}')"
58        CMD="${CMD} TOCCSID(${TGTCCSID}) DTAFMT(*TEXT) REPLACE(*YES)"
59        CLcommand "${CMD}"
60
61#       Man page is useless as OS/400 has no man command.
62#       # shellcheck disable=SC2086
63#       ${PASEPERL} "${TOPDIR}/scripts/managen" -I "${TOPDIR}/include"  \
64#               mainpage ${DPAGES} > "${IFSDIR}/docs/${MANPAGE}"
65)
66