Bug 267485 - [new port] sysutils/nut_exporter
Summary: [new port] sysutils/nut_exporter
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: Ronald Klop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-31 23:44 UTC by Jony Hudson
Modified: 2022-12-28 18:42 UTC (History)
3 users (show)

See Also:


Attachments
Patch file to add port (9.34 KB, patch)
2022-10-31 23:44 UTC, Jony Hudson
no flags Details | Diff
Patch to add sysutils/nut_exporter (9.34 KB, patch)
2022-12-17 21:15 UTC, Jony Hudson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jony Hudson 2022-10-31 23:44:20 UTC
Created attachment 237773 [details]
Patch file to add port

Patch to add a port for https://github.com/DRuggeri/nut_exporter which is a Prometheus (net-mgmt/prometheus2) exporter for the "Network UPS tools" (sysutils/nut).
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-11-01 02:50:11 UTC
(In reply to bsd from comment #0)
Thanks for porting this. If possible, please set your name in https://bugs.freebsd.org/bugzilla/userprefs.cgi?tab=account so we can use it in `git commit --author`
Comment 2 Jony Hudson 2022-11-01 09:07:35 UTC
Done :-)
Comment 3 Jony Hudson 2022-12-17 21:15:48 UTC
Created attachment 238879 [details]
Patch to add sysutils/nut_exporter

Update patch for 2.5.0 release.
Comment 4 Ronald Klop freebsd_committer freebsd_triage 2022-12-27 14:06:24 UTC
Port builds fine with poudriere stage-qa on aarch64/13.1.
Portlint gives some warnings. I will fix these.

[root@jail13 /usr/ports/sysutils/nut_exporter]# UNAME_r=13.1 portlint 
WARN: /usr/ports/sysutils/nut_exporter/pkg-descr: contains less than 2 lines, make it longer if possible.(currently 1 line)
WARN: /usr/ports/sysutils/nut_exporter/pkg-descr: includes lines that exceed 80 characters.
WARN: Makefile: [17]: use tab (not space) to make indentation
WARN: Makefile: [18]: use tab (not space) to make indentation
WARN: Makefile: [19]: use tab (not space) to make indentation
WARN: Makefile: [20]: use tab (not space) to make indentation
WARN: Makefile: [21]: use tab (not space) to make indentation
WARN: Makefile: [22]: use tab (not space) to make indentation
WARN: Makefile: [23]: use tab (not space) to make indentation
WARN: Makefile: [24]: use tab (not space) to make indentation
WARN: Makefile: [25]: use tab (not space) to make indentation
WARN: Makefile: [26]: use tab (not space) to make indentation
WARN: Makefile: [27]: use tab (not space) to make indentation
WARN: Makefile: [28]: use tab (not space) to make indentation
WARN: Makefile: [29]: use tab (not space) to make indentation
WARN: Makefile: [30]: use tab (not space) to make indentation
WARN: Makefile: [31]: use tab (not space) to make indentation
WARN: Makefile: [32]: use tab (not space) to make indentation
WARN: Makefile: [33]: use tab (not space) to make indentation
WARN: Makefile: COMMENT is not supposed to begin with 'A ', 'An ', or 'The '.
0 fatal errors and 20 warnings found.
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2022-12-27 16:01:11 UTC
PORTVERSION --> DISTVERSION
DISTVERSIONPREFIX should be defined befoe DISTVERSION (we need to update example in Porters Handbook)

It's not possible to use GO_MODULE ?
https://docs.freebsd.org/en/books/porters-handbook/book/#using-go

Best regards,
Daniel
Comment 6 Jony Hudson 2022-12-27 17:03:37 UTC
With the disclaimer that I know next-to-nothing about go's open-source packaging infrastructure ...

When I made the patch, I did search for a go module, but I could only find a very old version: https://pkg.go.dev/github.com/DRuggeri/nut_exporter . If I try to use GO_MODULE I get an error:

=> Attempting to fetch https://proxy.golang.org/github.com/!d!ruggeri/nut_exporter/@v/v2.5.0.mod
fetch: https://proxy.golang.org/github.com/!d!ruggeri/nut_exporter/@v/v2.5.0.mod: Not Found
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-12-28 16:32:14 UTC
A commit in branch main references this bug:

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

commit f9b0b82aa7592800fed91b535cab58c02f911316
Author:     Jony Hudson <jonyepsilon@google.com>
AuthorDate: 2022-12-27 14:16:26 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2022-12-28 16:31:05 +0000

    sysutils/nut_exporter: new port

    Add a port for https://github.com/DRuggeri/nut_exporter which is a
    Prometheus (net-mgmt/prometheus2) exporter for the "Network UPS tools"
    (sysutils/nut).

    PR:     267485
    Approved by: pkubaj (mentor)
    Differential Revision: https://reviews.freebsd.org/D37883

 sysutils/Makefile                                 |  1 +
 sysutils/nut_exporter/Makefile (new)              | 38 ++++++++++++
 sysutils/nut_exporter/distinfo (new)              | 37 ++++++++++++
 sysutils/nut_exporter/files/nut_exporter.in (new) | 73 +++++++++++++++++++++++
 sysutils/nut_exporter/pkg-descr (new)             |  4 ++
 5 files changed, 153 insertions(+)
Comment 8 Ronald Klop freebsd_committer freebsd_triage 2022-12-28 18:42:41 UTC
Committed. Thanks for the patches and testing.