uucp.scm 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages uucp)
  20. #:use-module (gnu packages golang)
  21. #:use-module (gnu packages texinfo)
  22. #:use-module (guix licenses)
  23. #:use-module (guix packages)
  24. #:use-module (guix download)
  25. #:use-module (guix build-system gnu)
  26. #:use-module (guix build-system go))
  27. (define-public uucp
  28. (package
  29. (name "uucp")
  30. (version "1.07")
  31. (source (origin
  32. (method url-fetch)
  33. (uri (string-append "mirror://gnu/uucp/uucp-"
  34. version ".tar.gz"))
  35. (sha256
  36. (base32
  37. "0b5nhl9vvif1w3wdipjsk8ckw49jj1w85xw1mmqi3zbcpazia306"))))
  38. (build-system gnu-build-system)
  39. (arguments
  40. '(#:phases
  41. (modify-phases %standard-phases
  42. (replace 'configure
  43. (lambda* (#:key outputs #:allow-other-keys)
  44. ;; The old 'configure' script doesn't support the arguments
  45. ;; that we pass by default.
  46. (setenv "CONFIG_SHELL" (which "sh"))
  47. (let ((out (assoc-ref outputs "out")))
  48. (invoke "./configure"
  49. (string-append "--prefix=" out)
  50. (string-append "--infodir=" out
  51. "/share/info"))))))))
  52. (home-page "https://www.gnu.org/software/uucp/uucp.html")
  53. (synopsis "UUCP protocol implementation")
  54. (description
  55. "Taylor UUCP is the GNU implementation of UUCP (Unix-to-Unix Copy), a
  56. set of utilities for remotely transferring files, email and net news
  57. between computers.")
  58. (license gpl2+)))
  59. (define-public nncp
  60. (package
  61. (name "nncp")
  62. (version "7.5.0")
  63. (source
  64. (origin
  65. (method url-fetch)
  66. (uri (string-append "http://www.nncpgo.org/download/nncp-"
  67. version ".tar.xz"))
  68. (sha256
  69. (base32
  70. "1r1zgj7gpkdmdm3wf31m0xi8y313kzd4dbyp4r4y8khnp32jvn8l"))
  71. (modules '((ice-9 ftw)
  72. (guix build utils)))
  73. (snippet
  74. '(begin
  75. ;; Unbundle dependencies.
  76. ;; TODO: go.cypherpunks.ru was down at the time of
  77. ;; packaging. Unbundle go.cypherpunks dependencies as well once it
  78. ;; comes back online.
  79. (for-each (lambda (file)
  80. (unless (member file (list "." ".." "go.cypherpunks.ru"))
  81. (delete-file-recursively (string-append "src/vendor/" file))))
  82. (scandir "src/vendor"))
  83. ;; Delete built documentation.
  84. (delete-file "doc/nncp.info")
  85. #t))))
  86. (build-system gnu-build-system)
  87. (arguments
  88. `(#:modules ((guix build gnu-build-system)
  89. ((guix build go-build-system) #:prefix go:)
  90. (guix build utils))
  91. #:imported-modules ,%go-build-system-modules
  92. #:phases
  93. (modify-phases %standard-phases
  94. (add-before 'unpack 'setup-go-environment
  95. (assoc-ref go:%standard-phases 'setup-go-environment))
  96. (add-after 'unpack 'go-unpack
  97. (lambda* (#:key source #:allow-other-keys)
  98. ;; Copy source to GOPATH.
  99. (copy-recursively "src" "../src/go.cypherpunks.ru/nncp/v7")
  100. ;; Move bundled dependencies to GOPATH.
  101. (for-each (lambda (dependency)
  102. (rename-file (string-append "src/vendor/go.cypherpunks.ru/"
  103. dependency)
  104. (string-append "../src/go.cypherpunks.ru/"
  105. dependency)))
  106. (list "balloon" "recfile"))
  107. ;; Delete empty bundled dependencies directory.
  108. (delete-file-recursively "src/vendor")))
  109. (replace 'configure
  110. (lambda* (#:key outputs #:allow-other-keys)
  111. (let ((out (assoc-ref outputs "out")))
  112. ;; Set configuration path.
  113. (setenv "CFGPATH" "/etc/nncp.hjson")
  114. ;; Set output directories.
  115. (setenv "BINDIR" (string-append out "/bin"))
  116. (setenv "INFODIR" (string-append out "/share/info"))
  117. (setenv "DOCDIR" (string-append out "/share/doc/nncp")))
  118. ;; Set absolute store paths to sh and cat.
  119. (substitute* (list "src/pipe.go" "src/toss_test.go")
  120. (("/bin/sh") (which "sh")))
  121. (substitute* "src/toss_test.go"
  122. (("; cat") (string-append "; " (which "cat"))))
  123. ;; Remove module flags.
  124. (substitute* (list "bin/default.do" "bin/hjson-cli.do" "test.do")
  125. ((" -mod=vendor") "")
  126. ((" -m") ""))
  127. ;; Use the correct module path. `go list` does not report the
  128. ;; correct module path since we have moved the source files.
  129. (substitute* "bin/default.do"
  130. (("^mod=[^\n]*" all) "mod=go.cypherpunks.ru/nncp/v7"))
  131. ;; Disable timeout in tests. Tests can take longer than the
  132. ;; default timeout on spinning disks.
  133. (substitute* "test.do"
  134. (("test") "test -timeout 0"))))
  135. (replace 'check
  136. (lambda* (#:key tests? #:allow-other-keys)
  137. (when tests?
  138. (invoke "contrib/do" "-c" "test"))))
  139. (add-after 'install 'remove-go-references
  140. (assoc-ref go:%standard-phases 'remove-go-references)))))
  141. (inputs
  142. `(("go-github-com-davecgh-go-xdr" ,go-github-com-davecgh-go-xdr)
  143. ("go-github-com-dustin-go-humanize" ,go-github-com-dustin-go-humanize)
  144. ("go-github-com-flynn-noise" ,go-github-com-flynn-noise)
  145. ("go-github-com-gorhill-cronexpr" ,go-github-com-gorhill-cronexpr)
  146. ("go-github-com-hjson-hjson-go" ,go-github-com-hjson-hjson-go)
  147. ("go-github-com-klauspost-compress" ,go-github-com-klauspost-compress)
  148. ("go-golang-org-x-crypto" ,go-golang-org-x-crypto)
  149. ("go-golang-org-x-net" ,go-golang-org-x-net)
  150. ("go-golang-org-x-term" ,go-golang-org-x-term)
  151. ("go-lukechampine-com-blake3" ,go-lukechampine-com-blake3)))
  152. (native-inputs
  153. `(("go" ,go)
  154. ("texinfo" ,texinfo)))
  155. (home-page "http://www.nncpgo.org/")
  156. (synopsis "Store and forward utilities")
  157. (description "NNCP (Node to Node copy) is a collection of utilities
  158. simplifying secure store-and-forward files, mail and command exchanging.
  159. These utilities are intended to help build up small size (dozens of nodes)
  160. ad-hoc friend-to-friend (F2F) statically routed darknet delay-tolerant
  161. networks for fire-and-forget secure reliable files, file requests, Internet
  162. mail and commands transmission. All packets are integrity checked, end-to-end
  163. encrypted, explicitly authenticated by known participants public keys. Onion
  164. encryption is applied to relayed packets. Each node acts both as a client and
  165. server, can use push and poll behaviour model. Multicasting areas, offline
  166. sneakernet/floppynet, dead drops, sequential and append-only CD-ROM/tape
  167. storages, air-gapped computers and online TCP daemon with full-duplex
  168. resumable data transmission exists are all supported.")
  169. (license gpl3)))