Bug 263751 - sysutils/nut*: Remove asciidoc dependency and make MANPAGES user selectable
Summary: sysutils/nut*: Remove asciidoc dependency and make MANPAGES user selectable
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-03 09:27 UTC by Joerg Pulz
Modified: 2022-05-09 20:45 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments
patch to remove asciidoc dependency and make MANPAGES user selectable (16.57 KB, patch)
2022-05-03 09:27 UTC, Joerg Pulz
no flags Details | Diff
complete refactoring of sysutils/nut to handle OPTIONS the standard way (23.85 KB, patch)
2022-05-03 13:31 UTC, Joerg Pulz
no flags Details | Diff
Seven sysutils/nut* commits (56.59 KB, patch)
2022-05-04 04:33 UTC, Cy Schubert
no flags Details | Diff
Pet portlint (1.41 KB, patch)
2022-05-04 04:50 UTC, Cy Schubert
no flags Details | Diff
Register conflicts (1.14 KB, patch)
2022-05-04 04:51 UTC, Cy Schubert
no flags Details | Diff
IPMI patch (2.37 KB, patch)
2022-05-04 06:00 UTC, Joerg Pulz
no flags Details | Diff
Fixup both nut purts (68.24 KB, patch)
2022-05-04 17:38 UTC, Cy Schubert
no flags Details | Diff
To be committed next week (67.76 KB, patch)
2022-05-04 18:53 UTC, Cy Schubert
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Pulz 2022-05-03 09:27:30 UTC
Created attachment 233694 [details]
patch to remove asciidoc dependency and make MANPAGES user selectable

Latest update to nut-2.8.0 pulls in unnecessary dependency to asciidoc.
Remove asciidoc dependency as it is not needed - see below.

While here make MANPAGES user selectable and adopt pkg-plist accordingly.

Description:
Pre-built manpages are already bundled with nut-2.8.0.
They are never regenerated, no matter if asciidoc is available.

configure output from a system without asciidoc and MANPAGES selected:

checking if asciidoc version can build manpages (minimum required 8.6.3)... no
checking if we have all the tools mandatory for man page regeneration... no
checking whether to build and install documentation... man=auto
configure: Got explicit list of document formats to build or not: man=auto
checking desire and ability to build man documentation... auto
checking if we can build man... no
configure: WARNING: Unable to build man documentation, but can install pre-built distributed copies
configure: Skipping build of man documentation (check for 'skip' results above)
checking whether to build specific documentation format(s)... no
....
build and install documentation: man=auto
build specific documentation format(s): no

Result: Bundled manpages will be installed.

Add MANPAGES to OPTIONS_DEFAULT to make the port behave as before MANPAGES.
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2022-05-03 10:58:24 UTC
Good find, can you please use the recommened way to define this as recommended by porters handbook?

https://docs.freebsd.org/en/books/porters-handbook/book/#options-configure_on
"5.13.3.3.3. OPT_CONFIGURE_ON and OPT_CONFIGURE_OFF"

Have you tested this patch using Poudriere?
Comment 2 Joerg Pulz 2022-05-03 11:31:36 UTC
I tried MANPAGES_CONFIGURE_ON and MANPAGES_CONFIGURE_OFF first, but found it not working. make -V CONFIGURE_ARGS didn't contain the arguments defined.
Maybe related to the direct ".include <bsd.port.options.mk>" ?

No Poudriere, sorry.

I've tested only on two systems by hand.
One system without asciidoc installed and the other system with asciidoc installed. Both where tested with MANPAGES selected and unselected.
make check-plist was fine for all tests.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2022-05-03 13:19:29 UTC
No worries. I'll build a patch from scratch.
Comment 4 Joerg Pulz 2022-05-03 13:31:51 UTC
Created attachment 233699 [details]
complete refactoring of sysutils/nut to handle OPTIONS the standard way

Second attempt - complete OPTION refactoring

Worked fine during my limited tests but definitely needs a look by someone else and a poudriere run.
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2022-05-03 13:44:25 UTC
This patch changes a lot of things and needs to be committed in three different commits. I will cobble up three separate commits from this, and perform the same work on nut-devel.
Comment 6 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 04:33:50 UTC
Created attachment 233711 [details]
Seven sysutils/nut* commits

The attached file, seven sysutils/nut* commits, addresses all six issues discussed in this PR, plus another discovered in the sysutils/nut port when the Makefile from sysutils/nut-devel was ported to sysutils/nut on April 27 for the 2.8.0 upgrade.

The seven addressed issues are:

* bb8de06bcae0 6edc3a37211a  2022-05-03 - (HEAD -> nut) sysutils/nut*: Add MANPAGES option 
|        
* b65146340fa7 c5b0a297ed72  2022-05-03 - sysutils/nut: Remove redundant BUILD_DEPENDS 
|        
* 7bbd99eb4d62 8048be1bdfd0  2022-05-03 - sysutils/nut*: Convert to options helpers 
|        
* b875ff1b30f7 987cf9a1e5ca  2022-05-03 - sysutils/nut: Remove redundant install-strip INSTALL TARGET 
|        
* dce06b1ffd3b a7ed329d3cc4  2022-05-03 - sysutils/nut*: Use canned options descriptions 
|        
* 1546d925c63a 863d26d852f9  2022-05-03 - sysutils/nut*: Add license 
|        
* d8fce30879a9 c6d0b9368e84  2022-05-03 - sysutils/nut: Remove redundant EXTRACT_ONLY definition 
|        

The patches were applied to sysutils/nut and sysutils/nut-devel.
Comment 7 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 04:50:25 UTC
Created attachment 233712 [details]
Pet portlint

Please also apply this pet portlint patch. It and the next patch complete the series.
Comment 8 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 04:51:43 UTC
Created attachment 233713 [details]
Register conflicts

Not specifically documented in this PR but the two nut ports should register conflicts against each other.

This is the last patch in the series.
Comment 9 Joerg Pulz 2022-05-04 06:00:02 UTC
Created attachment 233714 [details]
IPMI patch

Thanks for your work on this.
There are still some points:

BUILD_DEPENDS=  asciidoc:textproc/asciidoc
is still in there but should be removed completely

NEON_CONFIGURE_OFF=     --disable-neon
should be removed, as configure knows nothing about this argument

PDU_CONFIGURE_ON=       --with-powerman
PDUCONFIGURE_OFF=       --without-powerman
Typo: either PDUCONFIGURE_OFF => PDU_CONFIGURE_OFF or convert to _WITH
PDU_CONFIGURE_WITH=   powerman

USB_CONFIGURE_ON=	--with-usb=auto
should be converted to USB_CONFIGURE_WITH= usb=auto
This sets --without-usb automatically when USB is not selected and prevents automatic build of USB support if required dependecies are installed.

USB_LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
USB_CONFIGURE_WITH=	snmp
should be SNMP_LIB_DEPENDS and SNMP_CONFIGURE_WITH

Manpages for CGI, NEON, IPMIPSU, PDU, SERIAL, SNMP and USB miss prepending %%MANPAGES%% in pkg-plist.


Please take a look at the attached patch for IPMI handling.
There is no need for OPTIONS_SINGLE=IPMI and no need for separate IPMIPSU and FREEIPMI options.
Either you enable IPMI support and you get the IPMIPSU driver and IPMI support in eg. nut-scanner or you disable it and get it not.
There is no way to get IPMIPSU driver without IPMI support in eg. nut-scanner or the other way round.
So we can simply modify it to be a normal IPMI OPTION.
Comment 10 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 06:15:53 UTC
Re: asciidoc: If you look at my commit logs you will see why. asciidoc
is needed for nut-devel and thus it remains there. But it is not needed
in nut. Read the docs in the doc/ directory. They say asciidoc is needed.
 
Good catches on the others.
Comment 11 Joerg Pulz 2022-05-04 06:23:55 UTC
Sorry, my fault. I missed that asciidoc is removed from nut and only remains in nut-devel.
That's completely fine.
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 17:38:50 UTC
Created attachment 233724 [details]
Fixup both nut purts

This should fix both ports. Give it a try.
Comment 13 Joerg Pulz 2022-05-04 18:17:26 UTC
Looks good so far, except the latest IPMI changes are missing. ;-)

One thing a thought about:
Would it be wise to add
SSL_OFF_CONFIGURE_ON=	--without-ssl
SSL_OFF_CONFIGURE_OFF=	--with-ssl
?
It may be a bit redundat but just to make sure that SSL support is really turned on or off without relying on configure doing the right thing.
Comment 14 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 18:20:09 UTC
We don't need that.
Comment 15 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 18:23:27 UTC
Reviewing the patch it appears that some of my other unrelated work was committed in 916e90103e3729a623bda3be324a37da3c6f8d68. I'll rebase again and remove those two patches from that commit.
Comment 16 Cy Schubert freebsd_committer freebsd_triage 2022-05-04 18:53:16 UTC
Created attachment 233725 [details]
To be committed next week

This will be committed sometime next week.
Comment 17 Joerg Pulz 2022-05-05 05:04:15 UTC
(In reply to Cy Schubert from comment #16)

Thanks a lot.

Would you please add the IPMI changes from comment #9 too?

Can you make the asciidoc dependency in nut-devel to be a MANPAGES only dependency:
MANPAGES_BUILD_DEPENDS= asciidoc:textproc/asciidoc
Comment 18 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:34 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d6f4ee06c5f668af7615300159d803462da965cd

commit d6f4ee06c5f668af7615300159d803462da965cd
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-04 04:18:28 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:28 +0000

    sysutils/nut*: Add MANPAGES option

    Provide a MANPAGES option to allow users wishing a leaner install to
    deselect them.

    PR:             263751
    Reported by:    Joerg Pulz <Joerg.Pulz@frm2.tum.de>

 sysutils/nut-devel/Makefile  |   7 +-
 sysutils/nut-devel/pkg-plist | 296 +++++++++++++++++++++----------------------
 sysutils/nut/Makefile        |   7 +-
 sysutils/nut/pkg-plist       | 296 +++++++++++++++++++++----------------------
 4 files changed, 306 insertions(+), 300 deletions(-)
Comment 19 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=429c33beb4e96656d0bac5cc9dc1006670d1b62a

commit 429c33beb4e96656d0bac5cc9dc1006670d1b62a
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-03 15:53:38 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:26 +0000

    sysutils/nut*: Add license

    Add license definitions.

    PR:             263751
    Reported by:    Joerg Pulz <Joerg.Pulz@frm2.tum.de>

 sysutils/nut-devel/Makefile | 6 +++++-
 sysutils/nut/Makefile       | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)
Comment 20 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=18e2107b05e7f116596f177da4550a91ba6b9f02

commit 18e2107b05e7f116596f177da4550a91ba6b9f02
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-04 04:43:05 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:28 +0000

    sysutils/nut*: Pet portlint

    Adjust Makefile as suggested by portlint.

    PR:             263751

 sysutils/nut-devel/Makefile | 2 +-
 sysutils/nut/Makefile       | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
Comment 21 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f63fdcf8eaea50c190123b8ea00e3d7b4eaf32ef

commit f63fdcf8eaea50c190123b8ea00e3d7b4eaf32ef
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-04 03:22:28 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:27 +0000

    sysutils/nut*: Convert to options helpers

    Modernize the sysutils/nut* ports replacing old-school options with
    options helpers, cleaning up the Makefiles a lot.

    PR:             263751
    Reported by:    dizzy

 sysutils/nut-devel/Makefile  | 137 +++++++----------------
 sysutils/nut-devel/pkg-plist | 251 +++++++++++++++++++++---------------------
 sysutils/nut/Makefile        | 135 +++++++----------------
 sysutils/nut/pkg-plist       | 252 +++++++++++++++++++++----------------------
 4 files changed, 325 insertions(+), 450 deletions(-)
Comment 22 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=43094d715023b1ef9a233fa8ff35e73a01c29df9

commit 43094d715023b1ef9a233fa8ff35e73a01c29df9
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-03 15:28:37 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:26 +0000

    sysutils/nut: Remove redundant EXTRACT_ONLY definition

    EXTRACT_ONLY is redundant and does nothing in this port.

    PR:             263751
    Reported by:    Joerg Pulz <Joerg.Pulz@frm2.tum.de>

 sysutils/nut/Makefile | 1 -
 1 file changed, 1 deletion(-)
Comment 23 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:42 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f75bec470e4ef6b2fd72a0c40d8d28cb0e513a66

commit f75bec470e4ef6b2fd72a0c40d8d28cb0e513a66
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-04 03:58:24 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:27 +0000

    sysutils/nut: Remove redundant BUILD_DEPENDS

    Remove unused asciidoc BUILD_DEPENDS from sysutils/nut as its man pages
    are already preformatted.

    Also, add a comment to the sysutils/nut-devel port Makefile informing
    developers to remove the BUILD_DEPENDS when copying/merging the -devel
    port to the main port when a new release of nut is committed.

    PR:             263751
    Reported by:    Joerg Pulz <Joerg.Pulz@frm2.tum.de>

 sysutils/nut-devel/Makefile | 3 +++
 sysutils/nut/Makefile       | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
Comment 24 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3c17b06cc193f3f7b2175601ce0b4950ac07bf17

commit 3c17b06cc193f3f7b2175601ce0b4950ac07bf17
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-03 15:57:02 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:26 +0000

    sysutils/nut*: Use canned options descriptions

    Remove the descriptions already documented in Mk/bsd.options.desc.mk.

    PR:             263751
    Reported by:    Joerg Pulz <Joerg.Pulz@frm2.tum.de>

 sysutils/nut-devel/Makefile | 3 ---
 sysutils/nut/Makefile       | 3 ---
 2 files changed, 6 deletions(-)