Skip to content

Commit

Permalink
Merge pull request #2743 from jimklimov/fix-pkg-sol
Browse files Browse the repository at this point in the history
Follow up on documentation links, and revise Solaris/illumos packaging aids
  • Loading branch information
jimklimov authored Jan 3, 2025
2 parents 9cc85f8 + 4fef10c commit 6cd2c90
Show file tree
Hide file tree
Showing 49 changed files with 692 additions and 451 deletions.
2 changes: 1 addition & 1 deletion INSTALL.nut.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ifndef::top_builddir[]
endif::top_builddir[]
//
//
// Address links on GitHub vs docs
// Address links on GitHub vs. docs
// (note: 'env-github' attribute is set on GitHub)
//
// - when generating docs:
Expand Down
42 changes: 21 additions & 21 deletions Jenkinsfile-dynamatrix

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,13 @@ setver:
# Clean the dist tarball and packages
MAINTAINERCLEANFILES_DISTBALL = nut-*.tar.gz
# HP-UX:
MAINTAINERCLEANFILES_PACKAGES = NUT_HPUX_package@[email protected]
MAINTAINERCLEANFILES_PACKAGES = NUT_HPUX_package@[email protected] NUT_HPUX_package-@[email protected]
# AIX as below, and RedHat-compatible (cover binary and source packages):
MAINTAINERCLEANFILES_PACKAGES += nut*rpm
# Debian-compatible (cover binary and source packages):
MAINTAINERCLEANFILES_PACKAGES += nut*deb
# Solaris SVR4 package archives:
MAINTAINERCLEANFILES_PACKAGES += NUT_solaris_*_package@[email protected]
MAINTAINERCLEANFILES_PACKAGES += NUT_solaris_*_package@[email protected] NUT_solaris_*_package-@[email protected]
# Newer Solaris IPS (aka "pkg(5)" format archives)
MAINTAINERCLEANFILES_PACKAGES += *.p5p

Expand All @@ -548,7 +548,7 @@ package: dist
"HP-UX") \
( cd scripts/HP-UX && \
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" package && \
mv NUT_HPUX_package.depot $(abs_top_builddir)/NUT_HPUX_package@[email protected] ) ;; \
mv NUT_HPUX_package.depot $(abs_top_builddir)/NUT_HPUX_package-@[email protected] ) ;; \
"SunOS") \
$(MAKE) $(AM_MAKEFLAGS) && \
$(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$DESTDIR" install && \
Expand Down
10 changes: 8 additions & 2 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@ relocated into new `shutdown.default` INSTCMD definitions. [#2670]
and it defaults to `true` allowing for better ordered documents at the cost
of some memory during document generation. [#2510]
- updated man page generation with `configure` script options to specify that
manual sections on the target platform differ from (Linux-based) defaults
hard-coded into page sources; this should allow to simplify NUT packaging
recipe maintenance in distributions (no more updating patches for changed
or added documentation sources).
- lines in first section of NUT configuration report (can optionally remain as
`config.nut_report_feature.log` and be installed into shared documentation
of a NUT package) are now better grouped as miscellaneous features and
Expand Down Expand Up @@ -1632,7 +1638,7 @@ refer to this change set (too long in the making) as NUT 2.7.5.
autoconf-2.70 releases in 2020 (also works with 2.69 which was the
earlier release since 2012)
* Dynamic library loading used in certain programs and use-cases improved,
especially for 64-bit vs 32-bit builds on multiple-bitness OSes
especially for 64-bit vs. 32-bit builds on multiple-bitness OSes
* Logging routines like `upsdebugx()` were refactored as macros so there
is slightly less overhead when logging is disabled [PRs #685 and #1100]
* Numerous classes of compilation warnings eradicated, many of those being
Expand Down Expand Up @@ -1867,7 +1873,7 @@ Release notes for NUT 2.7.2 - what's new since 2.7.1
* Emerson Network Power Liebert PSI 1440
* MicroDowell B.Box LP 500
* Numeric Digital 800 plus
* OptiUPS VS 575C
* OptiUPS vs. 575C
* Tripp Lite SU10KRT3/1X
- FreeDesktop Hardware Abstraction Layer (HAL) support was removed.
Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ifndef::top_builddir[]
endif::top_builddir[]
//
//
// Address links on GitHub vs docs
// Address links on GitHub vs. docs
// (note: 'env-github' attribute is set on GitHub)
//
// - when generating docs:
Expand Down
16 changes: 15 additions & 1 deletion UPGRADING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ Changes from 2.8.2 to 2.8.3
Please use it, it immensely helps with community troubleshooting!
[issue #1949]
- Reference packages prepared by `make package` should now separate the
`PACKAGE_VERSION` from the platform-dependent prefix by a dash character
in the ultimate package file name. Previously they were glued together
for some platform targets (HPUX, Solaris). Solaris SVR4 package file names
should new differentiate `i386` vs. `amd64` and `sparc` vs. `sparcv9`,
depending on `target_cpu` of the build. If you had any scripts relying
on the older pattern, they may have to be updated.
- Updated man page generation with `configure` script options to specify that
manual sections on the target platform differ from (Linux-based) defaults
hard-coded into page sources; this should allow to simplify NUT packaging
recipe maintenance in distributions (no more updating patches for changed
or added documentation sources)
- `upsmon` should now integrate natively with systemd-driven OS sleep events
(built with systemd version 221 or newer "inhibitor interface"), so various
hacks previously packaged into `/usr/lib/systemd/system-sleep/` scripts or
Expand Down Expand Up @@ -257,7 +271,7 @@ Changes from 2.8.0 to 2.8.1
- The `upsd.conf` listing of `LISTEN` addresses was previously inverted
(the last listed address was applied first), which was counter-intuitive
and fixed for this release. If user configurations somehow relied on this
order (e.g. to prioritize IPv6 vs IPv4 listeners), configuration changes
order (e.g. to prioritize IPv6 vs. IPv4 listeners), configuration changes
may be needed. [#2012]
- The `upsd` configured to listen on IPv6 addresses should handle only
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ echo "----------------------------------------------------------------------"
echo "Please note that on some systems the routine below can complain that "
echo " > configure.ac: warning: AC_INIT: not a literal: m4_esyscmd_s(...)"
echo "but still does the right thing about PACKAGE_VERSION and PACKAGE_URL settings."
echo "Check if your distro provides an 'autoconf-archive' package anf if it helps."
echo "Check if your distro provides an 'autoconf-archive' package and if it helps."
echo "Please post an issue in NUT bug tracker with platform details if it does not."
echo "----------------------------------------------------------------------"

Expand Down
2 changes: 1 addition & 1 deletion ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-sp
done

# TODO: Similar loops for other variations like TESTING,
# MGE SHUT vs other serial protocols...
# MGE SHUT vs. other serial protocols...

if can_clean_check ; then
echo "=== One final try for optional_maintainer_clean_check:"
Expand Down
2 changes: 1 addition & 1 deletion clients/nutclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void Socket::connect(const std::string& host, uint16_t port)
snprintf(sport, sizeof(sport), "%" PRIuMAX, static_cast<uintmax_t>(port));

memset(&hints, 0, sizeof(hints));
/* TODO? Port IPv4 vs IPv6 detail from upsclient.c */
/* TODO? Port IPv4 vs. IPv6 detail from upsclient.c */
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
Expand Down
10 changes: 8 additions & 2 deletions common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,15 @@ const char *suggest_doc_links(const char *progname, const char *progconf) {
snprintf(buf, sizeof(buf),
"For more information please ");
#if defined(WITH_DOCS) && WITH_DOCS
/* FIXME: Currently all NUT tools and drivers are in same
* man page section for "System Management Programs".
* If this ever changes (e.g. clients like `upsc` can be
* a "User Program" just as well), we may need an extra
method argument here.
*/
snprintfcat(buf, sizeof(buf),
"Read The Fine Manual ('man %s') and/or ",
buf2);
"Read The Fine Manual ('man %s %s') and/or ",
MAN_SECTION_CMD_SYS, buf2);
#endif
snprintfcat(buf, sizeof(buf),
"see\n\t%s/docs/man/%s.html\n",
Expand Down
48 changes: 47 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dnl off by `dirname` should do the trick.
dnl NOTE: the resulting NUT_WEBSITE_BASE string does not end with a slash!
NUT_WEBSITE_BASE="`dirname "${PACKAGE_URL}index.html"`"
dnl Fallback, no trailing slash!
[ -n "${NUT_WEBSITE_BASE-}" ] || NUT_WEBSITE_BASE='https://www.networkupstools.org'
test -n "${NUT_WEBSITE_BASE-}" || NUT_WEBSITE_BASE='https://www.networkupstools.org'

dnl Note: this refers to GITREV at the time of configure script running
dnl primarily for better messaging in the script itself (also to render
Expand Down Expand Up @@ -2130,6 +2130,12 @@ dnl the usual builds can pass by default on systems without asciidoc.
NUT_ARG_WITH([docs], [build and install documentation (alias to --with-doc)], [man=auto])
NUT_ARG_WITH([doc], [build and install documentation (see docs/configure.txt for many variants of the option)], [${nut_with_docs}])

dnl NOTE: Sections may be strings, not pure numbers, on some platforms:
NUT_ARG_WITH([docs-man-section-api], [man page section for library APIs], [3])
NUT_ARG_WITH([docs-man-section-cfg], [man page section for configuration files], [5])
NUT_ARG_WITH([docs-man-section-cmd-sys], [man page section for system management commands], [8])
NUT_ARG_WITH([docs-man-section-cmd-usr], [man page section for user commands], [1])

dnl NOTE: Until X-Mas 2021, the default was "legacy" (now "medium")
NUT_ARG_ENABLE([warnings],
[enable warning presets that were picked as useful in maintainership and CI practice (variants include gcc-minimal, gcc-medium, gcc-hard, clang-minimal, clang-medium, clang-hard, all; auto-choosers: hard, medium, minimal, yes=auto='gcc or clang or all at hardcoded default difficulty')],
Expand Down Expand Up @@ -3432,6 +3438,37 @@ fi
AM_CONDITIONAL(WITH_PDFS, test "${WITH_PDFS}" = "yes")
AM_CONDITIONAL(SKIP_PDFS, test "${SKIP_PDFS}" = "yes")

dnl NOTE: Sections may be strings, not pure numbers, on some platforms:
MAN_SECTION_API="${nut_with_docs_man_section_api}"
MAN_SECTION_CFG="${nut_with_docs_man_section_cfg}"
MAN_SECTION_CMD_SYS="${nut_with_docs_man_section_cmd_sys}"
MAN_SECTION_CMD_USR="${nut_with_docs_man_section_cmd_usr}"

MAN_SECTION_API_BASE="`echo "${MAN_SECTION_API}" | sed 's/^\(@<:@0-9@:>@*\)@<:@^0-9@:>@.*$/\1/'`"
MAN_SECTION_CFG_BASE="`echo "${MAN_SECTION_CFG}" | sed 's/^\(@<:@0-9@:>@*\)@<:@^0-9@:>@.*$/\1/'`"
MAN_SECTION_CMD_SYS_BASE="`echo "${MAN_SECTION_CMD_SYS}" | sed 's/^\(@<:@0-9@:>@*\)@<:@^0-9@:>@.*$/\1/'`"
MAN_SECTION_CMD_USR_BASE="`echo "${MAN_SECTION_CMD_USR}" | sed 's/^\(@<:@0-9@:>@*\)@<:@^0-9@:>@.*$/\1/'`"

AC_DEFINE_UNQUOTED([MAN_SECTION_API], ["${MAN_SECTION_API}"], [man page section for library APIs])
AC_DEFINE_UNQUOTED([MAN_SECTION_CFG], ["${MAN_SECTION_CFG}"], [man page section for configuration files])
AC_DEFINE_UNQUOTED([MAN_SECTION_CMD_SYS], ["${MAN_SECTION_CMD_SYS}"], [man page section for system management commands])
AC_DEFINE_UNQUOTED([MAN_SECTION_CMD_USR], ["${MAN_SECTION_CMD_USR}"], [man page section for user commands])

AC_DEFINE_UNQUOTED([MAN_SECTION_API_BASE], ["${MAN_SECTION_API_BASE}"], [base (number only) man page section for library APIs])
AC_DEFINE_UNQUOTED([MAN_SECTION_CFG_BASE], ["${MAN_SECTION_CFG_BASE}"], [base (number only) man page section for configuration files])
AC_DEFINE_UNQUOTED([MAN_SECTION_CMD_SYS_BASE], ["${MAN_SECTION_CMD_SYS_BASE}"], [base (number only) man page section for system management commands])
AC_DEFINE_UNQUOTED([MAN_SECTION_CMD_USR_BASE], ["${MAN_SECTION_CMD_USR_BASE}"], [base (number only) man page section for user commands])

AC_SUBST(MAN_SECTION_API)
AC_SUBST(MAN_SECTION_CFG)
AC_SUBST(MAN_SECTION_CMD_SYS)
AC_SUBST(MAN_SECTION_CMD_USR)

AC_SUBST(MAN_SECTION_API_BASE)
AC_SUBST(MAN_SECTION_CFG_BASE)
AC_SUBST(MAN_SECTION_CMD_SYS_BASE)
AC_SUBST(MAN_SECTION_CMD_USR_BASE)

dnl ----------------------------------------------------------------------
dnl checks related to --with-dev

Expand Down Expand Up @@ -4685,6 +4722,14 @@ NUT_DATADIR="${conftemp}"
NUT_REPORT_SETTING_PATH([Data file path],
NUT_DATADIR, "${conftemp}", [Default path for data files])

dnl same for mandir
conftemp="${mandir}"
eval conftemp=\"${conftemp}\"
eval conftemp=\"${conftemp}\"
NUT_MANDIR="${conftemp}"
NUT_REPORT_SETTING_PATH([Man page path],
NUT_MANDIR, "${conftemp}", [Default path for man page files])

dnl same for bindir
conftemp="${bindir}"
eval conftemp=\"${conftemp}\"
Expand Down Expand Up @@ -4909,6 +4954,7 @@ AC_SUBST(BINDIR)
AC_SUBST(LIBDIR)
AC_SUBST(PKGCONFIGDIR)
AC_SUBST(NUT_DATADIR, [`eval echo "${NUT_DATADIR}"`])
AC_SUBST(NUT_MANDIR, [`eval echo "${NUT_MANDIR}"`])
AC_SUBST(NUT_LIBEXECDIR, [`eval echo "${LIBEXECDIR}"`])
AC_SUBST(DRVPATH)
AC_SUBST(SBINDIR)
Expand Down
69 changes: 54 additions & 15 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ DOCBUILD_FILTER_GITHUB_LINKS = { \
# The $< is okay here, it is used in a suffix rule below
DOCBUILD_CONVERT_GITHUB_LINKS = { \
echo " DOC-ASCIIDOC-GITHUB-LINKS Parsing GitHub link patterns $< => $@"; \
cat "$<" | $(DOCBUILD_FILTER_GITHUB_LINKS) > "$@.tmp.$$$$" \
cat '$<' | $(DOCBUILD_FILTER_GITHUB_LINKS) > "$@.tmp.$$$$" \
&& mv -f "$@.tmp.$$$$" "$@" \
; }

Expand All @@ -379,7 +379,7 @@ $(top_builddir)/ChangeLog: dummy
@+echo " DOC-CHANGELOG-GENERATE-WRAPPER $@ : call parent Makefile to decide if (re-)generation is needed" \
&& cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) $(@F)

# BSD Make dislikes the path resolution here and does not always populate "$<"
# BSD Make dislikes the path resolution here and does not always populate '$<'
# (and claims why: "Using $< in a non-suffix rule context is a GNUmake idiom"),
# but it has a "$?" for "list of dependencies that are newer than the target".
# For more details see https://man.freebsd.org/cgi/man.cgi
Expand Down Expand Up @@ -490,11 +490,15 @@ A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) \

# Note we only remove the original target (if present), if it is a directory -
# e.g. created by "html-chunked" targets.

# NOTE: MKDIR_P may be defined via expanded $(top_builddir)/install-sh
# so should be run from $(abs_builddir) to be safe, as we jump around
# the build workspace
DOCBUILD_BEGIN = { \
if test -n "$${A2X_OUTDIR}" && test "$${A2X_OUTDIR}" != '.' ; then \
rm -rf "./$${A2X_OUTDIR}" || true ; \
test -d "$@" && rm -rf "$@" || true ; \
$(MKDIR_P) "./$${A2X_OUTDIR}" || exit ; \
_CWD="`pwd`" && (cd '$(abs_builddir)' && $(MKDIR_P) "$${_CWD}/$${A2X_OUTDIR}") || exit ; \
case "$${A2X_OUTDIR}" in \
tmp/pdf.*) ln -s ../../images "./$${A2X_OUTDIR}" ;; \
esac; \
Expand Down Expand Up @@ -544,7 +548,7 @@ DOCBUILD_END = { \
+@A2X_OUTDIR="tmp/html-single.$(@F).$$$$" ; \
echo " DOC-HTML Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl "$(<D)/`basename '$(<F)' -prepped`" || RES=$$? ; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl '$<' || RES=$$? ; \
$(DOCBUILD_END) ; \
case "$(@F)" in \
*ChangeLog*) if [ -s '$(top_builddir)/ChangeLog' ] ; then \
Expand All @@ -554,7 +558,7 @@ DOCBUILD_END = { \
rm -f "$@"; \
A2X_OUTDIR="tmp/html-single.$(@F).$$$$-retry" ; \
$(DOCBUILD_BEGIN) ; RES=0; rm -f "`basename '$(@F)'`"-contentchecked || true ; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl "$(<D)/`basename '$(<F)' -prepped`" || RES=$$? ; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl '$<' || RES=$$? ; \
$(DOCBUILD_END) ; \
$(MAKE) $(AM_MAKEFLAGS) "`basename '$(@F)'`"-contentchecked || RES=$$? ; \
fi ; \
Expand All @@ -567,7 +571,7 @@ DOCBUILD_END = { \
@A2X_OUTDIR="tmp/html-chunked.$(@F).$$$$" ; \
echo " DOC-HTML-CHUNKED Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=chunked_format --format=chunked --xsl-file=$(srcdir)/chunked.xsl "$(<D)/`basename '$(<F)' -prepped`" || RES=$$? ; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=chunked_format --format=chunked --xsl-file=$(srcdir)/chunked.xsl '$<' || RES=$$? ; \
$(DOCBUILD_END) ; exit $$RES

# Note: non-HTML a2x modes may ignore the destination directory
Expand All @@ -576,7 +580,7 @@ DOCBUILD_END = { \
@A2X_OUTDIR="tmp/pdf.$(@F).$$$$" ; \
echo " DOC-PDF Generating $@"; \
$(DOCBUILD_BEGIN) ; RES=0; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=pdf_format --format=pdf -a docinfo1 "$(<D)/`basename '$(<F)' -prepped`" || RES=$$? ; \
$(A2X) $(A2X_COMMON_OPTS) --attribute=pdf_format --format=pdf -a docinfo1 '$<' || RES=$$? ; \
$(DOCBUILD_END) ; exit $$RES

# Used below for spellcheck and for .prep-src-docs
Expand Down Expand Up @@ -860,9 +864,18 @@ PREP_SRC = $(EXTRA_DIST) $(SPELLCHECK_SRC_DEFAULT)
# path to locate the sources, so we end up with bogus trees under docs/.
# Code below tries to detect and truncate this mess, including possible
# source texts located in/under parent dirs.
# We also handle man page links (section-aware) for platforms where they
# differ from common defaults.
# NOTE: MKDIR_P may be defined via expanded $(top_builddir)/install-sh
# so should be run from $(abs_builddir) to be safe, as we jump around
# the build workspace
$(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC)
@cd "$(@D)" || exit ; \
linkroot="$(abs_builddir)" ; \
MAN_SECTIONS_DEFAULT=false ; \
if [ x"$(MAN_SECTION_API)$(MAN_SECTION_CFG)$(MAN_SECTION_CMD_SYS)$(MAN_SECTION_CMD_USR)" = x3581 ] ; then \
MAN_SECTIONS_DEFAULT=true ; \
fi ; \
if test x"$(abs_srcdir)" = x"$(abs_builddir)" ; then \
COUNT=0; \
for F in $(PREP_SRC) ; do \
Expand All @@ -873,10 +886,16 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC)
cd "$(abs_top_builddir)" ; \
fi ;; \
esac ; \
if ! test -e "$${F}-prepped" ; then \
touch "$${F}-prepped" || exit ; \
COUNT="`expr $$COUNT + 1`" ; \
fi ; \
if $$MAN_SECTIONS_DEFAULT ; then \
cat ; \
else \
sed \
-e 's,\(linkman:[^ []*\[\)3\],\1$(MAN_SECTION_API)],g' \
-e 's,\(linkman:[^ []*\[\)5\],\1$(MAN_SECTION_CFG)],g' \
-e 's,\(linkman:[^ []*\[\)8\],\1$(MAN_SECTION_CMD_SYS)],g' \
-e 's,\(linkman:[^ []*\[\)1\],\1$(MAN_SECTION_CMD_USR)],g' ; \
fi < "$${F}" > "$${F}-prepped" || exit ; \
COUNT="`expr $$COUNT + 1`" ; \
done ; \
if ! test -e "$@" ; then touch "$@" ; fi ; \
else \
Expand All @@ -900,18 +919,38 @@ $(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC)
cd "$(abs_top_builddir)" ; \
fi ;; \
"$(srcdir)"/*) F="`echo "$$F" | sed 's#^$(srcdir)/*#./#'`" ;; \
*/*) ;; \
*) \
linkroot="$(abs_builddir)" ; \
linksrcroot="$(abs_srcdir)" ; \
cd "$(abs_top_builddir)" ;; \
esac ; \
D="`dirname "$$F"`" ; \
$(MKDIR_P) "$${linkroot}/$$D" || { rm -f "$@.working" ; exit 1 ; } ; \
(cd '$(abs_builddir)' && $(MKDIR_P) "$${linkroot}/$$D") || { rm -f "$@.working" ; exit 1 ; } ; \
if ! test -s "$${linkroot}/$$F" && test -s "$${linksrcroot}/$$F" ; then \
echo " LN '$${linksrcroot}/$$F' => '$${linkroot}/$$F' (PWD = '`pwd`')" ; \
ln -fs "$${linksrcroot}/$$F" "$${linkroot}/$$F" || { rm -f "$@.working" ; exit 1 ; } ; \
COUNT="`expr $$COUNT + 1`" ; \
fi ; \
if ! test -e "$${linkroot}/$${F}-prepped" ; then \
touch "$${linkroot}/$${F}-prepped" || { rm -f "$@.working" ; exit 1 ; } ; \
COUNT="`expr $$COUNT + 1`" ; \
case "$$F" in \
*.txt|*.adoc) IS_TEXT=true ;; \
*.*) IS_TEXT=false ;; \
*) IS_TEXT=true ;; \
esac; \
if $$IS_TEXT ; then \
grep -w linkman "$${linkroot}/$${F}" > /dev/null || IS_TEXT=false ; \
fi ; \
if $$MAN_SECTIONS_DEFAULT || ! $$IS_TEXT ; then \
cat ; \
else \
sed \
-e 's,\(linkman:[^ []*\[\)3\],\1$(MAN_SECTION_API)],g' \
-e 's,\(linkman:[^ []*\[\)5\],\1$(MAN_SECTION_CFG)],g' \
-e 's,\(linkman:[^ []*\[\)8\],\1$(MAN_SECTION_CMD_SYS)],g' \
-e 's,\(linkman:[^ []*\[\)1\],\1$(MAN_SECTION_CMD_USR)],g' ; \
fi < "$${linkroot}/$${F}" > "$${linkroot}/$${F}-prepped" \
|| { rm -f "$@.working" ; exit 1 ; } ; \
COUNT="`expr $$COUNT + 1`" ; \
done ; \
fi ; \
if test "$$COUNT" -gt 0 -o ! -e "$@" ; then touch "$@" ; fi
Expand Down
Loading

0 comments on commit 6cd2c90

Please sign in to comment.