Skip to content

Commit

Permalink
configure.ac, scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in, scrip…
Browse files Browse the repository at this point in the history
…ts/Solaris/*.xml.in: when suggesting man pages in service metadata, refer to packaged NUT_MANDIR [#722]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Dec 30, 2024
1 parent c8cb5eb commit 5e0dc45
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4722,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 @@ -4946,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
12 changes: 6 additions & 6 deletions scripts/Solaris/nut-driver-enumerator.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@
</common_name>
<documentation>
<doc_link name='upsdrvsvcctl online' uri='@NUT_WEBSITE_BASE@/docs/man/upsdrvsvcctl.html' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<doc_link name='ups.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/ups.conf.html' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='nut.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</instance>
Expand Down Expand Up @@ -183,11 +183,11 @@
</common_name>
<documentation>
<doc_link name='upsdrvsvcctl online' uri='@NUT_WEBSITE_BASE@/docs/man/upsdrvsvcctl.html' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<doc_link name='ups.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/ups.conf.html' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='nut.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</instance>
Expand Down
6 changes: 3 additions & 3 deletions scripts/Solaris/nut-driver.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@
</common_name>
<documentation>
<doc_link name='upsdrvsvcctl online' uri='@NUT_WEBSITE_BASE@/docs/man/upsdrvsvcctl.html' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsdrvsvcctl' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<doc_link name='ups.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/ups.conf.html' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='nut.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</service>
Expand Down
6 changes: 3 additions & 3 deletions scripts/Solaris/nut-monitor.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@
</common_name>
<documentation>
<doc_link name='upsmon online' uri='@NUT_WEBSITE_BASE@/docs/man/upsmon.html' />
<manpage title='upsmon' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsmon' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<doc_link name='upsmon.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/upsmon.conf.html' />
<manpage title='upsmon.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsmon.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='nut.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</service>
Expand Down
10 changes: 5 additions & 5 deletions scripts/Solaris/nut-server.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@
</common_name>
<documentation>
<doc_link name='upsd online' uri='@NUT_WEBSITE_BASE@/docs/man/upsd.html' />
<manpage title='upsd' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsd' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<doc_link name='ups.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/ups.conf.html' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='upsd.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/upsd.conf.html' />
<manpage title='upsd.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsd.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='upsd.users online' uri='@NUT_WEBSITE_BASE@/docs/man/upsd.users.html' />
<manpage title='upsd.users' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsd.users' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<doc_link name='nut.conf online' uri='@NUT_WEBSITE_BASE@/docs/man/nut.conf.html' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='nut.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</service>
Expand Down
10 changes: 5 additions & 5 deletions scripts/Solaris/nut.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
</loctext>
</common_name>
<documentation>
<manpage title='upsdrvctl' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='upsd' section='@MAN_SECTION_CMD_SYS@' manpath='/usr/share/man' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsd.conf' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsd.users' section='@MAN_SECTION_CFG@' manpath='/usr/share/man' />
<manpage title='upsdrvctl' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<manpage title='upsd' section='@MAN_SECTION_CMD_SYS@' manpath='@NUT_MANDIR@' />
<manpage title='ups.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<manpage title='upsd.conf' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
<manpage title='upsd.users' section='@MAN_SECTION_CFG@' manpath='@NUT_MANDIR@' />
</documentation>
</template>
</service>
Expand Down
3 changes: 1 addition & 2 deletions scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,10 @@ smf_setDocLink() {
/usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/uri" = "astring:" "${NUT_WEBSITE_BASE}/docs/man/${__DRV}.html"
[ $? = 0 ] && echo "OK" || { echo "FAILED to stash the service property group '${__PG}' for online docs">&2 ; return 1 ; }

# FIXME: Pass resolved $mandir if known
__PG="tm_man_${__DRV}@MAN_SECTION_CMD_SYS@"
/usr/sbin/svccfg -s "${__TARGET_FMRI}" delprop "${__PG}" 2>/dev/null || true
/usr/sbin/svccfg -s "${__TARGET_FMRI}" addpg "${__PG}" template && \
/usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/manpath" = "astring:" "/usr/share/man" && \
/usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/manpath" = "astring:" "@NUT_MANDIR@" && \
/usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/section" = "astring:" "@MAN_SECTION_CMD_SYS@" && \
/usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/title" = "astring:" "${__DRV}"
[ $? = 0 ] && echo "OK" || { echo "FAILED to stash the service property group '${__PG}' for local docs">&2 ; return 1 ; }
Expand Down

0 comments on commit 5e0dc45

Please sign in to comment.