From patchwork Mon Apr 5 18:37:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 28329 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 9FCE127BC68; Mon, 5 Apr 2021 19:40:48 +0100 (BST) 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_SIGNED, 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 5F38A27BC67 for ; Mon, 5 Apr 2021 19:40:47 +0100 (BST) Received: from localhost ([::1]:52134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTU9W-0003kd-Gm for patchwork@mira.cbaines.net; Mon, 05 Apr 2021 14:40:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTU7q-00039m-Hn for guix-patches@gnu.org; Mon, 05 Apr 2021 14:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lTU7q-0002Qp-4m for guix-patches@gnu.org; Mon, 05 Apr 2021 14:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lTU7q-0001hi-0E for guix-patches@gnu.org; Mon, 05 Apr 2021 14:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47604] [PATCH] gnu: Add crm114. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Apr 2021 18:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47604 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47604@debbugs.gnu.org Cc: Arun Isaac X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16176478856474 (code B ref -1); Mon, 05 Apr 2021 18:39:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Apr 2021 18:38:05 +0000 Received: from localhost ([127.0.0.1]:38554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTU6p-0001g0-0C for submit@debbugs.gnu.org; Mon, 05 Apr 2021 14:38:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:51770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lTU6n-0001fs-38 for submit@debbugs.gnu.org; Mon, 05 Apr 2021 14:37:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTU6m-0002uW-Ry for guix-patches@gnu.org; Mon, 05 Apr 2021 14:37:56 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:54482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTU6i-0001uM-TI for guix-patches@gnu.org; Mon, 05 Apr 2021 14:37:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QoVSCi5WE7s+xYyBqzOCqbgtBb9kQiZXLTJNRb9GbRM=; b=Kg3RRoGTpb/P1Qw3n0YPzaONkM oePsdveSKcYg3P8pzyPpCTSmbC4dav4alDE70ldDeFaOhNMxAtXCLHy6Uiu/mWaYFcqitjv1oYVLP SRCErrg5E9SHfvI0qDfjgnrZVsey97+pEciY0eqtH0LPlHyGOm9vL0yVVMFylujUYf4bAL6waE4Lx UPCD4kEePV4AKP5cVfTLosBzGBbu2ciNhZxD2amc8m/PQALf0NT0PdKs/QQUsiCc7/P2WwxEbOGF4 XQsHhIJVTi/9wMuFoteVfVVknC9Z1VbHGYzTeCwVzZwmKaBD8vwRmkK1ckFPg8tzVvGFv5ZViEFff sVsehFww==; Received: from [192.168.2.1] (helo=localhost.localdomain) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lTU0G-0018qs-7v; Tue, 06 Apr 2021 00:01:12 +0530 From: Arun Isaac Date: Tue, 6 Apr 2021 00:07:40 +0530 Message-Id: <20210405183740.9181-1-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Received-SPF: pass client-ip=139.59.75.54; envelope-from=arunisaac@systemreboot.net; helo=mugam.systemreboot.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 * gnu/packages/mail.scm (crm114): New variable. --- gnu/packages/mail.scm | 82 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 489053544b..dfc45983df 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2016, 2017 Troy Sankey ;;; Copyright © 2016, 2017, 2018 Nikita ;;; Copyright © 2016 Clément Lassieur -;;; Copyright © 2016, 2017, 2018, 2019, 2020 Arun Isaac +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Arun Isaac ;;; Copyright © 2016 John Darrington ;;; Copyright © 2016, 2018 Marius Bakke ;;; Copyright © 2017 Thomas Danckaert @@ -129,6 +129,7 @@ #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages ragel) + #:use-module (gnu packages regex) #:use-module (gnu packages rdf) #:use-module (gnu packages readline) #:use-module (gnu packages ruby) @@ -4296,3 +4297,82 @@ black lists. Each message is analysed by Rspamd and given a spam score.") (home-page "https://www.rspamd.com/") (license license:asl2.0))) + +(define-public crm114 + (package + (name "crm114") + (version "20100106") + (source + (origin + (method url-fetch) + (uri (string-append "http://crm114.sourceforge.net/tarballs/crm114-" + version "-BlameMichelson.src.tar.gz")) + (sha256 + (base32 + "0awcjc5j2mclkkpbjyijj9mv8xjz3haljvaj0fyc4fm4xir68qpv")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + ((guix build emacs-build-system) #:prefix emacs:) + (guix build utils) + (ice-9 string-fun)) + #:imported-modules (,@%gnu-build-system-modules + (guix build emacs-build-system) + (guix build emacs-utils)) + #:make-flags (list (string-append "prefix=" %output) + "LDFLAGS=") ; disable static linking + ;; Test suite is not fully automated. It requires a human to read the + ;; results and determine if the tests have passed. + #:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'fix-build + (lambda _ + ;; Inline functions can only be used from the same compilation + ;; unit. This causes the build to fail. + (substitute* "crm_svm_matrix.c" + (("^inline ") "")))) + (add-before 'install 'pre-install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; Install maillib.crm library. + (install-file "maillib.crm" (string-append out "/share/crm")) + ;; Set absolute store paths. + (substitute* "mailreaver.crm" + (("insert maillib.crm") + (string-append "insert " out "/share/crm/maillib.crm")) + (("\\\\/bin\\\\/ls") + (string-replace-substring (which "ls") "/" "\\/")) + ((":\\*:trainer_invoke_command:") + (string-append out "/bin/mailtrainer.crm"))) + ;; Install mail related crm scripts. + (for-each (lambda (file) + (install-file file (string-append out "/bin"))) + (list "mailfilter.crm" "mailreaver.crm" "mailtrainer.crm")) + ;; Create emacs site-lisp directory so that the install phase + ;; can install crm-mode. + (mkdir-p (string-append out "/share/emacs/site-lisp"))))) + ;; Run phases from the emacs build system. + (add-after 'install 'make-autoloads + (assoc-ref emacs:%standard-phases 'make-autoloads)) + (add-after 'make-autoloads 'enable-autoloads-compilation + (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation)) + (add-after 'enable-autoloads-compilation 'emacs-build + (assoc-ref emacs:%standard-phases 'build)) + (add-after 'emacs-build 'validate-compiled-autoloads + (assoc-ref emacs:%standard-phases 'validate-compiled-autoloads))))) + (inputs + `(("tre" ,tre))) + (native-inputs + `(("emacs" ,emacs-minimal))) + (home-page "http://crm114.sourceforge.net/") + (synopsis "Controllable regex mutilator") + (description "CRM114 is a system to examine incoming e-mail, system log +streams, data files or other data streams, and to sort, filter, or alter the +incoming files or data streams according to the user's wildest desires. +Criteria for categorization of data can be via a host of methods, including +regexes, approximate regexes, a Hidden Markov Model, Orthogonal Sparse +Bigrams, WINNOW, Correllation, KNN/Hyperspace, or Bit Entropy (or by other +means--it's all programmable).") + (license license:gpl3)))