From patchwork Sat Nov 14 16:45:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nicol=C3=B2_Balzarotti?= X-Patchwork-Id: 25126 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C503D27BBF6; Sat, 14 Nov 2020 16:46:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 60F3427BBF4 for ; Sat, 14 Nov 2020 16:46:13 +0000 (GMT) Received: from localhost ([::1]:46946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdygm-0004wz-Jn for patchwork@mira.cbaines.net; Sat, 14 Nov 2020 11:46:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdygc-0004wi-AW for guix-patches@gnu.org; Sat, 14 Nov 2020 11:46:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40251) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdygc-0006lD-0o for guix-patches@gnu.org; Sat, 14 Nov 2020 11:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdygb-0001Xi-Uu for guix-patches@gnu.org; Sat, 14 Nov 2020 11:46:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44258] Add Network UPS Tools Resent-From: =?utf-8?q?Nicol=C3=B2?= Balzarotti Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 Nov 2020 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Marius Bakke , 44258@debbugs.gnu.org Received: via spool by 44258-submit@debbugs.gnu.org id=B44258.16053723225882 (code B ref 44258); Sat, 14 Nov 2020 16:46:01 +0000 Received: (at 44258) by debbugs.gnu.org; 14 Nov 2020 16:45:22 +0000 Received: from localhost ([127.0.0.1]:51797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdyfy-0001Wo-3v for submit@debbugs.gnu.org; Sat, 14 Nov 2020 11:45:22 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:43791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdyfw-0001WY-DW for 44258@debbugs.gnu.org; Sat, 14 Nov 2020 11:45:21 -0500 Received: by mail-wr1-f50.google.com with SMTP id s8so13733342wrw.10 for <44258@debbugs.gnu.org>; Sat, 14 Nov 2020 08:45:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=mi/vzqMZqdmkKd9rObKtuAlnD04MxyGYlo49c1xMuJI=; b=L2WQdKGOQRJkoHQH6IDOHgdClYRoTavUqcy25E918mJflDnNLwmUuxWsCbBPO70e2L NEJuJcLdu/kbK6GajuCAX6ExqWmmXGk3qqABIjhHAHis7ExnAlrzdV984bSPEJjRf4px z7N2ebCJ1DSmRSm3NmwAlNXc6tK7DwyeDG7ZodMFq7U/J5eOjQi2gAO5F5ihAiUxgKg5 n+jlhPiNkMT4bm/Xq48YfnQiffg/OrEWgwXpGx9KvuSsGVU0E13qOsC0qxbRbdTSnirR HZ6G7HPy6hDCZCUNJktD3bvLkSexo87b5+WYC15GuJBYAaDgSuVZ3WbaR9sM/AmE11sO jZeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=mi/vzqMZqdmkKd9rObKtuAlnD04MxyGYlo49c1xMuJI=; b=eizdLFt4Shp2o/GlxZuclvAGRqHVjEOzRwuh6aL3w/ifqQtOFaC7P8F6BmQ+gYQjcy uoyqrhFxRFYxGRxS88rCsaKpCCSyur0oLZbg+c+QfvWwBbtzFZuhHDO7o8xy8tQDyLHu GKQQOiFDfQrQdkvp2rxzREgkMbrNePDxB1X5uYynj1w85+AlHn7b/lhvAfC969C4GOmd qL4o9RDSHDAQMcM/WGVM8zrRNGuXPhhDTqlPheMe5DQEhX3iirAXoxT+hqvINcCkgN1b wE/MnsesgTC/oFcHWluomQZaGxLWMUNmsPWJkfhn9yL5HtZ/PMYlMPNXKpAThKWPh3Ta d/iQ== X-Gm-Message-State: AOAM530hWhbqsBQLw6w+b7HCpO/wA37vThqJIiLmADNIjqnPu0thrhuC IyeG2VV/NZKE4g34GN+z1o5MgjhzmR0= X-Google-Smtp-Source: ABdhPJxHFTg+IuH2oIQAVg4cJwGHI5FAp9NRxDTHYSXwZ1YDuj/dXnytPn9TR8GR3T8CG+Axwa/JGQ== X-Received: by 2002:adf:db4a:: with SMTP id f10mr10217501wrj.420.1605372314160; Sat, 14 Nov 2020 08:45:14 -0800 (PST) Received: from guixSD (host-95-244-15-230.retail.telecomitalia.it. [95.244.15.230]) by smtp.gmail.com with ESMTPSA id v2sm15527231wrm.96.2020.11.14.08.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2020 08:45:13 -0800 (PST) From: =?utf-8?q?Nicol=C3=B2?= Balzarotti In-Reply-To: <87h7pxdm10.fsf@gnu.org> References: <87lffrmyvp.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> <87h7pxdm10.fsf@gnu.org> Date: Sat, 14 Nov 2020 17:45:11 +0100 Message-ID: <87sg9b99bc.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, thanks for the reply. Marius Bakke writes: > > Avoid hard-coding versions in URLs. You can use the version-major+minor > procedure to create that "2.7" URL component. Done! > This got merged in 2017, and still not released! > > Looking at the pull request[0], this URL is a squashed version of 7 > commits. While convenient, this trick has failed before due to subtle > changes in GitHub machinery, eventually leading to a hash mismatch[1]. > > Taking 7 patches directly is no fun either, so I wonder if we can just > stick with OpenSSL 1.0 for now? > Fine! Using openssl-1.0 now. >> + ;; powerman is required (where is it hosted?) >> + "--without-powerman" > > Can you elaborate on powerman being required? Is the package not usable > without it? > Expanded a bit, following nut readme. >> + ;; cgi requires libgd >> + "--without-cgi") > > We do have libgd (in the 'gd' package). > Oh, I don't know how I missed it. Added! Now cgi is working (output is in folder /cgi-bin, is this correct for guix?) Since nut release is really old, it used to use gdlib-config. It has been removed and replaced by pkg-config. However, the patch [1] does not apply. So I had to do the "terrible" fix of calling pkg-config myself (in the new "fix-ligdb-check" phase). Terrible because I wanted to call it in guile and save the output to the file, but the only way I know of is with popen (and I could not find another package doing this (while some package like python-libmpsse are just inserting the call like I did here). >> + #:phases >> + (modify-phases %standard-phases >> + (add-before 'configure 'update-configure >> + ;; required to apply the patch to the ./configure script >> + (lambda _ >> + (invoke "autoconf")))))) > > This may not be necessary due to the 'bootstrap' phase (but I haven't > verified). > Well, now that I switched to openssl-1.0 it sure is not needed anymore. But previously I remember without the autoreconf call, it was not working. >> + (native-inputs `(("autoconf" ,autoconf)n >> + ("cppunit" ,cppunit) >> + ("pkg-config" ,pkg-config))) >> + (inputs `(("avahi" ,avahi) >> + ("libusb" ,libusb-compat) >> + ("libltdl" ,libltdl) >> + ("freeipmi" ,freeipmi) >> + ("neon" ,neon) >> + ("openssl" ,openssl) >> + ("net-snmp" ,net-snmp))) > > The indentation of these are a bit weird. :-) > ops :) >> + (home-page "https://networkupstools.org") >> + (license >> + (list >> + ;; - most files under gpl2+ >> + license:gpl2+ >> + ;; - scripts/python/ under gpl3+ >> + license:gpl3+ >> + ;; - scripts/perl/Nut.pm same as perl (either gpl1+ or artistic) >> + license:gpl1+ license:artistic2.0)) > > Great job at listing licenses! > >> + (synopsis "Collection of programs for monitoring and administering UPS") >> + (description "Network UPS Tools is a collection of programs which provide >> +a common interface for monitoring and administering UPS, PDU and SCD hardware. >> +It uses a layered approach to connect all of the parts. Drivers are provided >> +for a wide assortment of equipment."))) > > Maybe add @acronym{UPS, Uninterruptible Power Supply}, > @acronym{PDU, ...} etc, but no strong opinion. > Sure! > Can you send an updated patch? I also added the phase "fix-search-paths" which fixes nut-scanner. nut scanner now finds my ups device (but I still could not get it to work, not sure if the problem is in my config or in this package. I'd wait to merge this until someone can try. Thanks again, Nicolò [1] https://github.com/networkupstools/nut/pull/809/commits/cb507c44d26d8ae04a0cc3d1c24e79e3bf33ba23 From baf9ef419fb36a2198597894c72b23d8553b012a Mon Sep 17 00:00:00 2001 From: nixo Date: Tue, 27 Oct 2020 10:56:35 +0100 Subject: [PATCH v2] gnu: Add nut. * gnu/packages/admin.scm (nut): New variable. --- gnu/packages/admin.scm | 87 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 8dcf8afd84..5f14c4b68a 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -35,6 +35,7 @@ ;;; Copyright © 2020 Michael Rohleder ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 Morgan Smith +;;; Copyright © 2020 Nicolò Balzarotti ;;; ;;; This file is part of GNU Guix. ;;; @@ -70,6 +71,7 @@ #:use-module (gnu packages algebra) #:use-module (gnu packages autogen) #:use-module (gnu packages autotools) + #:use-module (gnu packages avahi) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bison) @@ -85,8 +87,10 @@ #:use-module (gnu packages elf) #:use-module (gnu packages file) #:use-module (gnu packages flex) + #:use-module (gnu packages freeipmi) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) + #:use-module (gnu packages gd) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) @@ -110,6 +114,7 @@ #:use-module (gnu packages mcrypt) #:use-module (gnu packages mpi) #:use-module (gnu packages ncurses) + #:use-module (gnu packages networking) #:use-module (gnu packages openldap) #:use-module (gnu packages patchutils) #:use-module (gnu packages pciutils) @@ -880,6 +885,88 @@ IPv6, proxies, and Unix sockets.") (license (list license:bsd-3 license:bsd-2)))) ; atomicio.*, socks.c +(define-public nut + (package + (name "nut") + (version "2.7.4") + (source + (origin + (method url-fetch) + (uri (string-append + "https://networkupstools.org/source/" (version-major+minor version) + "/nut-" version ".tar.gz")) + (sha256 + (base32 + "19r5dm07sfz495ckcgbfy0pasx0zy3faa0q7bih69lsjij8q43lq")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + `("--with-all" + "--with-openssl" + ;; nut supports a bridge to the powerman-daemon to handle + ;; powerman-supported devices. For this bridge, powerman is + ;; required. + "--without-powerman" + ,(string-append "--with-udev-dir=" + (assoc-ref %outputs "out") + "/lib/udev")) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'fix-libgd-check + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "configure" + (("-L/usr/X11R6/lib") + ;; without --static, it won't find zlib and libjpeg + "$(pkg-config --static --libs gdlib)")) + #t)) + (add-before 'build 'fix-search-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; nutscan will search libraries only under output/lib, and in + ;; some standard path (e.g., /usr/lib). Add correct paths here + (substitute* "tools/nut-scanner/nutscan-init.c" + (("LIBDIR,") + (string-append + "LIBDIR,\n" + (string-join + (map (lambda (label) + (string-append "\"" (assoc-ref inputs label) "/lib/\"")) + '("avahi" "freeipmi" "libusb" "neon" "net-snmp")) + ",\n") + ",\n"))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("cppunit" ,cppunit) + ("pkg-config" ,pkg-config))) + (inputs + `(("avahi" ,avahi) + ("libusb" ,libusb-compat) + ("libltdl" ,libltdl) + ;; libxpm and libx11 required when cgi is enabled + ("libxpm" ,libxpm) + ("libx11" ,libx11) + ("freeipmi" ,freeipmi) + ("gd" ,gd) + ("neon" ,neon) + ("openssl" ,openssl-1.0) + ("net-snmp" ,net-snmp))) + (home-page "https://networkupstools.org") + (license + (list + ;; - most files under gpl2+ + license:gpl2+ + ;; - scripts/python/ under gpl3+ + license:gpl3+ + ;; - scripts/perl/Nut.pm same as perl (either gpl1+ or artistic) + license:gpl1+ license:artistic2.0)) + (synopsis "Collection of programs for monitoring and administering UPS") + (description "Network @acronym{UPS, Uninterruptible Power Supply} Tools is +a collection of programs which provide a common interface for monitoring and +administering @acronym{UPS} @acronym{PDU,Power Distribution Unit} and +@acronym{SCD, Solar Controller Device} hardware. It uses a layered approach +to connect all of the parts. Drivers are provided for a wide assortment of +equipment."))) + (define-public sipcalc (package (name "sipcalc") -- 2.29.2