Skip to content

Commit 457a992

Browse files
authored
Merge pull request #2366 from jimklimov/apc-modbus
Doc build recipe updates
2 parents d409b43 + 69e7fae commit 457a992

6 files changed

Lines changed: 38 additions & 11 deletions

File tree

Makefile.am

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export CCACHE_PATH=@CCACHE_PATH@
1010
@NUT_AM_MAKE_CAN_EXPORT@@NUT_AM_EXPORT_CCACHE_PATH@export PATH=@PATH_DURING_CONFIGURE@
1111

12-
# First target defines default behavior: all
12+
# First target often defines default behavior: all
1313
# We follow up with another pass to `make doc` because our wild recipes
1414
# sometimes preclude generating all of them on the first pass (FIXME!)
15-
# missing e.g. PDF and HTML which then pop up in `make check` footprint.
16-
all: all-recursive
15+
# missing e.g. PDF and HTML which then pop up in `make check` footprint,
16+
# or misses a .prep-src-docs stage needed to pattern-make man page files
17+
# with some "make" implementations...
18+
all all-am-local all-local: doc all-recursive
1719
+@$(MAKE) $(AM_MAKEFLAGS) doc
1820

1921
# include directory for aclocal
@@ -148,7 +150,7 @@ distclean-local:
148150
spellcheck spellcheck-interactive:
149151
+@RES=0; \
150152
(cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \
151-
(cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \
153+
(cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs) || RES=$$? ; \
152154
(cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \
153155
(cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \
154156
(cd $(builddir)/conf && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \
@@ -175,10 +177,12 @@ spellcheck spellcheck-interactive:
175177
doc spellcheck-sortdict \
176178
all-docs check-docs \
177179
man all-man man-man check-man man-html all-html:
178-
+cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@
180+
+cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs
181+
+cd $(abs_top_builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/man/.prep-src-docs
182+
+cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@
179183

180184
INSTALL.nut UPGRADING NEWS README:
181-
+cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F)
185+
+cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F)
182186

183187
# Workarounds for https://github.com/github/markup/issues/1095
184188
# require direct definition of our attributes in each source

NEWS.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ https://github.com/networkupstools/nut/milestone/10
221221
known deficiencies in Windows platform support, as well as some un-awareness
222222
about configuration key words which appeared in NUT since 2013. [#2290]
223223

224+
- The `tools/gitlog2changelog.py.in` script was revised, in particular to
225+
convert section titles (with contributor names coming from Git metadata)
226+
into plain ASCII character set, for `dblatex` versions which do not allow
227+
diacritics and other kinds of non-trivial characters in sections. This can
228+
cause successful builds of `ChangeLog.pdf` file on more platforms, but at
229+
expense of a semi-cosmetic difference in those names. [PR #2360, PR #2366]
224230

225231
Release notes for NUT 2.8.1 - what's new since 2.8.0
226232
----------------------------------------------------

UPGRADING.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ Changes from 2.8.1 to 2.8.2
4444
appear as comments, or enabled by specifying the `-U` command-line
4545
option several times. [#2221]
4646
47+
- The `tools/gitlog2changelog.py.in` script was revised, in particular to
48+
convert section titles (with contributor names) into plain ASCII character
49+
set, for `dblatex` versions which do not allow diacritics and other kinds
50+
of non-trivial characters in sections. A number of other projects seem to
51+
use the NUT version of the script, and are encouraged to look at related
52+
changes in `configure.ac` and `Makefile.am` recipes. [PR #2360, PR #2366]
53+
4754
Changes from 2.8.0 to 2.8.1
4855
---------------------------
4956

docs/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ endif WITH_SPELLCHECK
131131
check-local: $(CHECK_LOCAL_TARGETS)
132132

133133
# Make sure sources are there for out-of-tree builds:
134+
all-local all-am-local \
134135
@DOC_BUILD_LIST@ $(ASCIIDOC_PDF) $(ASCIIDOC_HTML_SINGLE) $(ASCIIDOC_HTML_CHUNKED): $(abs_top_builddir)/docs/.prep-src-docs
135136

136137
# This list is defined by configure script choices and options:
@@ -185,10 +186,10 @@ check-html-chunked: $(ASCIIDOC_HTML_CHUNKED)
185186
# chosen during configure script execution. The "all-man" and "all-html"
186187
# rules build everything documented.
187188
check-man all-man man-man all-html html-man:
188-
+cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@
189+
+cd $(abs_top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@
189190

190191
man:
191-
+cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all
192+
+cd $(abs_top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all
192193

193194
CLEANFILES = *.xml *.html *.pdf *-spellchecked docbook-xsl.css docinfo.xml.in.tmp
194195
CLEANFILES += $(top_builddir)/INSTALL.nut $(top_builddir)/UPGRADING $(top_builddir)/NEWS $(top_builddir)/ChangeLog.adoc $(top_builddir)/README

docs/man/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ EGREP = grep -E
2222

2323
all:
2424

25+
all-am-local all-local: $(abs_top_builddir)/docs/man/.prep-src-docs
26+
2527
# Base configuration and client manpages, always installed
2628
SRC_CONF_PAGES = \
2729
nut.conf.txt \

tools/gitlog2changelog.py.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ import subprocess
1212

1313
# Python 3 compatibility hack
1414
try:
15+
try:
16+
import unicode
17+
except:
18+
# Maybe built-in?
19+
pass
1520
unicode('')
16-
except NameError:
21+
except NameError as ex:
22+
#DEBUG# sys.stderr.write("Using 'str' as 'unicode': %s\n" % str(ex))
23+
#DEBUG# sys.stderr.flush()
1724
unicode = str
1825

1926
try:
@@ -125,8 +132,8 @@ for line in fin:
125132
author = author[0 : len(author) - fin_chop]
126133
if authorMustBeASCII:
127134
try:
128-
if isinstance(author, str):
129-
author = unicodedata.normalize(u'NFKD', unicode(author, "UTF=8")).encode('ascii', 'ignore').decode('utf8')
135+
if isinstance(author, str) and unicode != str:
136+
author = unicodedata.normalize(u'NFKD', unicode(author, "utf-8")).encode('ascii', 'ignore').decode('utf8')
130137
else:
131138
author = unicodedata.normalize(u'NFKD', author).encode('ascii', 'ignore').decode('utf8')
132139
except Exception as e:

0 commit comments

Comments
 (0)