From f6642aaf8b64bf6f74483938928f70452a3d79bc Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Mon, 10 Jul 2023 16:51:30 +0200 Subject: [PATCH 1/8] perlPackages.ProcDaemon: init at 0.23 --- pkgs/top-level/perl-packages.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index d35504c58931..4a18417480d0 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -20734,6 +20734,21 @@ with self; { }; }; + ProcDaemon = buildPerlPackage { + pname = "Proc-Daemon"; + version = "0.23"; + src = fetchurl { + url = "mirror://cpan/authors/id/A/AK/AKREAL/Proc-Daemon-0.23.tar.gz"; + hash = "sha256-NMC4W3lItDHLq8l87lgINeUVzPQ7rb2DOesQlHQIm2k="; + }; + buildInputs = [ ProcProcessTable ]; + meta = { + description = "Run Perl program(s) as a daemon process"; + homepage = "https://github.com/akreal/Proc-Daemon"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + ProcFind = buildPerlPackage { pname = "Proc-Find"; version = "0.051"; From 3c7dd692d3f6eb59042d922ac3f093a2b5e50cd4 Mon Sep 17 00:00:00 2001 From: Matthias Thym Date: Mon, 10 Jul 2023 16:52:42 +0200 Subject: [PATCH 2/8] perlPackages.ProcPIDFile: init at 1.29 --- pkgs/top-level/perl-packages.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 4a18417480d0..ee61cdcfb4d3 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -20749,6 +20749,20 @@ with self; { }; }; + ProcPIDFile = buildPerlPackage { + pname = "Proc-PID-File"; + version = "1.29"; + src = fetchurl { + url = "mirror://cpan/authors/id/D/DM/DMITRI/Proc-PID-File-1.29.tar.gz"; + hash = "sha256-O87aSd8YLT2BaLcMKlGyBW8v1FlQptBCipmS/TVc1KQ="; + }; + meta = { + description = "Manage process id files"; + homepage = "https://github.com/dtikhonov/Proc-PID-File"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + ProcFind = buildPerlPackage { pname = "Proc-Find"; version = "0.051"; From b4d5e89f9e2484b93f2b5f522203423d6af59712 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 13:27:12 +0100 Subject: [PATCH 3/8] perlPackages.ParseEDID: init at 1.0.7 https://metacpan.org/pod/Parse::EDID --- pkgs/top-level/perl-packages.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index ee61cdcfb4d3..75a0da4dba05 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -19665,6 +19665,20 @@ with self; { }; }; + ParseEDID = buildPerlPackage { + pname = "Parse-Edid"; + version = "1.0.7"; + src = fetchurl { + url = "mirror://cpan/authors/id/G/GR/GROUSSE/Parse-EDID-1.0.7.tar.gz"; + hash = "sha256-GtwPEFoyGYoqK02lsOD5hfBe/tmc42YZCnkOFl1nW/E="; + }; + buildInputs = [ TestWarn ]; + meta = { + description = "Extended display identification data (EDID) parser"; + license = lib.licenses.gpl3Plus; + }; + }; + ParseDebControl = buildPerlPackage { pname = "Parse-DebControl"; version = "2.005"; From db05c27629a01abf6249cacbb01e10d9d1edee90 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 14:54:42 +0100 Subject: [PATCH 4/8] perlPackages.NetCUPS: init at 0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://metacpan.org/pod/Net::CUPS² --- pkgs/top-level/perl-packages.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 75a0da4dba05..a0e485e38a37 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -18303,6 +18303,22 @@ with self; { }; }; + NetCUPS = buildPerlPackage { + pname = "Net-CUPS"; + version = "0.64"; + src = fetchurl { + url = "mirror://cpan/authors/id/N/NI/NINE/Net-CUPS-0.64.tar.gz"; + hash = "sha256-17x3/w9iv4dMhDxZDrEqgLvUR0mi+3Tb7URcNdDoWoU="; + }; + buildInputs = [ pkgs.cups pkgs.cups-filters ]; + NIX_CFLAGS_LINK = "-L${lib.getLib pkgs.cups}/lib -lcups"; + meta = { + description = "Common Unix Printing System Interface"; + homepage = "https://github.com/niner/perl-Net-CUPS"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + NetDBus = buildPerlPackage { pname = "Net-DBus"; version = "1.2.0"; From 47d3ce69dc74012708636ea6dbc84d2c429a9c80 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 22:03:28 +0100 Subject: [PATCH 5/8] perlPackages.MacSysProfile: init at 0.05 https://metacpan.org/pod/Mac::SysProfile --- pkgs/top-level/perl-packages.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index a0e485e38a37..3051a19010b1 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -14657,6 +14657,21 @@ with self; { }; }; + MacSysProfile = buildPerlPackage { + pname = "Mac-SysProfile"; + version = "0.05"; + src = fetchurl { + url = "mirror://cpan/authors/id/D/DM/DMUEY/Mac-SysProfile-0.05.tar.gz"; + hash = "sha256-QDOXa3dbOcwqaTtyoC1l71p7oDveTU2w3/RuEmx9n2w="; + }; + propagatedBuildInputs = [ MacPropertyList ]; + meta = { + description = "Perl extension for OS X system_profiler"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + platforms = lib.platforms.darwin; + }; + }; + MailAuthenticationResults = buildPerlPackage { pname = "Mail-AuthenticationResults"; version = "1.20200824.1"; From c4dab4b230907dfc2f2f4df51d66037318588032 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 22:13:47 +0100 Subject: [PATCH 6/8] perlPackages.XMLEntities: init at 1.0002 https://metacpan.org/pod/XML::Entities --- pkgs/top-level/perl-packages.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 3051a19010b1..3952e67501ed 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -28093,6 +28093,24 @@ with self; { }; }; + XMLEntities = buildPerlPackage { + pname = "XML-Entities"; + version = "1.0002"; + src = fetchurl { + url = "mirror://cpan/authors/id/S/SI/SIXTEASE/XML-Entities-1.0002.tar.gz"; + hash = "sha256-wyqk8wlXPXZIqy5Bb2K2sgZS8q2c/T7sgv1REB/nMQ0="; + }; + nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang; + propagatedBuildInputs = [ LWP ]; + postInstall = lib.optionalString stdenv.isDarwin '' + shortenPerlShebang $out/bin/download-entities.pl + ''; + meta = { + description = "Mapping of XML entities to Unicode"; + license = with lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + XMLDOM = buildPerlPackage { pname = "XML-DOM"; version = "1.46"; From f35eefd3d603ca5dd65a55ddf323af48fbb947db Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 22:20:03 +0100 Subject: [PATCH 7/8] perlPackages.MacPropertyList: init at 1.504 https://github.com/briandfoy/mac-propertylist --- pkgs/top-level/perl-packages.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 3952e67501ed..7a0db7fa2165 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -14657,6 +14657,21 @@ with self; { }; }; + MacPropertyList = buildPerlPackage { + pname = "Mac-PropertyList"; + version = "1.504"; + src = fetchurl { + url = "mirror://cpan/authors/id/B/BD/BDFOY/Mac-PropertyList-1.504.tar.gz"; + hash = "sha256-aIl96Yw2j76c22iF1H3qADxG7Ho3MmNSPvZkVwc7eq4="; + }; + propagatedBuildInputs = [ XMLEntities ]; + meta = { + description = "Work with Mac plists at a low level"; + homepage = "https://github.com/briandfoy/mac-propertylist"; + license = lib.licenses.artistic2; + }; + }; + MacSysProfile = buildPerlPackage { pname = "Mac-SysProfile"; version = "0.05"; From 5954b622091ba75b90e9de221e45beeb3e417422 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 29 Oct 2023 13:27:27 +0100 Subject: [PATCH 8/8] ocsinventory-agent: init at 2.10.1 https://github.com/OCSInventory-NG/UnixAgent Co-authored-by: Matthias Thym --- .../by-name/oc/ocsinventory-agent/package.nix | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 pkgs/by-name/oc/ocsinventory-agent/package.nix diff --git a/pkgs/by-name/oc/ocsinventory-agent/package.nix b/pkgs/by-name/oc/ocsinventory-agent/package.nix new file mode 100644 index 000000000000..0240966e2d86 --- /dev/null +++ b/pkgs/by-name/oc/ocsinventory-agent/package.nix @@ -0,0 +1,102 @@ +{ lib +, stdenv +, perlPackages +, fetchFromGitHub +, makeWrapper +, shortenPerlShebang +, coreutils +, dmidecode +, findutils +, inetutils +, ipmitool +, iproute2 +, lvm2 +, nmap +, pciutils +, usbutils +, util-linux +, testers +, ocsinventory-agent +, nix-update-script +}: + +perlPackages.buildPerlPackage rec { + version = "2.10.1"; + pname = "ocsinventory-agent"; + + src = fetchFromGitHub { + owner = "OCSInventory-NG"; + repo = "UnixAgent"; + rev = "refs/tags/v${version}-MAC"; + hash = "sha256-aFzBrUsVttUhpYGEYd/yYuXmE90PGCiBmBsVjtHcHLg="; + }; + + nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isDarwin shortenPerlShebang; + + buildInputs = with perlPackages; [ + perl + DataUUID + IOCompress + IOSocketSSL + LWP + LWPProtocolHttps + NetIP + NetNetmask + NetSNMP + ParseEDID + ProcDaemon + ProcPIDFile + XMLSimple + ] ++ lib.optionals stdenv.isLinux (with perlPackages; [ + NetCUPS # cups-filters is broken on darwin + ]) ++ lib.optionals stdenv.isDarwin (with perlPackages; [ + MacSysProfile + ]); + + postInstall = let + runtimeDependencies = [ + coreutils # uname, cut, df, stat, uptime + findutils # find + inetutils # ifconfig + ipmitool # ipmitool + nmap # nmap + pciutils # lspci + ] ++ lib.optionals stdenv.isLinux [ + dmidecode # dmidecode + iproute2 # ip + lvm2 # pvs + usbutils # lsusb + util-linux # last, lsblk, mount + ]; + in lib.optionalString stdenv.isDarwin '' + shortenPerlShebang $out/bin/ocsinventory-agent + '' + '' + wrapProgram $out/bin/ocsinventory-agent --prefix PATH : ${lib.makeBinPath runtimeDependencies} + ''; + + passthru = { + tests.version = testers.testVersion { + package = ocsinventory-agent; + command = "ocsinventory-agent --version"; + # upstream has not updated version in lib/Ocsinventory/Agent/Config.pm + version = "2.10.0"; + }; + updateScript = nix-update-script { }; + }; + + meta = with lib; { + description = "OCS Inventory unified agent for Unix operating systems"; + longDescription = '' + Open Computers and Software Inventory (OCS) is an application designed + to help a network or system administrator to keep track of the hardware and + software configurations of computers that are installed on the network. + ''; + homepage = "https://ocsinventory-ng.org"; + changelog = "https://github.com/OCSInventory-NG/UnixAgent/releases/tag/v${version}"; + downloadPage = "https://github.com/OCSInventory-NG/UnixAgent/releases"; + license = licenses.gpl2Only; + mainProgram = "ocsinventory-agent"; + maintainers = with maintainers; [ totoroot anthonyroussel ]; + platforms = platforms.unix; + }; +}