[Nut-upsuser] man pages and asciidoc

Manuel Wolfshant wolfy at nobugconsulting.ro
Sat Jun 24 14:20:30 UTC 2017


On 06/24/2017 04:37 PM, Charles Lepple wrote:



Hi Charles. Thank you for looking into this !

> On Jun 23, 2017, at 10:28 PM, Manuel Wolfshant wrote:
>> Unfortunately they do not include any man pages, I did not have time to find a workaround for the hard requirement of newer versions for the tools used by the build process to create the man pages.
> You have mentioned the man pages several times, and I am slightly confused.
>
> If I grab a tarball from http://buildbot.networkupstools.org/~buildbot/docker-debian-jessie/snapshot/master/nut-latest.tar.gz , the man pages are included.


Yes, it is true. My spec was originally based on 
https://github.com/networkupstools/nut/tree/libusb-1.0 and that one did 
not include man pages at all. Later I tried the tarball recommended by 
you ( and this is the one I will refer below ) and for some reason it 
also does "something" at build time prohibiting build even if perfect 
valid manpages ( that could be included as such ) are already included 
in the tarball


> Are they not being installed if there is not a new-enough version of asciidoc available?
Hellas yes, RHEL /CentOS 6 provide asciidoc-8.4.5 while nut seems to 
need a newer version. I tried to build a newer version and include it in 
my buildroot but I failed ( I do not remember what was needed and 
missing ) and O had not time to debug, I just postponed including the 
docs altogether


Here is an excerpt of the build process. First the actual recipe:

#BuildRequires: autoconf <==== explicitly do NOT include auto* in the 
buildroot
#BuildRequires: automake
%if %{includedocs}
#BuildRequires: asciidoc # too old, gets rejected and breaks build if 
present
BuildRequires: aspell
BuildRequires: libxslt
%endif


%build
#autoreconf -i
# prevent assignment of default value, it would break configure's tests
export LDFLAGS="-Wl,-z,now"
#autogen.sh <===  notice how this is specifically disabled

%configure \
     --with-all \
     --with-libltdl \
     --with-cgi \
     --datadir=%{_datadir}/%{name} \
     --with-user=%{name} \
     --with-group=dialout \
     --with-statepath=%{piddir} \
     --with-pidpath=%{piddir} \
     --with-altpidpath=%{piddir} \
     --sysconfdir=%{_sysconfdir}/ups \
     --with-cgipath=%{cgidir} \
     --with-drvpath=%{modeldir} \
     --with-pkgconfig-dir=%{_libdir}/pkgconfig \
     --disable-static \
     --with-udev-dir=/lib/udev \
     --libdir=%{_libdir} \
     --with-doc # does not seem to work in 2.7.1& pre 2.7.5

%global _hardened_build 1
make %{?_smp_mflags} CFLAGS="%{optflags}" LDFLAGS="-Wl,-z,now, relro 
%{optflags}"



and this is the output of configure ( mind that asciidoc , as I said , 
is explicitly not included in the build root as it terminates the build 
if present due to its version being lower than 8.6.3):


checking whether to enable libltdl (Libtool dlopen abstraction) 
support... yes
checking for gd version via gdlib-config... 2.0.34 found
checking for gd include flags... -I/usr/include
checking for gd library flags... -L/usr/lib64 -lXpm -lX11 -ljpeg 
-lfontconfig -lfreetype -lpng12 -lz -lm
checking for gd.h... yes
checking for gdfontmb.h... yes
checking for library containing gdImagePng... -lgd
checking whether to build CGI programs... yes
checking for asciidoc... no
checking for a2x... no
checking for dblatex... no
checking for xsltproc... /usr/bin/xsltproc
checking for xsltproc version... 20706 found
checking for xmllint... /usr/bin/xmllint
checking for xmllint version... 20706 found
checking for source-highlight... no
checking for aspell... /usr/bin/aspell
checking if asciidoc version can build manpages (minimum required 
8.6.3)... no
checking if a2x version can build manpages (minimum required 8.6.3)... no
checking if xsltproc is present (mandatory for man page regeneration)... yes
checking if xmllint is present (mandatory for man page regeneration)... yes
checking if we have all the tools mandatory for man page regeneration... no
checking if source-highlight is present (preferable for documentation 
generation)... no
checking whether to build and install documentation... yes
checking desire and ability to build man documentation... yes
checking if we can build man... no
configure: WARNING: Unable to build man documentation which you requested
checking desire and ability to build html-single documentation... yes
checking if asciidoc version can build html-single (minimum required 
8.6.3)... no
checking desire and ability to build html-chunked documentation... yes
configure: WARNING: Unable to build html-single documentation which you 
requested
checking if a2x version can build html-chunked (minimum required 
8.6.3)... no
checking desire and ability to build pdf documentation... yes
configure: WARNING: Unable to build html-chunked documentation which you 
requested
checking if dblatex version can build pdf (minimum required 0.2.5)... no
configure: WARNING: Unable to build pdf documentation which you requested
configure: error: Unable to build man html-single html-chunked pdf 
documentation (check for 'no' results above)
error: Bad exit status from /var/tmp/rpm-tmp.gy5Lpj (%build)
     Bad exit status from /var/tmp/rpm-tmp.gy5Lpj (%build)




>
> Also, how much of a version mismatch are we talking about? I don't remember all of the errors in the older versions that led us to add the version checks to configure.ac, but we can certainly look into them.
>
> However, asciidoc is not difficult to upgrade. True, it has a lot of dependencies,

For one, the Fedora ( & EPEL by matter of consequence ) kind of prohibit 
relying on tools from outside the distro ( + EPEL ) during build time ( 
yes, I know, let's not comment this as I cannot do anything ) which, in 
shorter words, make using updated packages kind of difficult ( that's an 
euphemism for almost impossible ). As a side note, this is the reason 
for the nut packages that I distributed being built on my personal build 
system rather than Fedora's and I did not sign them because I want to 
make obvious ( at least for those who can read :) ) that they are a 
personal effort not endorsed by anyone else or by any organization.

For my personal builds ( which I shared.. ) I do include whatever I need 
when I can but in this case some dependency + lack of time prohibited me 
to do that. However,  IF configure would not blindly bail out, I would 
happily include those man*.8 from the tarball's docs/man directory. 
Unfortunatelly in the output of ./configure --help I did not find 
anything useful for cherry picking the docs, all I have seen is:

   --with-docs             build and install documentation (alias to 
--with-doc) (man=auto)
   --with-doc              build and install documentation 
(${nut_with_docs})


>   but those dependencies apply equally to the earlier versions as well.
I might be mistaken as I truly do not remember ( and I do not know where 
is the difference coming from ) but I am pretty sure that the earlier 
versions of nut ( 2.6.x ) did not bail out in configure. However there 
might be a change in the build recipe which led to this issue, my recipe 
for 2.7.x is adapted from RHEL 7




More information about the Nut-upsuser mailing list