From unknown Sun Aug 17 10:21:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#37886] [PATCH] gnu: Add ipcalc. Resent-From: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Oct 2019 14:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37886@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15718398192055 (code B ref -1); Wed, 23 Oct 2019 14:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Oct 2019 14:10:19 +0000 Received: from localhost ([127.0.0.1]:34731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNHL8-0000X3-LD for submit@debbugs.gnu.org; Wed, 23 Oct 2019 10:10:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:56857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNGvt-0005q3-NJ for submit@debbugs.gnu.org; Wed, 23 Oct 2019 09:44:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49069) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNGvs-0001Im-1c for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNGvq-00040w-KY for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:11 -0400 Received: from ciffreo.uberspace.de ([185.26.156.173]:41808) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNGvq-00040M-Au for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:10 -0400 Received: (qmail 18761 invoked from network); 23 Oct 2019 13:44:08 -0000 Received: from unknown (HELO ?10.30.0.173?) (15.203.178.50) by ciffreo.uberspace.de with SMTP; 23 Oct 2019 13:44:08 -0000 From: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Message-ID: Date: Wed, 23 Oct 2019 15:44:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 185.26.156.173 X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Wed, 23 Oct 2019 10:10:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, here's my first patch to guix - please let me know whether everything's okay. It adds the ipcalc package which can calculate IP ranges. Example: $ /gnu/store/7jw45m8d1hcaihnr7978qqg1didl048a-ipcalc-0.41/bin/ipcalc 192.168.0.1/24 Address: 192.168.0.1 11000000.10101000.00000000. 00000001 Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000 Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111 => Network: 192.168.0.0/24 11000000.10101000.00000000. 00000000 HostMin: 192.168.0.1 11000000.10101000.00000000. 00000001 HostMax: 192.168.0.254 11000000.10101000.00000000. 11111110 Broadcast: 192.168.0.255 11000000.10101000.00000000. 11111111 Hosts/Net: 254 Class C, Private Internet * gnu/packages/ipcalc.scm (ipcalc): New file. --- gnu/packages/ipcalc.scm | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gnu/packages/ipcalc.scm diff --git a/gnu/packages/ipcalc.scm b/gnu/packages/ipcalc.scm new file mode 100644 index 0000000000..5f83389b25 --- /dev/null +++ b/gnu/packages/ipcalc.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Daniel Schaefer +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages ipcalc) + #:use-module (gnu packages perl) + #:use-module (gnu packages) + #:use-module (guix download) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix build-system gnu)) + +(define-public ipcalc + (package + (name "ipcalc") + (version "0.41") + (source (origin + (method url-fetch) + (uri (string-append "http://jodies.de/ipcalc-archive/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "12if9sm8h2ac0pgwkw835cgyqjxm6h27k4kfn2vfas9krrqwbafx")))) + (inputs `(("perl" ,perl))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; No test suite + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out-bin (string-append + (assoc-ref outputs "out") + "/bin"))) + (install-file "ipcalc" out-bin) + #t)))))) + (synopsis "Simple IP network calculator") + (description "ipcalc takes an IP address and netmask and calculates the + resulting broadcast, network, Cisco wildcard mask, and host + range. By giving a second netmask, you can design subnets and + supernets. It is also intended to be a teaching tool and + presents the subnetting results as easy-to-understand binary + values.") + (home-page "http://jodies.de/ipcalc") + (license gpl2+))) -- 2.23.0 From unknown Sun Aug 17 10:21:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#37886] [PATCH] gnu: Add ipcalc. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 24 Oct 2019 15:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37886@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Cc: 37886@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15719299706379 (code B ref -1); Thu, 24 Oct 2019 15:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Oct 2019 15:12:50 +0000 Received: from localhost ([127.0.0.1]:36773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNenC-0001ep-BN for submit@debbugs.gnu.org; Thu, 24 Oct 2019 11:12:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:49129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNenB-0001eh-22 for submit@debbugs.gnu.org; Thu, 24 Oct 2019 11:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45772) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNen9-0008S9-N7 for guix-patches@gnu.org; Thu, 24 Oct 2019 11:12:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNen8-0007lM-Hd for guix-patches@gnu.org; Thu, 24 Oct 2019 11:12:47 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNen8-0007jH-BD for guix-patches@gnu.org; Thu, 24 Oct 2019 11:12:46 -0400 Received: by mail-wr1-x444.google.com with SMTP id t16so21388956wrr.1 for ; Thu, 24 Oct 2019 08:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=icrS+YQeVmhK47tox5cEEr5JIjm12wYG3JZyr7omstY=; b=n0mKkekGLygga+WPZN7DAjiu1bdgIzvDm2nRwNzE4O22veCwt3kV4zEJZQDiBfY4U7 GTQ3tW8iX7jqXdOUGQaWvLM3SY7j8Rt2EtgddOR/L/B7d3Bxw0uMqmnSntahkf/pa5Mm /wf/hlJBEQOVsAgPVrJpONTQlowpd8kbRguwnZtARjtqNTZK93FJjKKWKrENPNqyBtSq MGgdjfXd4lb6dB/O+yDpFT2QnvLM6+GtaGCo5hkl2AeDmiaCUgwfT7i+VAxBP3kOQ7Cn i2UvaNzwCPM0tg8pi6nmAa6HtLjIoJu77HRjZO9N+m2hV6zduV9xfpNkfiYddVJpDCVZ ncUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=icrS+YQeVmhK47tox5cEEr5JIjm12wYG3JZyr7omstY=; b=AmnYejbZWror6rM9gPmqNRTNOQ/xy8/KHT8QR4VAjZSN8s2yeRydky0JyOvnMPRalF GrcA6IRIlmRUYmZRzQ3yBuhtE9Yi+oxjaghdKTzXWuXcb5yn2uPYiYvgztgFNcmWD6IR WJXHQwm5KdfEWKkF7FnWdzemdFVBN7xzPBGqceQh254vAf7yhpXraE1TvKGqOxN7xNFt ZqpvGRdh21y7OqtMVw7VpRvmWD7hOkv2vW8eSO4UtAw4WHQY/7qdvcCoRkOG9NZc73Ck kU4CP74l/RQNgV5vXMBvtxAGYA1hXeueC2T0Vn+IH/Z5lC2Yv1rpKVayk3U6BE4n4nvb Vhkg== X-Gm-Message-State: APjAAAW+ZHppAfnqM76rmzQICKbOD+XnzbxQMsQ201bmmH9Cop7zPd+F CbN5NR2wecK2w86vlzLxWJU= X-Google-Smtp-Source: APXvYqx/V4sqyZdyQD8S4uBi8+RBwvyiXuJ9xNr2/W1yW3tMOECDbA9aqcwsjjW0u1Vx3//lv5YnFw== X-Received: by 2002:adf:f010:: with SMTP id j16mr4446382wro.317.1571929964362; Thu, 24 Oct 2019 08:12:44 -0700 (PDT) Received: from PF1S5GG2 (lfbn-ann-1-367-71.w86-200.abo.wanadoo.fr. [86.200.83.71]) by smtp.gmail.com with ESMTPSA id z13sm29242454wrm.64.2019.10.24.08.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 08:12:43 -0700 (PDT) References: User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe In-reply-to: Date: Thu, 24 Oct 2019 17:12:37 +0200 Message-ID: <87zhhqyy6y.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hello Daniel, > here's my first patch to guix - please let me know whether everything's okay. > It adds the ipcalc package which can calculate IP ranges. Example: Welcome to Guix :) This first patch looks fine, I just have two remarks. > new file mode 100644 > index 0000000000..5f83389b25 > --- /dev/null > +++ b/gnu/packages/ipcalc.scm I think you can use the existing networking.scm for this tool. > + (description "ipcalc takes an IP address and netmask and calculates the > + resulting broadcast, network, Cisco wildcard mask, and host > + range. By giving a second netmask, you can design subnets and > + supernets. It is also intended to be a teaching tool and > + presents the subnetting results as easy-to-understand binary > + values.") The indentation is not correct here. You can use M-q if you are using emacs or indent.el script otherwise (see: https://guix.gnu.org/manual/en/html_node/Formatting-Code.html). Can you please send an updated patch? Thanks, Mathieu From unknown Sun Aug 17 10:21:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#37886] [PATCH] gnu: Add ipcalc. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Nov 2019 23:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Cc: 37886@debbugs.gnu.org, Mathieu Othacehe Received: via spool by 37886-submit@debbugs.gnu.org id=B37886.157472536229085 (code B ref 37886); Mon, 25 Nov 2019 23:43:01 +0000 Received: (at 37886) by debbugs.gnu.org; 25 Nov 2019 23:42:42 +0000 Received: from localhost ([127.0.0.1]:49949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZO0A-0007Z3-3N for submit@debbugs.gnu.org; Mon, 25 Nov 2019 18:42:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iZO08-0007Yr-SZ for 37886@debbugs.gnu.org; Mon, 25 Nov 2019 18:42:41 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iZO03-0002tc-9Q; Mon, 25 Nov 2019 18:42:35 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=46992 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iZO02-0003NL-Sw; Mon, 25 Nov 2019 18:42:35 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87zhhqyy6y.fsf@gmail.com> Date: Tue, 26 Nov 2019 00:42:32 +0100 In-Reply-To: <87zhhqyy6y.fsf@gmail.com> (Mathieu Othacehe's message of "Thu, 24 Oct 2019 17:12:37 +0200") Message-ID: <87a78jttef.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Daniel, Did you have a chance to look into the suggestions Mathieu made? See . Thanks in advance! :-) Ludo=E2=80=99. Mathieu Othacehe skribis: > Hello Daniel, > >> here's my first patch to guix - please let me know whether everything's = okay. >> It adds the ipcalc package which can calculate IP ranges. Example: > > Welcome to Guix :) This first patch looks fine, I just have two remarks. > >> new file mode 100644 >> index 0000000000..5f83389b25 >> --- /dev/null >> +++ b/gnu/packages/ipcalc.scm > > I think you can use the existing networking.scm for this tool. > >> + (description "ipcalc takes an IP address and netmask and calculates= the >> + resulting broadcast, network, Cisco wildcard mask, and= host >> + range. By giving a second netmask, you can design sub= nets and >> + supernets. It is also intended to be a teaching tool = and >> + presents the subnetting results as easy-to-understand = binary >> + values.") > > The indentation is not correct here. You can use M-q if you are using > emacs or indent.el script otherwise (see: > https://guix.gnu.org/manual/en/html_node/Formatting-Code.html). > > Can you please send an updated patch? > > Thanks, > > Mathieu From unknown Sun Aug 17 10:21:43 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#37886] [PATCH] gnu: Add ipcalc. Resent-From: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 Dec 2019 17:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37886 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 37886@debbugs.gnu.org, Mathieu Othacehe Received: via spool by 37886-submit@debbugs.gnu.org id=B37886.157522013130837 (code B ref 37886); Sun, 01 Dec 2019 17:09:01 +0000 Received: (at 37886) by debbugs.gnu.org; 1 Dec 2019 17:08:51 +0000 Received: from localhost ([127.0.0.1]:36621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibSiI-00081I-KT for submit@debbugs.gnu.org; Sun, 01 Dec 2019 12:08:51 -0500 Received: from ciffreo.uberspace.de ([185.26.156.173]:49842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibS93-0006y7-Ql for 37886@debbugs.gnu.org; Sun, 01 Dec 2019 11:32:26 -0500 Received: (qmail 7699 invoked from network); 1 Dec 2019 16:32:24 -0000 Received: from unknown (HELO ?IPv6:2001:4ca0:0:f234:a48c:c796:ca75:dcf5?) (2001:4ca0::f234:a48c:c796:ca75:dcf5) by ciffreo.uberspace.de with SMTP; 1 Dec 2019 16:32:24 -0000 References: <87zhhqyy6y.fsf@gmail.com> <87a78jttef.fsf@gnu.org> From: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Message-ID: Date: Sun, 1 Dec 2019 17:32:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <87a78jttef.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Mailman-Approved-At: Sun, 01 Dec 2019 12:08:49 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Ludo and Matthieu, thanks for taking a look. Sorry, I did not receive Matthieu's answer and I'm not subscribed to the patches ML. It seems that etc/indent-code.el does not correct that particular formatting difference, which I had in my description attribute. I corrected it manually, according to what the other packages look like. It's also moved into networking.scm. off-topic @Ludo, What's the language of your MUA? Ido? (https://en.wiktionary.org/wiki/skribis) --8<---------------cut here---------------start------------->8--- >From b511c6a206cb61c22f3da3d6682bfc2a37035463 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Wed, 23 Oct 2019 15:29:48 +0200 Subject: [PATCH] gnu: Add ipcalc. * gnu/packages/networking.scm (ipcalc): New variable. --- gnu/packages/networking.scm | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index 1b31314485..13728038d8 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -34,6 +34,7 @@ ;;; Copyright © 2019 Tonton ;;; Copyright © 2019 Alex Griffin ;;; Copyright © 2019 Jan Wielkiewicz +;;; Copyright © 2019 Daniel Schaefer ;;; ;;; This file is part of GNU Guix. ;;; @@ -61,6 +62,7 @@ #:use-module (guix build-system go) #:use-module (guix build-system perl) #:use-module (guix build-system python) + #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages adns) @@ -2778,3 +2780,55 @@ a service (such as an HTTP or SSH server) on localhost visible to the wider Internet, even behind NAT or restrictive firewalls. A managed front-end relay service is available at @url{https://pagekite.net/}, or you can run your own.") (license license:agpl3+))) + +(define-public ipcalc + (package + (name "ipcalc") + (version "0.41") + (source (origin + (method url-fetch) + (uri (string-append "http://jodies.de/ipcalc-archive/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "12if9sm8h2ac0pgwkw835cgyqjxm6h27k4kfn2vfas9krrqwbafx")))) + (inputs `(("perl" ,perl) + ("tar" ,tar) + ("gzip" ,gzip) + ("tarball" ,source))) + (build-system trivial-build-system) ; no Makefile.PL + (arguments + '(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (use-modules (srfi srfi-1)) + (let* ((tarball (assoc-ref %build-inputs "tarball")) + (perl (string-append (assoc-ref %build-inputs + "perl") + "/bin")) + (gzip (string-append (assoc-ref %build-inputs + "gzip") + "/bin/gzip")) + (tar (string-append (assoc-ref %build-inputs + "tar") + "/bin/tar")) + (out (assoc-ref %outputs "out")) + (bin (string-append out "/bin")) + (doc (string-append out "/share/doc/ipcalc"))) + (copy-file tarball "ipcalc.tar.gz") + (invoke gzip "-d" "ipcalc.tar.gz") + (invoke tar "xvf" "ipcalc.tar") + + (mkdir-p bin) + (install-file "ipcalc-0.41/ipcalc" bin) + (patch-shebang (string-append bin "/ipcalc") (list perl)) + (install-file "ipcalc-0.41/ipcalc" doc) + #t)))) + (synopsis "Simple IP network calculator") + (description "ipcalc takes an IP address and netmask and calculates the +resulting broadcast, network, Cisco wildcard mask, and host range. By giving a +second netmask, you can design subnets and supernets. It is also intended to be +a teaching tool and presents the subnetting results as easy-to-understand +binary values.") + (home-page "http://jodies.de/ipcalc") + (license gpl2+))) -- 2.23.0 --8<---------------cut here---------------end------------->8--- Thanks, Daniel On 11/26/19 12:42 AM, Ludovic Courtès wrote: > Hello Daniel, > > Did you have a chance to look into the suggestions Mathieu made? > See . > > Thanks in advance! :-) > > Ludo’. > > Mathieu Othacehe skribis: > >> Hello Daniel, >> >>> here's my first patch to guix - please let me know whether everything's okay. >>> It adds the ipcalc package which can calculate IP ranges. Example: >> >> Welcome to Guix :) This first patch looks fine, I just have two remarks. >> >>> new file mode 100644 >>> index 0000000000..5f83389b25 >>> --- /dev/null >>> +++ b/gnu/packages/ipcalc.scm >> >> I think you can use the existing networking.scm for this tool. >> >>> + (description "ipcalc takes an IP address and netmask and calculates the >>> + resulting broadcast, network, Cisco wildcard mask, and host >>> + range. By giving a second netmask, you can design subnets and >>> + supernets. It is also intended to be a teaching tool and >>> + presents the subnetting results as easy-to-understand binary >>> + values.") >> >> The indentation is not correct here. You can use M-q if you are using >> emacs or indent.el script otherwise (see: >> https://guix.gnu.org/manual/en/html_node/Formatting-Code.html). >> >> Can you please send an updated patch? >> >> Thanks, >> >> Mathieu From unknown Sun Aug 17 10:21:43 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel =?UTF-8?Q?Sch=C3=A4fer?= Subject: bug#37886: closed (Re: [bug#37886] [PATCH] gnu: Add ipcalc.) Message-ID: References: <878snvkv0b.fsf@gmail.com> X-Gnu-PR-Message: they-closed 37886 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 37886@debbugs.gnu.org Date: Mon, 02 Dec 2019 08:11:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1575274262-2853-1" This is a multi-part message in MIME format... ------------=_1575274262-2853-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #37886: [PATCH] gnu: Add ipcalc. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 37886@debbugs.gnu.org. --=20 37886: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37886 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1575274262-2853-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 37886-done) by debbugs.gnu.org; 2 Dec 2019 08:10:57 +0000 Received: from localhost ([127.0.0.1]:37018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibgnJ-0000jk-37 for submit@debbugs.gnu.org; Mon, 02 Dec 2019 03:10:57 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ibgnF-0000jU-Ub for 37886-done@debbugs.gnu.org; Mon, 02 Dec 2019 03:10:55 -0500 Received: by mail-wm1-f66.google.com with SMTP id u8so6489882wmu.0 for <37886-done@debbugs.gnu.org>; Mon, 02 Dec 2019 00:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=N3Qc4mE0Ri/egsDbW4UTOq+kFYBGTplwec+vTYsIBuo=; b=vDiJ9iUF/h4HQulIZqnsDqBIvRz1c9M6NRov2LuUH11uLe+ChaBh/lgPU5te0yeJeO s0gCkUxQ4+8juEcPbxnLw9ifOxsZK/dNeXRNDwDUVuVdelrqlkdIAw2cjIv8uoS4C+kU aiZ3TO9s696TG2uAExCEOSv8bNZJ0cUdYMkQ6TFZvB1yFtjgz/8rJR7cjcHwUxWMWr1y D3k57ox59cUoh0raly9NK5NAP2al8NjlHPPG5RAXvpW29q2iBQr4ecmbcKR2acBzvMGu f8HUrtih68JOkFdIW4crCIwGlAI0GdMkmgGca8fPb9K7KLV/kov/8G80JeLQ89GGOv5E NoPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=N3Qc4mE0Ri/egsDbW4UTOq+kFYBGTplwec+vTYsIBuo=; b=h9RTSdwrjF2bjA/i/BVF0ZaEUPpWxSBWkY6VS2+hiF3naZTRwthkzhEureTfpnAg8Z JXCXCj4YK+UkdMlsiI3iPLbf6XbTdnzPRva3hI07+rKqLqYycCXP8VPGGikV+x1dHju+ S1f0hnzr0pn57NPDJrZUBzZu050y8uShkYOlgvoc1Fr9JRhMV+HML0mFoZHhNgTfBN4t qRlbn1YnDses1ujhJiZKeuNLhvShZs/hFqJezmmVcItt+OJdv+81mjvQYqwAOsR/QbGl Hbqqu6SJghSlWBiGyBUIIX3iOIiCgGKyZ+0jSRGE6qd5IIB1Q4bv9VNVG+VVKanplkhq sBZw== X-Gm-Message-State: APjAAAWdSTpZW2Z80eRuOKjoSp8J7dHWfDLQ9Tr0QglGJV1JdNCs6DAe O8/0qLzz30Y+X2CHfnIdInpxYoRS X-Google-Smtp-Source: APXvYqwr6zFbs5bATCZMIG6e2IBXjNSAQ3W1xChCc9perAav7tEoaIpAUYTN8S5Sy+28c33hRzUtlg== X-Received: by 2002:a1c:c90e:: with SMTP id f14mr1455730wmb.47.1575274247834; Mon, 02 Dec 2019 00:10:47 -0800 (PST) Received: from meru (lfbn-ann-1-237-90.w86-200.abo.wanadoo.fr. [86.200.196.90]) by smtp.gmail.com with ESMTPSA id z189sm7906839wmc.2.2019.12.02.00.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 00:10:46 -0800 (PST) References: <87zhhqyy6y.fsf@gmail.com> <87a78jttef.fsf@gnu.org> User-agent: mu4e 1.2.0; emacs 26.3 From: Mathieu Othacehe To: Daniel =?utf-8?Q?Sch=C3=A4fer?= Subject: Re: [bug#37886] [PATCH] gnu: Add ipcalc. In-reply-to: Date: Mon, 02 Dec 2019 09:10:44 +0100 Message-ID: <878snvkv0b.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 37886-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 37886-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Daniel, > It seems that etc/indent-code.el does not correct that particular formatting difference, which I had in my description attribute. > I corrected it manually, according to what the other packages look like. > It's also moved into networking.scm. I simplified the builder procedure and removed an explicit reference to package version. I also fixed the license field and the description. Anyway, pushed, thanks for your patch :) Mathieu ------------=_1575274262-2853-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Oct 2019 14:10:19 +0000 Received: from localhost ([127.0.0.1]:34731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNHL8-0000X3-LD for submit@debbugs.gnu.org; Wed, 23 Oct 2019 10:10:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:56857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNGvt-0005q3-NJ for submit@debbugs.gnu.org; Wed, 23 Oct 2019 09:44:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49069) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNGvs-0001Im-1c for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNGvq-00040w-KY for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:11 -0400 Received: from ciffreo.uberspace.de ([185.26.156.173]:41808) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNGvq-00040M-Au for guix-patches@gnu.org; Wed, 23 Oct 2019 09:44:10 -0400 Received: (qmail 18761 invoked from network); 23 Oct 2019 13:44:08 -0000 Received: from unknown (HELO ?10.30.0.173?) (15.203.178.50) by ciffreo.uberspace.de with SMTP; 23 Oct 2019 13:44:08 -0000 To: guix-patches@gnu.org From: =?UTF-8?Q?Daniel_Sch=c3=a4fer?= Subject: [PATCH] gnu: Add ipcalc. Message-ID: Date: Wed, 23 Oct 2019 15:44:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 185.26.156.173 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 23 Oct 2019 10:10:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, here's my first patch to guix - please let me know whether everything's okay. It adds the ipcalc package which can calculate IP ranges. Example: $ /gnu/store/7jw45m8d1hcaihnr7978qqg1didl048a-ipcalc-0.41/bin/ipcalc 192.168.0.1/24 Address: 192.168.0.1 11000000.10101000.00000000. 00000001 Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000 Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111 => Network: 192.168.0.0/24 11000000.10101000.00000000. 00000000 HostMin: 192.168.0.1 11000000.10101000.00000000. 00000001 HostMax: 192.168.0.254 11000000.10101000.00000000. 11111110 Broadcast: 192.168.0.255 11000000.10101000.00000000. 11111111 Hosts/Net: 254 Class C, Private Internet * gnu/packages/ipcalc.scm (ipcalc): New file. --- gnu/packages/ipcalc.scm | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gnu/packages/ipcalc.scm diff --git a/gnu/packages/ipcalc.scm b/gnu/packages/ipcalc.scm new file mode 100644 index 0000000000..5f83389b25 --- /dev/null +++ b/gnu/packages/ipcalc.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2019 Daniel Schaefer +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages ipcalc) + #:use-module (gnu packages perl) + #:use-module (gnu packages) + #:use-module (guix download) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix build-system gnu)) + +(define-public ipcalc + (package + (name "ipcalc") + (version "0.41") + (source (origin + (method url-fetch) + (uri (string-append "http://jodies.de/ipcalc-archive/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "12if9sm8h2ac0pgwkw835cgyqjxm6h27k4kfn2vfas9krrqwbafx")))) + (inputs `(("perl" ,perl))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f ; No test suite + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out-bin (string-append + (assoc-ref outputs "out") + "/bin"))) + (install-file "ipcalc" out-bin) + #t)))))) + (synopsis "Simple IP network calculator") + (description "ipcalc takes an IP address and netmask and calculates the + resulting broadcast, network, Cisco wildcard mask, and host + range. By giving a second netmask, you can design subnets and + supernets. It is also intended to be a teaching tool and + presents the subnetting results as easy-to-understand binary + values.") + (home-page "http://jodies.de/ipcalc") + (license gpl2+))) -- 2.23.0 ------------=_1575274262-2853-1--