From: ng0 <ngillm...@runbox.com>

* gnu/packages/debbugs.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk             |   1 +
 gnu/packages/debbugs.scm | 121 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100644 gnu/packages/debbugs.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 59fc1a82c..da1e159ac 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -97,6 +97,7 @@ GNU_SYSTEM_MODULES =                          \
   %D%/packages/dav.scm                         \
   %D%/packages/dc.scm                          \
   %D%/packages/debug.scm                       \
+  %D%/packages/debbugs.scm                      \
   %D%/packages/dejagnu.scm                     \
   %D%/packages/dico.scm                                \
   %D%/packages/dictionaries.scm                        \
diff --git a/gnu/packages/debbugs.scm b/gnu/packages/debbugs.scm
new file mode 100644
index 000000000..6ddf170fb
--- /dev/null
+++ b/gnu/packages/debbugs.scm
@@ -0,0 +1,121 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 ng0 <contact....@cryptolab.net>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages debbugs)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages links)
+  #:use-module (gnu packages lynx)
+  #:use-module (gnu packages mail)
+  #:use-module (gnu packages perl)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix utils)
+  #:use-module (guix build-system gnu))
+
+(define-public debbugs
+  (package
+    (name "debbugs")
+    (version "2.4.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://debian/pool/main/d/debbugs/"
+                           name "_" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1j6zg7g2d97ihc8ydb9pl56xyh2x202vk7l3cld01xaa5ssxlxgs"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("perl" ,perl)
+       ("links" ,links)
+       ("lynx" ,lynx)))
+    (arguments
+     `(#:make-flags (list (string-append "DESTDIR="
+                                         (assoc-ref %outputs "out")))
+       #:tests? #f ; No checks
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'configure ; No configure
+           (lambda _
+             (substitute* "Makefile"
+               (("/usr") ""))))
+         (add-before 'build 'create-doc-dir
+           (lambda _
+             (mkdir-p (string-append (assoc-ref %outputs "out")
+                                     "/share/doc/debbugs"))))
+         (add-after 'unpack 'fix-absolute-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share/debbugs/examples/"))
+                    (links (string-append (assoc-ref inputs "links")
+                                          "/bin/links"))
+                    (lynx (string-append (assoc-ref inputs "lynx")
+                                         "/bin/lynx")))
+               (substitute* (list "cgi/pkgreport.cgi" "cgi/bugreport.cgi"
+                                  "cgi/common.pl" "scripts/processall.in"
+                                  "scripts/rebuild.in" "scripts/service.in"
+                                  "scripts/db2html.in" "scripts/config.in"
+                                  "scripts/html-control.in" 
"scripts/summary.in"
+                                  "scripts/process.in" "scripts/expire.in"
+                                  "scripts/receive.in" "scripts/mailsummary.in"
+                                  "html/Reporting.html.in" "debbugs-service")
+                 (("/usr") out))
+               (substitute* "debian/debbugsconfig"
+                 (("/etc") (string-append out "/etc"))
+                 (("/usr/share/debbugs/examples/") share)
+                 (("/usr/bin/links") links)
+                 (("/usr/bin/lynx") lynx))
+               (substitute* "scripts/config.in"
+                 (("/var") (string-append out "/var"))
+                 (("/debian") (string-append out "/debian")))
+               (substitute* (list "scripts/summary.in" "scripts/rebuild.in"
+                                  "scripts/html-control.in"
+                                  "scripts/config.in.default"
+                                  "scripts/config.in" "scripts/process.in"
+                                  "scripts/receive.in" "scripts/db2html.in"
+                                  "scripts/html-install.in"
+                                  "scripts/mailsummary.in"
+                                  "scripts/service.in" "scripts/expire.in")
+                 (("/etc") (string-append out "/etc"))))))
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make sure all executables in "bin" find the Perl modules
+             ;; provided by this package at runtime.
+             (let* ((out  (assoc-ref outputs "out"))
+                    (sbin  (string-append out "/sbin/"))
+                    (lib (string-append out "/lib/debbugs/"))
+                    (path (getenv "PERL5LIB")))
+               (for-each (lambda (file)
+                           (wrap-program file
+                             `("PERL5LIB" ":" prefix (,path))))
+                         (find-files sbin "\\.*$"))
+               (for-each (lambda (file)
+                           (wrap-program file
+                             `("PERL5LIB" ":" prefix (,path))))
+                         (find-files lib "\\.*$"))
+               #t))))))
+    (home-page "http://www.debian.org/Bugs/";)
+    (synopsis "Bug tracking system based on the active Debian BTS")
+    (description
+     "Debbugs is a bug tracking system which files details of bugs reported
+by users and developers.  Each bug is given a number, and is kept on file
+until it is marked as having been dealt with.  The system is mainly
+controlled by e-mail, but the bug reports can be viewed using the WWW.")
+    (license license:gpl2)))
-- 
2.11.0


Reply via email to