summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornixo <nicolo@nixo.xyz>2020-10-27 10:56:35 +0100
committerGuix Patches Tester <>2020-11-14 16:47:13 +0000
commit92f55eeefd03f5986f53003f08c56b3af618a8a9 (patch)
treeaadb85c65603ec7e6352b98c1341de14f750fa3d
parenta35f3a423395d7acbf4c717140b3aeb484a25f64 (diff)
downloadguix-patches-92f55eeefd03f5986f53003f08c56b3af618a8a9.tar
guix-patches-92f55eeefd03f5986f53003f08c56b3af618a8a9.tar.gz
gnu: Add nut.series-5757
* gnu/packages/admin.scm (nut): New variable.
-rw-r--r--gnu/packages/admin.scm87
1 files changed, 87 insertions, 0 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index a65d45a960..eb37fdd385 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -35,6 +35,7 @@
;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
;;;
;;; 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")